-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 D4 (#18650)
* Added UI Test * Updated test
- Loading branch information
1 parent
8d029d4
commit 2fb3603
Showing
3 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
src/Controls/samples/Controls.Sample.UITests/Issues/Issue18647.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,44 @@ | ||
<?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.Issue18647"> | ||
<VerticalStackLayout> | ||
<Label | ||
AutomationId="WaitForStubControl" | ||
Text="1. Input the string 'aBcDeFg' into the editor below." /> | ||
<Label | ||
Text="2. The test fails if the editor below does not display the string 'aBcDeFg' exactly (case-sensitive)." /> | ||
<Editor | ||
AutomationId="NoneTextTransformEditor" | ||
Text="" | ||
TextTransform="None" /> | ||
<Label | ||
Text="3. Input the string 'aBcDeFg' into the editor below." /> | ||
<Label | ||
Text="4. The test fails if the editor below does not display the string 'abcdefg' exactly (case-sensitive)." /> | ||
<Editor | ||
AutomationId="LowercaseTextTransformEditor" | ||
Text="" | ||
TextTransform="Lowercase" /> | ||
<Label | ||
Text="5. Input the string 'aBcDeFg' into the editor below." /> | ||
<Label | ||
Text="6. The test fails if the editor below does not display the string 'ABCDEFG' exactly (case-sensitive)." /> | ||
<Editor | ||
AutomationId="UppercaseTextTransformEditor" | ||
Text="" | ||
TextTransform="Uppercase" /> | ||
<Label | ||
Text="7. The test fails if the editor below does not display the string 'abcdefg' exactly (case-sensitive)." /> | ||
<Editor | ||
AutomationId="FilledLowercaseTextTransformEditor" | ||
Text="aBcDeFg" | ||
TextTransform="Lowercase" /> | ||
<Label | ||
Text="8. The test fails if the editor below does not display the string 'ABCDEFG' exactly (case-sensitive)." /> | ||
<Editor | ||
AutomationId="FilledUppercaseTextTransformEditor" | ||
Text="aBcDeFg" | ||
TextTransform="Uppercase" /> | ||
</VerticalStackLayout> | ||
</ContentPage> |
15 changes: 15 additions & 0 deletions
15
src/Controls/samples/Controls.Sample.UITests/Issues/Issue18647.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, "D4", "Editor TextTransform property works as expected", PlatformAffected.All)] | ||
public partial class Issue18647 : ContentPage | ||
{ | ||
public Issue18647() | ||
{ | ||
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,52 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.AppiumTests.Issues | ||
{ | ||
public class Issue18647 : _IssuesUITest | ||
{ | ||
|
||
public Issue18647(TestDevice device) : base(device) | ||
{ | ||
} | ||
|
||
public override string Issue => "Editor TextTransform property works as expected"; | ||
|
||
[Test] | ||
public void EditorTextTransformWorks() | ||
{ | ||
App.WaitForElement("WaitForStubControl"); | ||
|
||
// 1. Input the string 'aBcDeFg' into the editor below. | ||
App.EnterText("NoneTextTransformEditor", "aBcDeFg"); | ||
|
||
// 2. The test fails if the editor below does not display the string 'aBcDeFg' exactly (case-sensitive). | ||
var result2 = App.FindElement("NoneTextTransformEditor").GetText()?.Trim(); | ||
Assert.AreEqual("aBcDeFg", result2); | ||
|
||
// 3. Input the string 'aBcDeFg' into the editor below. | ||
App.EnterText("LowercaseTextTransformEditor", "aBcDeFg"); | ||
|
||
// 4. The test fails if the editor below does not display the string 'abcdefg' exactly (case-sensitive). | ||
var result4 = App.FindElement("LowercaseTextTransformEditor").GetText()?.Trim(); | ||
Assert.AreEqual("abcdefg", result4); | ||
|
||
// 5. Input the string 'aBcDeFg' into the editor below. | ||
App.EnterText("UppercaseTextTransformEditor", "aBcDeFg"); | ||
|
||
// 6. The test fails if the editor below does not display the string 'ABCDEFG' exactly (case-sensitive). | ||
var result6 = App.FindElement("UppercaseTextTransformEditor").GetText()?.Trim(); | ||
Assert.AreEqual("ABCDEFG", result6); | ||
|
||
// 7. The test fails if the editor below does not display the string 'abcdefg' exactly (case-sensitive). | ||
var result7 = App.FindElement("FilledLowercaseTextTransformEditor").GetText()?.Trim(); | ||
Assert.AreEqual("abcdefg", result7); | ||
|
||
// 8. The test fails if the editor below does not display the string 'ABCDEFG' exactly (case-sensitive). | ||
var result8 = App.FindElement("FilledUppercaseTextTransformEditor").GetText()?.Trim(); | ||
|
||
Assert.AreEqual("ABCDEFG", result8); | ||
} | ||
} | ||
} |