-
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.
Browse files
Browse the repository at this point in the history
* Migrated the Issue12685, Issue2809 and Issue2894 * Updated the migrated issues * Updated migrated code changes * resolved random test failures --------- Co-authored-by: nivetha-nagalingam <nivetha.nagalingam@syncfusion.com>
- Loading branch information
1 parent
37a2d9d
commit 6cd3d86
Showing
5 changed files
with
98 additions
and
92 deletions.
There are no files selected for viewing
12 changes: 6 additions & 6 deletions
12
src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue2809.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
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
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
105 changes: 50 additions & 55 deletions
105
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2894.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 |
---|---|---|
@@ -1,73 +1,68 @@ | ||
using NUnit.Framework; | ||
using System.Drawing; | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
||
public class Issue2894 : _IssuesUITest | ||
{ | ||
const string kGesture1 = "Sentence 1: "; | ||
const string kGesture2 = "Sentence 2: "; | ||
const string kLabelAutomationId = "kLabelAutomationId"; | ||
|
||
public Issue2894(TestDevice testDevice) : base(testDevice) | ||
{ | ||
} | ||
|
||
public override string Issue => "Gesture Recognizers added to Span after it's been set to FormattedText don't work and can cause an NRE"; | ||
|
||
// [FailsOnAndroid] | ||
// [FailsOnIOS] | ||
// [Test] | ||
// [Category(UITestCategories.Gestures)] | ||
// public void VariousSpanGesturePermutation() | ||
// { | ||
// App.WaitForElement($"{kGesture1}0"); | ||
// App.WaitForElement($"{kGesture2}0"); | ||
// var labelId = App.WaitForElement(kLabelAutomationId); | ||
// var target = labelId.First().Rect; | ||
|
||
|
||
// for (int i = 1; i < 5; i++) | ||
// { | ||
// App.Tap($"TestSpan{i}"); | ||
|
||
// // These tap retries work around a Tap Coordinate bug | ||
// // with Xamarin.UITest >= 3.0.7 | ||
// int tapAttempts = 0; | ||
// do | ||
// { | ||
// App.TapCoordinates(target.X + 5, target.Y + 5); | ||
// if (tapAttempts == 4) | ||
// App.WaitForElement($"{kGesture1}{i}"); | ||
|
||
// tapAttempts++; | ||
// } while (App.Query($"{kGesture1}{i}").Length == 0); | ||
|
||
// tapAttempts = 0; | ||
|
||
// do | ||
// { | ||
// #if WINDOWS | ||
// App.TapCoordinates(target.X + target.Width - 10, target.Y + 2); | ||
// #else | ||
// App.TapCoordinates(target.X + target.CenterX, target.Y + 2); | ||
// #endif | ||
// if (tapAttempts == 4) | ||
// App.WaitForElement($"{kGesture1}{i}"); | ||
|
||
// tapAttempts++; | ||
|
||
// } while (App.Query($"{kGesture2}{i}").Length == 0); | ||
// } | ||
[Test] | ||
[Category(UITestCategories.Gestures)] | ||
public void VariousSpanGesturePermutation() | ||
{ | ||
App.WaitForElement($"{kGesture1}0"); | ||
App.WaitForElement($"{kGesture2}0"); | ||
var labelId = App.WaitForElement(kLabelAutomationId); | ||
var target = labelId.GetRect(); | ||
|
||
for (int i = 1; i < 5; i++) | ||
{ | ||
App.Tap($"TestSpan{i}"); | ||
App.WaitForElement($"{kGesture1}{i-1}"); | ||
App.WaitForElement(kLabelAutomationId); | ||
PerformGestureActionForFirstSpan(target); | ||
PerformGestureActionForSecondSpan(target); | ||
} | ||
|
||
App.Tap($"TestSpan5"); | ||
PerformGestureActionForFirstSpan(target); | ||
PerformGestureActionForSecondSpan(target); | ||
App.WaitForElement($"{kGesture1}4"); | ||
App.WaitForElement($"{kGesture2}4"); | ||
} | ||
|
||
void PerformGestureAction(float x, float y) | ||
{ | ||
#if MACCATALYST // TapCoordinates is not working on MacCatalyst Issue: https://github.com/dotnet/maui/issues/19754 | ||
App.ClickCoordinates(x, y); | ||
#else | ||
App.TapCoordinates(x, y); | ||
#endif | ||
} | ||
|
||
// App.Tap($"TestSpan5"); | ||
// App.TapCoordinates(target.X + 5, target.Y + 5); | ||
void PerformGestureActionForFirstSpan(Rectangle target) | ||
{ | ||
PerformGestureAction(target.X + 5, target.Y + 5); | ||
} | ||
|
||
// #if WINDOWS | ||
// App.TapCoordinates(target.X + target.Width - 10, target.Y + 2); | ||
// #else | ||
// App.TapCoordinates(target.X + target.CenterX, target.Y + 2); | ||
// #endif | ||
void PerformGestureActionForSecondSpan(Rectangle target) | ||
{ | ||
#if ANDROID // Calculate points vary on Android and other platforms. | ||
App.TapCoordinates(target.X + target.Width /2, target.Y + 2); | ||
#else | ||
PerformGestureAction(target.X + target.Width - 10, target.Y + 2); | ||
#endif | ||
|
||
// App.WaitForElement($"{kGesture1}4"); | ||
// App.WaitForElement($"{kGesture2}4"); | ||
// } | ||
} | ||
} |
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