ButtonTests.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using Xunit;
  2. namespace Avalonia.IntegrationTests.Appium
  3. {
  4. [Collection("Default")]
  5. public class ButtonTests : TestBase
  6. {
  7. public ButtonTests(DefaultAppFixture fixture)
  8. : base(fixture, "Button")
  9. {
  10. }
  11. [Fact]
  12. public void DisabledButton()
  13. {
  14. var button = Session.FindElementByAccessibilityId("DisabledButton");
  15. Assert.Equal("Disabled Button", button.Text);
  16. Assert.False(button.Enabled);
  17. }
  18. [Fact]
  19. public void EffectivelyDisabledButton()
  20. {
  21. var button = Session.FindElementByAccessibilityId("EffectivelyDisabledButton");
  22. Assert.Equal("Effectively Disabled Button", button.Text);
  23. Assert.False(button.Enabled);
  24. }
  25. [Fact]
  26. public void BasicButton()
  27. {
  28. var button = Session.FindElementByAccessibilityId("BasicButton");
  29. Assert.Equal("Basic Button", button.Text);
  30. Assert.True(button.Enabled);
  31. }
  32. [Fact]
  33. public void ButtonWithTextBlock()
  34. {
  35. var button = Session.FindElementByAccessibilityId("ButtonWithTextBlock");
  36. Assert.Equal("Button with TextBlock", button.Text);
  37. }
  38. [PlatformFact(TestPlatforms.Windows)]
  39. public void ButtonWithAcceleratorKey()
  40. {
  41. var button = Session.FindElementByAccessibilityId("ButtonWithAcceleratorKey");
  42. Assert.Equal("Ctrl+B", button.GetAttribute("AcceleratorKey"));
  43. }
  44. }
  45. }