mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 01:36:31 +02:00
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Before: <img width="1198" height="718" alt="image" src="https://github.com/user-attachments/assets/79a23cb3-93c6-4960-afc5-60c147f8ae92" /> After: <img width="1175" height="716" alt="image" src="https://github.com/user-attachments/assets/c4ea1e2d-ad47-4203-a77a-99f22bcfb448" /> <img width="630" height="434" alt="image" src="https://github.com/user-attachments/assets/8ad1d424-2907-4599-965d-1193effaf7bd" /> <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] Closes: #38730 (a lot of the suggestions there were already resolved. <!-- - [ ] Closes: #yyy (add separate lines for additional resolved issues) --> - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com>
130 lines
3.8 KiB
C#
130 lines
3.8 KiB
C#
// Copyright (c) Microsoft Corporation
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
using System;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.PowerToys.UITest;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
namespace Microsoft.CmdPal.UITests;
|
|
|
|
[TestClass]
|
|
public class BasicTests : CommandPaletteTestBase
|
|
{
|
|
public BasicTests()
|
|
{
|
|
}
|
|
|
|
[TestMethod]
|
|
public void BasicFileSearchTest()
|
|
{
|
|
SetSearchBox("files");
|
|
|
|
var searchFileItem = this.Find<NavigationViewItem>("Search files");
|
|
Assert.AreEqual(searchFileItem.Name, "Search files");
|
|
searchFileItem.DoubleClick();
|
|
|
|
SetFilesExtensionSearchBox("AppData");
|
|
|
|
Assert.IsNotNull(this.Find<NavigationViewItem>("AppData"));
|
|
}
|
|
|
|
[TestMethod]
|
|
public void BasicCalculatorTest()
|
|
{
|
|
SetSearchBox("calculator");
|
|
|
|
var searchFileItem = this.Find<NavigationViewItem>("Calculator");
|
|
Assert.AreEqual(searchFileItem.Name, "Calculator");
|
|
searchFileItem.DoubleClick();
|
|
|
|
SetCalculatorExtensionSearchBox("1+2");
|
|
|
|
Assert.IsNotNull(this.Find<NavigationViewItem>("3"));
|
|
}
|
|
|
|
[TestMethod]
|
|
public void BasicTimeAndDateTest()
|
|
{
|
|
SetSearchBox("time and date");
|
|
|
|
var searchFileItem = this.Find<NavigationViewItem>("Time and date");
|
|
Assert.AreEqual(searchFileItem.Name, "Time and date");
|
|
searchFileItem.DoubleClick();
|
|
|
|
SetTimeAndDaterExtensionSearchBox("year");
|
|
|
|
Assert.IsNotNull(this.Find<NavigationViewItem>("2026"));
|
|
}
|
|
|
|
[TestMethod]
|
|
public void BasicWindowsTerminalTest()
|
|
{
|
|
SetSearchBox("Windows Terminal");
|
|
|
|
var searchFileItem = this.Find<NavigationViewItem>("Open Windows Terminal profiles");
|
|
Assert.AreEqual(searchFileItem.Name, "Open Windows Terminal profiles");
|
|
searchFileItem.DoubleClick();
|
|
|
|
// SetSearchBox("PowerShell");
|
|
// Assert.IsNotNull(this.Find<NavigationViewItem>("PowerShell"));
|
|
}
|
|
|
|
[TestMethod]
|
|
public void BasicWindowsSettingsTest()
|
|
{
|
|
SetSearchBox("Windows settings");
|
|
|
|
var searchFileItem = this.Find<NavigationViewItem>("Windows settings");
|
|
Assert.AreEqual(searchFileItem.Name, "Windows settings");
|
|
searchFileItem.DoubleClick();
|
|
|
|
SetSearchBox("power");
|
|
|
|
Assert.IsNotNull(this.Find<NavigationViewItem>("Power and sleep"));
|
|
}
|
|
|
|
[TestMethod]
|
|
public void BasicRegistryTest()
|
|
{
|
|
SetSearchBox("Registry");
|
|
|
|
var searchFileItem = this.Find<NavigationViewItem>("Registry");
|
|
Assert.AreEqual(searchFileItem.Name, "Registry");
|
|
searchFileItem.DoubleClick();
|
|
|
|
// Type the string will cause strange behavior.so comment it out for now.
|
|
// SetSearchBox(@"HKEY_LOCAL_MACHINE");
|
|
// Assert.IsNotNull(this.Find<NavigationViewItem>(@"HKEY_LOCAL_MACHINE\SECURITY"));
|
|
}
|
|
|
|
[TestMethod]
|
|
public void BasicWindowsServicesTest()
|
|
{
|
|
SetSearchBox("Windows Services");
|
|
|
|
var searchFileItem = this.Find<NavigationViewItem>("Windows Services");
|
|
Assert.AreEqual(searchFileItem.Name, "Windows Services");
|
|
searchFileItem.DoubleClick();
|
|
|
|
SetSearchBox("hyper-v");
|
|
|
|
Assert.IsNotNull(this.Find<NavigationViewItem>("Hyper-V Heartbeat Service"));
|
|
}
|
|
|
|
[TestMethod]
|
|
public void BasicWindowsSystemCommandsTest()
|
|
{
|
|
SetSearchBox("Windows System Commands");
|
|
|
|
var searchFileItem = this.Find<NavigationViewItem>("Windows System Commands");
|
|
Assert.AreEqual(searchFileItem.Name, "Windows System Commands");
|
|
searchFileItem.DoubleClick();
|
|
|
|
SetSearchBox("Sleep");
|
|
|
|
Assert.IsNotNull(this.Find<NavigationViewItem>("Put computer to sleep"));
|
|
}
|
|
}
|