forked from dotnet/maui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Testing] Added UI Test for manual test D9 (dotnet#18762)
* Added UI Test * Updated test * Changes to ensure other tests * Revert changes * Updated test
- Loading branch information
1 parent
a19fbb7
commit 33f5d20
Showing
4 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/Controls/samples/Controls.Sample.UITests/Issues/Issue18754.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?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.Issue18754"> | ||
<ScrollView> | ||
<VerticalStackLayout> | ||
<Label | ||
AutomationId="WaitForStubControl" | ||
Text="1. Attempt to enter any text into the editor below." /> | ||
<Label | ||
Text="2. The test fails if the editor displays the input." /> | ||
<Editor | ||
AutomationId="ReadOnlyEditor" | ||
IsReadOnly="True" | ||
Text="" /> | ||
<Label | ||
Text="3. Attempt to edit the text in the editor below." /> | ||
<Label | ||
Text="4. The test fails if the editor displays the input." /> | ||
<Editor | ||
AutomationId="FilledReadOnlyEditor" | ||
IsReadOnly="True" | ||
Text="Try to edit this." /> | ||
</VerticalStackLayout> | ||
</ScrollView> | ||
</ContentPage> |
15 changes: 15 additions & 0 deletions
15
src/Controls/samples/Controls.Sample.UITests/Issues/Issue18754.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()); | ||
} | ||
} | ||
} |