Skip to content

Commit

Permalink
Added a UI Test (#18668)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubaflo authored and jsuarezruiz committed Nov 14, 2024
1 parent e0138a4 commit 21ed209
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue18668.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.Issues.Issue18668">
<VerticalStackLayout>
<RadioButton x:Name="radioButton" Content="Hello, Maui!"/>
<Button AutomationId="button" Text="Disable radio button" Clicked="ButtonClicked"/>
</VerticalStackLayout>
</ContentPage>
17 changes: 17 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue18668.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace Maui.Controls.Sample.Issues
{
[XamlCompilation(XamlCompilationOptions.Compile)]
[Issue(IssueTracker.Github, 18668, "Visual state change for disabled RadioButton", PlatformAffected.All)]
public partial class Issue18668 : ContentPage
{
public Issue18668()
{
InitializeComponent();
}

private void ButtonClicked(object sender, EventArgs e)
{
radioButton.IsEnabled = false;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue18668 : _IssuesUITest
{
public override string Issue => "Visual state change for disabled RadioButton";

public Issue18668(TestDevice device) : base(device){ }

[Test]
[Category(UITestCategories.RadioButton)]
public void TestIssue18668()
{
App.WaitForElement("button");
App.Click("button");

// The test passes if the radio button is visually disabled
VerifyScreenshot();
}
}
}

0 comments on commit 21ed209

Please sign in to comment.