Skip to content

Commit

Permalink
[Testing] Added UI Test for manual test D12 (#18677)
Browse files Browse the repository at this point in the history
* Added UI Test

* Added snapshots

* Updated snapshot
  • Loading branch information
jsuarezruiz committed Nov 16, 2023
1 parent 59fa062 commit 417acea
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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.Issue18675">
<ScrollView>
<VerticalStackLayout>
<Label
AutomationId="WaitForStubControl"
Text="1. The test fails if the placeholder text in the editor below is missing." />
<Editor
AutomationId="IsReadOnlyEditor"
IsReadOnly="True"
Placeholder="testing" />
<Label
Text="2. The test fails if the placeholder text in the editor below is not blue." />
<Editor
IsReadOnly="True"
Placeholder="testing"
PlaceholderColor="Blue" />
</VerticalStackLayout>
</ScrollView>
</ContentPage>
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, "D12", "Editor IsReadOnly property prevent from modifying the text", PlatformAffected.All)]
public partial class Issue18675 : ContentPage
{
public Issue18675()
{
InitializeComponent();
}
}
}
27 changes: 27 additions & 0 deletions src/Controls/tests/UITests/Tests/Issues/Issue18675.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

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

public override string Issue => "Editor IsReadOnly property prevent from modifying the text";

[Test]
public void EditorIsReadOnlyPreventModify()
{
App.WaitForElement("WaitForStubControl");

// 1.The test fails if the placeholder text in the editor below is missing.
App.Click("IsReadOnlyEditor");

// 2. The test fails if the placeholder text in the editor below is not blue.
VerifyScreenshot();
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 417acea

Please sign in to comment.