diff --git a/src/Controls/samples/Controls.Sample.UITests/Issues/Issue18754.xaml b/src/Controls/samples/Controls.Sample.UITests/Issues/Issue18754.xaml new file mode 100644 index 000000000000..5c5fd3a5a11c --- /dev/null +++ b/src/Controls/samples/Controls.Sample.UITests/Issues/Issue18754.xaml @@ -0,0 +1,26 @@ + + + + + + + \ No newline at end of file diff --git a/src/Controls/samples/Controls.Sample.UITests/Issues/Issue18754.xaml.cs b/src/Controls/samples/Controls.Sample.UITests/Issues/Issue18754.xaml.cs new file mode 100644 index 000000000000..ae80a77df935 --- /dev/null +++ b/src/Controls/samples/Controls.Sample.UITests/Issues/Issue18754.xaml.cs @@ -0,0 +1,15 @@ +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.Xaml; + +namespace Maui.Controls.Sample.Issues +{ + [XamlCompilation(XamlCompilationOptions.Compile)] + [Issue(IssueTracker.ManualTest, "D9", "[D9] Editor IsReadOnly works", PlatformAffected.All)] + public partial class Issue18754 : ContentPage + { + public Issue18754() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/UITests/Tests/Issues/Issue18675.cs b/src/Controls/tests/UITests/Tests/Issues/Issue18675.cs index 147becaa240c..e29b31af3cfd 100644 --- a/src/Controls/tests/UITests/Tests/Issues/Issue18675.cs +++ b/src/Controls/tests/UITests/Tests/Issues/Issue18675.cs @@ -13,13 +13,17 @@ public Issue186751(TestDevice device) : base(device) public override string Issue => "Editor IsReadOnly property prevent from modifying the text"; [Test] - public void EditorIsReadOnlyPreventModify() + public async Task EditorIsReadOnlyPreventModify() { App.WaitForElement("WaitForStubControl"); // 1.The test fails if the placeholder text in the editor below is missing. App.Click("IsReadOnlyEditor"); + // Delay for the Editor underline on Android to return from + // the selected state to normal state. + await Task.Delay(500); + // 2. The test fails if the placeholder text in the editor below is not blue. VerifyScreenshot(); } diff --git a/src/Controls/tests/UITests/Tests/Issues/Issue18754.cs b/src/Controls/tests/UITests/Tests/Issues/Issue18754.cs new file mode 100644 index 000000000000..00048271c337 --- /dev/null +++ b/src/Controls/tests/UITests/Tests/Issues/Issue18754.cs @@ -0,0 +1,34 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.AppiumTests.Issues +{ + public class Issue18754 : _IssuesUITest + { + public Issue18754(TestDevice device) : base(device) { } + + public override string Issue => "[D9] Editor IsReadOnly works"; + + [Test] + public void Issue18754Test() + { + this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Mac, TestDevice.Windows }, + "Currently IsKeyboardShown is not implemented."); + + App.WaitForElement("WaitForStubControl"); + + // 1. Attempt to enter any text into the editor below. + App.Click("ReadOnlyEditor"); + + // 2. The test fails if the editor displays the input. + Assert.IsFalse(App.IsKeyboardShown()); + + // 3. Attempt to edit the text in the editor below. + App.Click("FilledReadOnlyEditor"); + + // 4. The test fails if the editor displays the input. + Assert.IsFalse(App.IsKeyboardShown()); + } + } +}