-
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.
Fixed the double tap editor freeze issue and added test cases (#26203)
* Fixed the double tap editor freeze issue and added test cases * Remove the platform specific code * Modified the test cases * Modified the test cases * Modified the test cases * Modified the assert at last * Modified the test cases * Modified the test cases --------- Co-authored-by: Shalini-Ashokan <102292178+Shalini-Ashokan@users.noreply.github.com>
- Loading branch information
1 parent
66982c3
commit e72f6ad
Showing
3 changed files
with
66 additions
and
3 deletions.
There are no files selected for viewing
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,32 @@ | ||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[Issue(IssueTracker.Github, 25975, "Double tapping Editor control locks app", PlatformAffected.All)] | ||
public class Issue25975 : TestContentPage | ||
{ | ||
protected override void Init() | ||
{ | ||
var editor = new Editor() | ||
{ | ||
Text = "MAUI", | ||
AutomationId = "DoubleTapEditor", | ||
FontSize = 24, | ||
MaxLength = 5, | ||
HorizontalTextAlignment = TextAlignment.Center, | ||
VerticalOptions = LayoutOptions.Center, | ||
HorizontalOptions = LayoutOptions.Fill, | ||
AutoSize = EditorAutoSizeOption.TextChanges, | ||
}; | ||
|
||
var stackLayout = new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
editor | ||
} | ||
}; | ||
|
||
Content = stackLayout; | ||
|
||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25975.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,31 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues | ||
{ | ||
public class Issue25975 : _IssuesUITest | ||
{ | ||
public Issue25975(TestDevice device) | ||
: base(device) | ||
{ } | ||
|
||
public override string Issue => "Double tapping Editor control locks app"; | ||
|
||
[Test] | ||
[Category(UITestCategories.Editor)] | ||
public void PerformDoubleTapActionOnEditor() | ||
{ | ||
App.WaitForElement("DoubleTapEditor"); | ||
App.DoubleTap("DoubleTapEditor"); | ||
App.EnterText("DoubleTapEditor", "Hello"); | ||
|
||
App.DoubleTap("DoubleTapEditor"); | ||
App.ClearText("DoubleTapEditor"); | ||
App.EnterText("DoubleTapEditor", "World"); | ||
|
||
var editorText = App.FindElement("DoubleTapEditor").GetText(); | ||
Assert.That(editorText, Is.EqualTo("World")); | ||
} | ||
} | ||
} |
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