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] Enabling some UITests from Issues folder in Appium-11 #27255

Merged
merged 13 commits into from
Jan 25, 2025
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public ScrollViewCoreGalleryPage(ScrollOrientation orientation = ScrollOrientati
var btn = new Button { AutomationId = "Scroll100", Text = "Scroll to 100" };
var btn4 = new Button { AutomationId = "Scroll100Anim", Text = "Scroll to 100 no anim" };
var btn1 = new Button { AutomationId = "Start", Text = "Start" };
var btn2 = new Button { AutomationId = "Center", Text = "Center" };
var btn2 = new Button { AutomationId = "CenterPosition", Text = "Center" };
var btn3 = new Button { AutomationId = "End", Text = "End" };
var btn7 = new Button { Text = "Toggle Scroll Bar Visibility", WidthRequest = 120 };
var btn6 = new Button { Text = "MakeVisible", HorizontalOptions = LayoutOptions.Center, BackgroundColor = Colors.Blue };
Expand Down
4 changes: 2 additions & 2 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue5367.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
[Issue(IssueTracker.Github, 5367, "[Bug] Editor with MaxLength", PlatformAffected.Android)]
public class Issue5367 : TestContentPage
{
const string MaxLengthEditor = "MaxLength Editor";
const string ForceBigStringButton = "Force Big String Button";
const string MaxLengthEditor = "MaxLengthEditor";
const string ForceBigStringButton = "StringButton";

protected override void Init()
{
Expand Down
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public Issue10234(TestDevice device) : base(device)

[Test]
[Category(UITestCategories.CarouselView)]
[FailsOnMacWhenRunningOnXamarinUITest("ScrollRight is not implemented on Mac")]
public void ScrollCarouselViewAfterDispose()
{
App.WaitForElement("goToShow");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ public Issue1219(TestDevice testDevice) : base(testDevice)
[Test]
[Category(UITestCategories.ListView)]
[Category(UITestCategories.Compatibility)]
[FailsOnIOSWhenRunningOnXamarinUITest]
[FailsOnMacWhenRunningOnXamarinUITest]
public void ViewCellInTableViewDoesNotCrash()
{
App.WaitForNoElement(Success);
App.WaitForElement(Success);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
#if WINDOWS
using NUnit.Framework;
using NUnit.Framework.Legacy;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue1937 : _IssuesUITest
{
public Issue1937(TestDevice testDevice) : base(testDevice)
{
}
public class Issue1937 : _IssuesUITest
{
public Issue1937(TestDevice testDevice) : base(testDevice)
{
}

public override string Issue => "[UWP] Choppy animation";
public override string Issue => "[UWP] Choppy animation";

[Test]
[Category(UITestCategories.Animation)]
[Category(UITestCategories.Compatibility)]
[FailsOnWindowsWhenRunningOnXamarinUITest]
public void Issue1937Test()
{
App.WaitForElement("FAST_TIMER");
App.Tap("FAST_TIMER");
App.WaitForNoElement("COMPLETE", timeout: TimeSpan.FromSeconds(2));
var result = App.WaitForElement("RESULT");
int.TryParse(result.GetText(), out int timerTicks1);
[Test]
[Category(UITestCategories.Animation)]
[Category(UITestCategories.Compatibility)]
public void Issue1937Test()
{
jfversluis marked this conversation as resolved.
Show resolved Hide resolved
App.WaitForElement("FAST_TIMER");
App.Tap("FAST_TIMER");
Thread.Sleep(TimeSpan.FromSeconds(1));
App.WaitForElement("COMPLETE");
var result = App.WaitForElement("RESULT");
int.TryParse(result.GetText(), out int timerTicks1);

//If fps > 50 then result must be 50. For small fps we use comparing with 35.
ClassicAssert.IsTrue(timerTicks1 > 35, $"Expected timer ticks are greater than 35. Actual: {timerTicks1}");
//If fps > 50 then result must be 50. For small fps we use comparing with 30.
Assert.That(timerTicks1, Is.GreaterThan(30),
$"Expected timer ticks are greater than 30. Actual: {timerTicks1}");

App.Tap("SLOW_TIMER");
App.WaitForNoElement("COMPLETE", timeout: TimeSpan.FromSeconds(2));
result = App.WaitForElement("RESULT");
int.TryParse(result.GetText(), out int timerTicks2);
App.Tap("SLOW_TIMER");
Thread.Sleep(TimeSpan.FromSeconds(1));
App.WaitForElement("COMPLETE");
result = App.WaitForElement("RESULT");
int.TryParse(result.GetText(), out int timerTicks2);

ClassicAssert.IsTrue(timerTicks2 < 11, $"Expected timer ticks are less than 11. Actual: {timerTicks2}");
}
}
Assert.That(timerTicks2, Is.LessThan(11),
$"Expected timer ticks are less than 11. Actual: {timerTicks2}");
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if IOS
#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST // The ViewCell in TableView does not resize on iOS and MacCatalyst.More Information:https://github.com/dotnet/maui/issues/23319
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
Expand All @@ -16,12 +16,11 @@ public Issue2842(TestDevice testDevice) : base(testDevice)
[Test]
[Category(UITestCategories.TabbedPage)]
[Category(UITestCategories.Compatibility)]
[FailsOnIOSWhenRunningOnXamarinUITest]
public void Issue2842Test()
{
App.WaitForElement("btnClick");
App.Tap("btnClick");
App.Screenshot("Verify that the text is not on top of the image");
VerifyScreenshot();
}
jsuarezruiz marked this conversation as resolved.
Show resolved Hide resolved
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ public Issue3275(TestDevice testDevice) : base(testDevice)

[Test]
[Category(UITestCategories.ListView)]
[Category(UITestCategories.Compatibility)]
[FailsOnAllPlatformsWhenRunningOnXamarinUITest]
[Category(UITestCategories.Compatibility)]
public void Issue3275Test()
{
App.WaitForElement(BtnLeakId);
App.Tap(BtnLeakId);
App.WaitForElement(BtnScrollToId);
App.Tap(BtnScrollToId);
App.Back();
App.TapBackArrow();
App.WaitForElement(BtnLeakId);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue5367 : _IssuesUITest
{
const string MaxLengthEditor = "MaxLength Editor";
const string ForceBigStringButton = "Force Big String Button";
const string MaxLengthEditor = "MaxLengthEditor";
const string ForceBigStringButton = "StringButton";

public Issue5367(TestDevice testDevice) : base(testDevice)
{
Expand All @@ -18,13 +18,13 @@ public Issue5367(TestDevice testDevice) : base(testDevice)
[Test]
[Category(UITestCategories.Editor)]
[Category(UITestCategories.Compatibility)]
[FailsOnAndroidWhenRunningOnXamarinUITest]
[FailsOnIOSWhenRunningOnXamarinUITest]
[FailsOnMacWhenRunningOnXamarinUITest]
public void Issue5367Test()
{
App.WaitForElement(MaxLengthEditor);
App.Tap(ForceBigStringButton);
var text = App.WaitForElement(MaxLengthEditor).GetText() ?? string.Empty;
int count = text.Count();
Assert.That(count, Is.EqualTo(14));
}
}
}
Loading
Loading