|
@@ -9,32 +9,44 @@ namespace Avalonia.IntegrationTests.Win32
|
|
|
private WindowsDriver<WindowsElement> _session;
|
|
private WindowsDriver<WindowsElement> _session;
|
|
|
public ButtonTests(TestAppFixture fixture) => _session = fixture.Session;
|
|
public ButtonTests(TestAppFixture fixture) => _session = fixture.Session;
|
|
|
|
|
|
|
|
|
|
+ [Fact]
|
|
|
|
|
+ public void DisabledButton()
|
|
|
|
|
+ {
|
|
|
|
|
+ SelectTab();
|
|
|
|
|
+
|
|
|
|
|
+ var button = _session.FindElementByAccessibilityId("DisabledButton");
|
|
|
|
|
+
|
|
|
|
|
+ Assert.Equal("Disabled Button", button.Text);
|
|
|
|
|
+ Assert.False(button.Enabled);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
[Fact]
|
|
[Fact]
|
|
|
public void BasicButton()
|
|
public void BasicButton()
|
|
|
{
|
|
{
|
|
|
- SelectButtonTab();
|
|
|
|
|
|
|
+ SelectTab();
|
|
|
|
|
|
|
|
var button = _session.FindElementByAccessibilityId("BasicButton");
|
|
var button = _session.FindElementByAccessibilityId("BasicButton");
|
|
|
|
|
|
|
|
Assert.Equal("Basic Button", button.Text);
|
|
Assert.Equal("Basic Button", button.Text);
|
|
|
|
|
+ Assert.True(button.Enabled);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Fact]
|
|
[Fact]
|
|
|
public void ButtonWithTextBlock()
|
|
public void ButtonWithTextBlock()
|
|
|
{
|
|
{
|
|
|
- SelectButtonTab();
|
|
|
|
|
|
|
+ SelectTab();
|
|
|
|
|
|
|
|
var button = _session.FindElementByAccessibilityId("ButtonWithTextBlock");
|
|
var button = _session.FindElementByAccessibilityId("ButtonWithTextBlock");
|
|
|
|
|
|
|
|
Assert.Equal("Button with TextBlock", button.Text);
|
|
Assert.Equal("Button with TextBlock", button.Text);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private WindowsElement SelectButtonTab()
|
|
|
|
|
|
|
+ private WindowsElement SelectTab()
|
|
|
{
|
|
{
|
|
|
var tabs = _session.FindElementByAccessibilityId("MainTabs");
|
|
var tabs = _session.FindElementByAccessibilityId("MainTabs");
|
|
|
- var buttonTab = tabs.FindElementByName("Button");
|
|
|
|
|
- buttonTab.Click();
|
|
|
|
|
- return (WindowsElement)buttonTab;
|
|
|
|
|
|
|
+ var tab = tabs.FindElementByName("Button");
|
|
|
|
|
+ tab.Click();
|
|
|
|
|
+ return (WindowsElement)tab;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|