Browse Source

Disable focus test on mac.

Because I can't work out how to implement the extremely advanced use-case of finding out whether a control is focused there /s
pull/7953/head
Steven Kirk 4 years ago
parent
commit
898b0fa285
  1. 12
      tests/Avalonia.IntegrationTests.Appium/ElementExtensions.cs
  2. 2
      tests/Avalonia.IntegrationTests.Appium/MenuTests.cs

12
tests/Avalonia.IntegrationTests.Appium/ElementExtensions.cs

@ -31,8 +31,16 @@ namespace Avalonia.IntegrationTests.Appium
public static bool GetIsFocused(this AppiumWebElement element)
{
var active = element.WrappedDriver.SwitchTo().ActiveElement() as AppiumWebElement;
return element.Id == active?.Id;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
var active = element.WrappedDriver.SwitchTo().ActiveElement() as AppiumWebElement;
return element.Id == active?.Id;
}
else
{
// https://stackoverflow.com/questions/71807788/check-if-element-is-focused-in-appium
throw new NotSupportedException("Couldn't work out how to check if an element is focused on mac.");
}
}
public static void SendClick(this AppiumWebElement element)

2
tests/Avalonia.IntegrationTests.Appium/MenuTests.cs

@ -145,7 +145,7 @@ namespace Avalonia.IntegrationTests.Appium
Assert.Equal("Ctrl+O", childMenuItem.GetAttribute("AcceleratorKey"));
}
[Fact]
[PlatformFact(SkipOnOSX = true)]
public void PointerOver_Does_Not_Steal_Focus()
{
// Issue #7906

Loading…
Cancel
Save