-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 D3 (#18649)
* Added UI Test * Fix incorrect manual test identifier * More changes
- Loading branch information
1 parent
a7aa020
commit 8e933a7
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
src/Controls/samples/Controls.Sample.UITests/Issues/Issue18645.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,15 @@ | ||
<?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.Issue18645"> | ||
<VerticalStackLayout> | ||
<Label | ||
AutomationId="WaitForStubControl" | ||
Text="1. Input characters in the editor until it won't accept more input." /> | ||
<Label | ||
Text="2. The test fails if the maximum number of characters is more or less than 5 characters." /> | ||
<Editor | ||
AutomationId="IssueEditor" | ||
MaxLength="5" /> | ||
</VerticalStackLayout> | ||
</ContentPage> |
15 changes: 15 additions & 0 deletions
15
src/Controls/samples/Controls.Sample.UITests/Issues/Issue18645.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, "D3", "Editor MaxLength property works as expected", PlatformAffected.All)] | ||
public partial class Issue18645 : ContentPage | ||
{ | ||
public Issue18645() | ||
{ | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.AppiumTests.Issues | ||
{ | ||
public class Issue18645 : _IssuesUITest | ||
{ | ||
public Issue18645(TestDevice device) : base(device) | ||
{ | ||
} | ||
|
||
public override string Issue => "Editor MaxLength property works as expected"; | ||
|
||
[Test] | ||
public void EditorMaxLengthWorks() | ||
{ | ||
App.WaitForElement("WaitForStubControl"); | ||
|
||
// 1. Input characters in the editor until it won't accept more input. | ||
App.EnterText("IssueEditor", "123456789"); | ||
|
||
// 2. The test fails if the maximum number of characters is more | ||
// or less than 5 characters. | ||
var editorText = App.FindElement("IssueEditor").GetText(); | ||
|
||
// MaxLines = 5 | ||
Assert.AreEqual("12345", editorText); | ||
} | ||
} | ||
} |