Browse Source
When opening a context menu and pressing the "arrow down" key, the first menu item was not selected. This issue was introduced by #11287. The fix is to make the `ContextMenu` focusable. Added an integration test to try to prevent regressions. Co-authored-by: Max Katz <maxkatz6@outlook.com>release/11.0.13
5 changed files with 52 additions and 2 deletions
@ -0,0 +1,36 @@ |
|||
using OpenQA.Selenium; |
|||
using OpenQA.Selenium.Appium; |
|||
using OpenQA.Selenium.Interactions; |
|||
using Xunit; |
|||
|
|||
namespace Avalonia.IntegrationTests.Appium |
|||
{ |
|||
[Collection("Default")] |
|||
public class ContextMenuTests |
|||
{ |
|||
private readonly AppiumDriver<AppiumWebElement> _session; |
|||
|
|||
public ContextMenuTests(DefaultAppFixture fixture) |
|||
{ |
|||
_session = fixture.Session; |
|||
|
|||
var tabs = _session.FindElementByAccessibilityId("MainTabs"); |
|||
var tab = tabs.FindElementByName("ContextMenu"); |
|||
tab.Click(); |
|||
} |
|||
|
|||
[PlatformFact(TestPlatforms.Windows)] |
|||
public void Select_First_Item_With_Down_Arrow_Key() |
|||
{ |
|||
var control = _session.FindElementByAccessibilityId("ShowContextMenu"); |
|||
|
|||
new Actions(_session) |
|||
.ContextClick(control) |
|||
.SendKeys(Keys.ArrowDown) |
|||
.Perform(); |
|||
|
|||
var clickedMenuItem = _session.FindElementByAccessibilityId("ContextMenuItem1"); |
|||
Assert.True(clickedMenuItem.GetIsFocused()); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue