Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Testing] Added UI Test for manual test E1 #18624

Merged
merged 10 commits into from Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,20 @@
<?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.Issue18623">
<VerticalStackLayout>
<Label
AutomationId="WaitForStubControl"
Text="1. In the Entry control below, input some text. The test passes if the text is not obscured." />
<Entry
AutomationId="NoPasswordEntry"
IsPassword="False"
Placeholder="IsPassword=False" />
<Label
Text="2. In the Entry control below, input some text. The test passes if the text is obscured." />
<Entry
AutomationId="PasswordEntry"
IsPassword="True"
Placeholder="IsPassword=True" />
</VerticalStackLayout>
</ContentPage>
@@ -0,0 +1,15 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;

namespace Maui.Controls.Sample.Issues
{
[XamlCompilation(XamlCompilationOptions.Compile)]
[Issue(IssueTracker.ManualTest, "E1", "Entry IsPassword obscure the text", PlatformAffected.All)]
public partial class Issue18623 : ContentPage
{
public Issue18623()
{
InitializeComponent();
}
}
}
37 changes: 37 additions & 0 deletions src/Controls/tests/UITests/Tests/Issues/Issue18623.cs
@@ -0,0 +1,37 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.AppiumTests.Issues
{
public class Issue18623 : _IssuesUITest
{
public Issue18623(TestDevice device) : base(device)
{
}

public override string Issue => "Entry IsPassword obscure the text";

[Test]
public async Task EntryIsPasswordObscureText()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS },
"Currently fails on iOS; see https://github.com/dotnet/maui/issues/18981");

App.WaitForElement("WaitForStubControl");

// 1. In the Entry control below, input some text. The test passes if the text is not obscured.
App.EnterText("NoPasswordEntry", "Test");

// 2. In the Entry control below, input some text. The test passes if the text is obscured.
App.EnterText("PasswordEntry", "Test");

// Wait to capture the snapshot after enter the text and
// closed the keyboard.
await Task.Delay(1000);

// 3. Verify the result comparing snapshots.
VerifyScreenshot();
}
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.