Compare commits

...

31 Commits

Author SHA1 Message Date
Yaqing Mi (from Dev Box)
ecba809c0c Revert pipeline settings 2025-04-25 11:39:24 +08:00
Yaqing Mi (from Dev Box)
e5a7a37e3f Fix pipeline errors 2025-04-24 14:38:20 +08:00
Yaqing Mi (from Dev Box)
7367defe29 Update Sleep Time 2025-04-23 19:00:02 +08:00
Yaqing Mi (from Dev Box)
75c52f81c2 Update the Sleep time 2025-04-23 18:51:36 +08:00
Yaqing Mi (from Dev Box)
b60f34c4ad Merge from other branch 2025-04-23 16:20:11 +08:00
Yaqing Mi (from Dev Box)
9d106cffe5 Add FindMyMouse Setting Tests 2025-04-23 16:15:04 +08:00
Yaqing Mi (from Dev Box)
849a78158e Fix pipeline errors 2025-04-23 13:53:18 +08:00
Yaqing Mi (from Dev Box)
ce25ec1978 Merge branch 'feature/UITestAutomation' into dev/yaqingmi/ui-automation2 2025-04-22 17:15:16 +08:00
Yaqing Mi (from Dev Box)
e4487d3fd5 Resolve Spelling errors 2025-04-22 17:01:59 +08:00
Yaqing Mi (from Dev Box)
faa68b18a3 Fix pipeline error 2025-04-22 16:48:22 +08:00
Yaqing Mi (from Dev Box)
e84ce0ff6b Fix Pipeline error for MouseHighlighter 2025-04-22 16:08:29 +08:00
Yaqing Mi (from Dev Box)
3c7fcb1aaa Merge Mouse Jump Tests from other branch 2025-04-22 14:46:13 +08:00
Yaqing Mi (from Dev Box)
4544510e6e Add MouseJump Enable/Disable Tests 2025-04-21 19:22:52 +08:00
Yaqing Mi (from Dev Box)
a5f2f49a83 Add Edit System Settings 2025-04-21 17:13:06 +08:00
Yaqing Mi (from Dev Box)
4e582c7b2c Add Sleep Time to Action Parameters 2025-04-21 14:58:46 +08:00
Yaqing Mi (from Dev Box)
d4f6208570 Add Tests for Mouse Pointer Crosshairs Enable/Disable 2025-04-18 19:46:34 +08:00
Yaqing Mi (from Dev Box)
56fc93614d Add SendKey for Session and Fix Spelling Errors 2025-04-18 14:17:42 +08:00
Yaqing Mi (from Dev Box)
ca0407794a Merge branch 'feature/UITestAutomation' into dev/yaqingmi/ui-automation 2025-04-17 18:44:53 +08:00
Yaqing Mi (from Dev Box)
fa8db5bd7a Update the SessionHelper and Sleep Time for Actions 2025-04-17 18:37:13 +08:00
Yaqing Mi (from Dev Box)
a1c649b2d1 Update NameSpace and remove redundant code 2025-04-16 17:35:46 +08:00
Yaqing Mi (from Dev Box)
6d9a30dd5f Delete src/modules/MouseUtils/FindMyMouse.UITests/FindMyMouseSettingTests.cs 2025-04-16 14:47:44 +08:00
Yaqing Mi (from Dev Box)
23a361f054 Merge branch 'feature/UITestAutomation' into dev/yaqingmi/ui-automation 2025-04-16 14:28:33 +08:00
Yaqing Mi (from Dev Box)
1063d73c13 Add Mouse Actions Support for UITest Framework 2025-04-16 14:26:04 +08:00
Yaqing Mi (from Dev Box)
21d52bbb1d Add Mouse Highlighter Enable/Disable Test Case 2025-04-15 19:53:57 +08:00
Yaqing Mi (from Dev Box)
fbdb3a63fc Add FindMyMouse Tests for Enable and Disable 2025-04-14 19:55:39 +08:00
Yaqing Mi (from Dev Box)
9a21d0f004 Merge branch 'feature/UITestAutomation' into dev/yaqingmi/ui-automation 2025-04-11 11:19:26 +08:00
Yaqing Mi (from Dev Box)
99cdc5e4df Add Mouse Click and Base Components Test 2025-04-10 19:21:07 +08:00
Yaqing Mi (from Dev Box)
764507c5cb Merge branch 'feature/UITestAutomation' into dev/yaqingmi/ui-automation 2025-04-10 16:29:13 +08:00
Yaqing Mi (from Dev Box)
8c4d360ff6 Merge branch 'main' into dev/yaqingmi/ui-automation 2025-04-10 14:46:36 +08:00
Yaqing Mi (from Dev Box)
6174b76a4f Add More Elements support for UITestAutomation 2025-04-10 14:39:56 +08:00
Clint Rutkas
fe53a9c89a empowering users to maximize OOBE to their heart desire (#37823)
empowering users to maximize to their heart desire
2025-04-09 22:27:17 -07:00
5 changed files with 97 additions and 10 deletions

View File

@@ -48,6 +48,32 @@ namespace Microsoft.PowerToys.UITest
msPostAction);
}
/// <summary>
/// Click the ListItem element.
/// </summary>
/// <param name="rightClick">If true, performs a right-click; otherwise, performs a left-click. Default value is false</param>
/// <param name="msPreAction">Pre action delay in milliseconds. Default value is 500</param>
/// <param name="msPostAction">Post action delay in milliseconds. Default value is 500</param>
public void ClickCenter(bool rightClick = false, int msPreAction = 500, int msPostAction = 500)
{
PerformAction(
(actions, windowElement) =>
{
if (rightClick)
{
actions.ContextClick();
}
else
{
actions.Click();
}
actions.Build().Perform();
},
msPreAction,
msPostAction);
}
/// <summary>
/// Double Click the ListItem element.
/// </summary>

View File

@@ -97,6 +97,62 @@ namespace MouseUtils.UITests
VerifySpotlightDisappears(ref settings);
}
[TestMethod]
public void TestEnableFindMyMouse2()
{
LaunchFromSetting();
var settings = new FindMyMouseSettings();
settings.OverlayOpacity = "100";
settings.Radius = "80";
settings.InitialZoom = "1";
settings.AnimationDuration = "0";
settings.BackgroundColor = "FFFFFF";
settings.SpotlightColor = "000000";
var foundCustom = this.Find<Custom>("Find My Mouse");
Assert.IsNotNull(foundCustom);
if (CheckAnimationEnable(ref foundCustom))
{
foundCustom = this.Find<Custom>("Find My Mouse");
}
if (foundCustom != null)
{
foundCustom.Find<ToggleSwitch>("Enable Find My Mouse").Toggle(true);
// foundCustom.Find<ToggleSwitch>("Enable Find My Mouse").Toggle(false);
SetFindMyMouseActivationMethod(ref foundCustom, "Press Left Control twice");
Assert.IsNotNull(foundCustom, "Find My Mouse group not found.");
SetFindMyMouseAppearanceBehavior(ref foundCustom, ref settings);
var excludedApps = foundCustom.Find<TextBlock>("Excluded apps");
if (excludedApps != null)
{
excludedApps.Click();
excludedApps.Click();
}
else
{
Assert.Fail("Excluded apps group not found.");
}
}
else
{
Assert.Fail("Find My Mouse group not found.");
}
// [Test Case]Test the different settings and verify they apply, Background color
// [Test Case]Test the different settings and verify they apply, Spotlight color
// [Test Case]Test the different settings and verify they apply, Spotlight radius
VerifySpotlightSettings(ref settings);
// [Test Case]Enable FindMyMouse. Then, without moving your mouse: Press any other key and verify the overlay disappears.
Session.SendKeys(Key.A);
VerifySpotlightDisappears(ref settings);
}
[TestMethod]
public void TestDisableFindMyMouse()
{
@@ -232,7 +288,7 @@ namespace MouseUtils.UITests
private void VerifySpotlightAppears(ref FindMyMouseSettings settings)
{
Task.Delay(1000).Wait();
Task.Delay(2000).Wait();
var location = Session.GetMousePosition();
int radius = int.Parse(settings.Radius, CultureInfo.InvariantCulture);
@@ -338,7 +394,7 @@ namespace MouseUtils.UITests
Assert.IsNotNull(button);
button.Click();
var popupWindow = Session.Find<Window>("Popup");
var popupWindow = this.Find<Window>("Popup");
Assert.IsNotNull(popupWindow);
Task.Delay(1000).Wait();
var colorModelComboBox = this.Find<ComboBox>("Color model");

View File

@@ -164,7 +164,9 @@ namespace MouseUtils.UITests
var colorBackground = Session.GetPixelColorString(location.Item1 + radius + 50, location.Item2 + radius + 50);
Assert.AreNotEqual(expectedColor, colorBackground);
Session.MoveMouseTo(location.Item1 - 300, location.Item2);
// Drag the mouse
Session.MoveMouseTo(location.Item1 - 200, location.Item2);
Task.Delay(2000).Wait();
location = Session.GetMousePosition();
colorLeftClick = Session.GetPixelColorString(location.Item1, location.Item2);

View File

@@ -127,14 +127,17 @@ namespace MouseUtils.UITests
private void LaunchFromSetting(bool showWarning = false, bool launchAsAdmin = false)
{
Session.SetMainWindowSize(WindowSize.Large);
Task.Delay(1000).Wait();
// Goto Hosts File Editor setting page
if (this.FindAll<NavigationViewItem>("Mouse utilities").Count == 0)
{
// Expand Advanced list-group if needed
this.Find<NavigationViewItem>("Input / Output").Click();
this.Find<NavigationViewItem>("Input / Output").ClickCenter();
}
// Click on the Mouse utilities
Task.Delay(2000).Wait();
this.Find<NavigationViewItem>("Mouse utilities").Click();
}
}

View File

@@ -129,7 +129,7 @@ namespace MouseUtils.UITests
private void VerifyMousePointerCrosshairsAppears(ref MousePointerCrosshairsSettings settings)
{
Task.Delay(500).Wait();
Task.Delay(1000).Wait();
string expectedColor = string.Empty;
expectedColor = "#" + settings.CrosshairsColor;
var location = Session.GetMousePosition();
@@ -137,19 +137,19 @@ namespace MouseUtils.UITests
int radius = int.Parse(settings.CenterRadius, CultureInfo.InvariantCulture);
var color = Session.GetPixelColorString(location.Item1, location.Item2);
Assert.AreEqual(expectedColor, color);
Assert.AreEqual(expectedColor, color, "Center color check failed");
var colorX = Session.GetPixelColorString(location.Item1 + 50, location.Item2);
Assert.AreEqual(expectedColor, colorX);
Assert.AreEqual(expectedColor, colorX, "Center x + 50 color check failed");
colorX = Session.GetPixelColorString(location.Item1 - 50, location.Item2);
Assert.AreEqual(expectedColor, colorX);
Assert.AreEqual(expectedColor, colorX, "Center x - 50 color check failed");
var colorY = Session.GetPixelColorString(location.Item1, location.Item2 + 50);
Assert.AreEqual(expectedColor, colorY);
Assert.AreEqual(expectedColor, colorY, "Center y + 50 color check failed");
colorY = Session.GetPixelColorString(location.Item1, location.Item2 - 50);
Assert.AreEqual(expectedColor, colorY);
Assert.AreEqual(expectedColor, colorY, "Center y + 50 color check failed");
}
private void SetColor(ref Custom foundCustom, string colorName, string colorValue = "000000")