csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.4 KiB
54 lines
1.4 KiB
using OpenQA.Selenium.Appium;
|
|
using Xunit;
|
|
|
|
namespace Avalonia.IntegrationTests.Win32
|
|
{
|
|
[Collection("Default")]
|
|
public class ButtonTests
|
|
{
|
|
private AppiumDriver<AppiumWebElement> _session;
|
|
|
|
public ButtonTests(TestAppFixture fixture)
|
|
{
|
|
_session = fixture.Session;
|
|
|
|
var tabs = _session.FindElementByAccessibilityId("MainTabs");
|
|
var tab = tabs.FindElementByName("Button");
|
|
tab.Click();
|
|
}
|
|
|
|
[Fact]
|
|
public void DisabledButton()
|
|
{
|
|
var button = _session.FindElementByAccessibilityId("DisabledButton");
|
|
|
|
Assert.Equal("Disabled Button", button.Text);
|
|
Assert.False(button.Enabled);
|
|
}
|
|
|
|
[Fact]
|
|
public void BasicButton()
|
|
{
|
|
var button = _session.FindElementByAccessibilityId("BasicButton");
|
|
|
|
Assert.Equal("Basic Button", button.Text);
|
|
Assert.True(button.Enabled);
|
|
}
|
|
|
|
[Fact]
|
|
public void ButtonWithTextBlock()
|
|
{
|
|
var button = _session.FindElementByAccessibilityId("ButtonWithTextBlock");
|
|
|
|
Assert.Equal("Button with TextBlock", button.Text);
|
|
}
|
|
|
|
[Fact]
|
|
public void ButtonWithAcceleratorKey()
|
|
{
|
|
var button = _session.FindElementByAccessibilityId("ButtonWithAcceleratorKey");
|
|
|
|
Assert.Equal("Ctrl+B", button.GetAttribute("AcceleratorKey"));
|
|
}
|
|
}
|
|
}
|
|
|