A cross-platform UI framework for .NET
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.
 
 
 

55 lines
1.5 KiB

using System.Runtime.InteropServices;
using OpenQA.Selenium.Appium;
using Xunit;
namespace Avalonia.IntegrationTests.Appium
{
[Collection("Default")]
public class ButtonTests
{
private readonly AppiumDriver<AppiumWebElement> _session;
public ButtonTests(DefaultAppFixture 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);
}
[PlatformFact(TestPlatforms.Windows)]
public void ButtonWithAcceleratorKey()
{
var button = _session.FindElementByAccessibilityId("ButtonWithAcceleratorKey");
Assert.Equal("Ctrl+B", button.GetAttribute("AcceleratorKey"));
}
}
}