|
@@ -6,7 +6,7 @@ using Xunit;
|
|
|
|
|
|
namespace Avalonia.IntegrationTests.Appium;
|
|
|
|
|
|
-[Collection("WindowDecorations")]
|
|
|
+[Collection("Default")]
|
|
|
public class PointerTests_MacOS : TestBase, IDisposable
|
|
|
{
|
|
|
public PointerTests_MacOS(DefaultAppFixture fixture)
|
|
@@ -42,6 +42,45 @@ public class PointerTests_MacOS : TestBase, IDisposable
|
|
|
|
|
|
secondaryWindow.FindElementByAccessibilityId("_XCUI:CloseWindow").Click();
|
|
|
}
|
|
|
+
|
|
|
+ [PlatformFact(TestPlatforms.MacOS)]
|
|
|
+ public void OSXThickTitleBar_Single_Click_Does_Not_Generate_DoubleTapped_Event()
|
|
|
+ {
|
|
|
+ SetParameters(true, false, true, true, true);
|
|
|
+
|
|
|
+ var showNewWindowDecorations = Session.FindElementByAccessibilityId("ShowNewWindowDecorations");
|
|
|
+ showNewWindowDecorations.Click();
|
|
|
+
|
|
|
+ Thread.Sleep(1000);
|
|
|
+
|
|
|
+ var secondaryWindow = Session.GetWindowById("SecondaryWindow");
|
|
|
+ var titleAreaControl = secondaryWindow.FindElementByAccessibilityId("TitleAreaControl");
|
|
|
+ Assert.NotNull(titleAreaControl);
|
|
|
+
|
|
|
+ // Verify initial state - counters should be 0
|
|
|
+ var initialDoubleClickCount = GetDoubleClickCount(secondaryWindow);
|
|
|
+ var initialReleaseCount = GetReleaseCount(secondaryWindow);
|
|
|
+ var initialMouseDownCount = GetMouseDownCount(secondaryWindow);
|
|
|
+ Assert.Equal(0, initialDoubleClickCount);
|
|
|
+ Assert.Equal(0, initialReleaseCount);
|
|
|
+ Assert.Equal(0, initialMouseDownCount);
|
|
|
+
|
|
|
+ // Perform a single click in titlebar area
|
|
|
+ secondaryWindow.MovePointerOver();
|
|
|
+ titleAreaControl.MovePointerOver();
|
|
|
+ titleAreaControl.SendClick();
|
|
|
+ Thread.Sleep(800);
|
|
|
+
|
|
|
+ // After first single click - mouse down = 1, release = 1, double-click = 0
|
|
|
+ var afterFirstClickMouseDownCount = GetMouseDownCount(secondaryWindow);
|
|
|
+ var afterFirstClickReleaseCount = GetReleaseCount(secondaryWindow);
|
|
|
+ var afterFirstClickDoubleClickCount = GetDoubleClickCount(secondaryWindow);
|
|
|
+ Assert.Equal(1, afterFirstClickMouseDownCount);
|
|
|
+ Assert.Equal(1, afterFirstClickReleaseCount);
|
|
|
+ Assert.Equal(0, afterFirstClickDoubleClickCount);
|
|
|
+
|
|
|
+ secondaryWindow.FindElementByAccessibilityId("_XCUI:CloseWindow").Click();
|
|
|
+ }
|
|
|
|
|
|
private void SetParameters(
|
|
|
bool extendClientArea,
|
|
@@ -79,6 +118,18 @@ public class PointerTests_MacOS : TestBase, IDisposable
|
|
|
var mouseReleaseCountTextBox = window.FindElementByAccessibilityId("MouseReleaseCount");
|
|
|
return int.Parse(mouseReleaseCountTextBox.Text ?? "0");
|
|
|
}
|
|
|
+
|
|
|
+ private int GetMouseDownCount(AppiumWebElement window)
|
|
|
+ {
|
|
|
+ var mouseDownCountTextBox = window.FindElementByAccessibilityId("MouseDownCount");
|
|
|
+ return int.Parse(mouseDownCountTextBox.Text ?? "0");
|
|
|
+ }
|
|
|
+
|
|
|
+ private int GetDoubleClickCount(AppiumWebElement window)
|
|
|
+ {
|
|
|
+ var doubleClickCountTextBox = window.FindElementByAccessibilityId("DoubleClickCount");
|
|
|
+ return int.Parse(doubleClickCountTextBox.Text ?? "0");
|
|
|
+ }
|
|
|
|
|
|
public void Dispose()
|
|
|
{
|