Browse Source
* Added integration test for #14525. * Release mouse capture when dialog shown. Fixes #14525. * Release X11 pointer capture when dialog shown.pull/16220/head
committed by
GitHub
8 changed files with 125 additions and 0 deletions
@ -0,0 +1,19 @@ |
|||
using System; |
|||
using System.Windows.Input; |
|||
|
|||
namespace IntegrationTestApp; |
|||
|
|||
internal class DelegateCommand : ICommand |
|||
{ |
|||
private readonly Action _action; |
|||
private readonly Func<object?, bool> _canExecute; |
|||
public DelegateCommand(Action action, Func<object?, bool>? canExecute = default) |
|||
{ |
|||
_action = action; |
|||
_canExecute = canExecute ?? new(_ => true); |
|||
} |
|||
|
|||
public event EventHandler? CanExecuteChanged { add { } remove { } } |
|||
public bool CanExecute(object? parameter) => _canExecute(parameter); |
|||
public void Execute(object? parameter) => _action(); |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
using OpenQA.Selenium.Interactions; |
|||
using Xunit; |
|||
|
|||
namespace Avalonia.IntegrationTests.Appium |
|||
{ |
|||
[Collection("Default")] |
|||
public class PointerTests |
|||
{ |
|||
private readonly AppiumDriver _session; |
|||
|
|||
public PointerTests(DefaultAppFixture fixture) |
|||
{ |
|||
_session = fixture.Session; |
|||
|
|||
var tabs = _session.FindElementByAccessibilityId("MainTabs"); |
|||
var tab = tabs.FindElementByName("Pointer"); |
|||
tab.Click(); |
|||
} |
|||
|
|||
[Fact] |
|||
public void Pointer_Capture_Is_Released_When_Showing_Dialog() |
|||
{ |
|||
var button = _session.FindElementByAccessibilityId("PointerPageShowDialog"); |
|||
|
|||
button.OpenWindowWithClick().Dispose(); |
|||
|
|||
var status = _session.FindElementByAccessibilityId("PointerCaptureStatus"); |
|||
Assert.Equal("None", status.Text); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue