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 ported UITests from Xamarin.UITests to Appium - 57 #26717

Merged
merged 6 commits into from
Dec 26, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -19,7 +19,12 @@ protected override void Init()

picker.SelectedIndexChanged += (sender, args) =>
{
label.Text = "Selected";
//Android and Windows crashes when adding a View to a Layout that is already in another Layout
//For more information : https://github.com/dotnet/maui/issues/15920
var label = new Label
{
Text = "Selected"
};
Content = label;
};

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.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using NUnit.Framework;
#if TEST_FAILS_ON_WINDOWS //Background Color updates on Slider Track
//For more information : https://github.com/dotnet/maui/issues/25921
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -15,12 +17,11 @@ public Bugzilla29128(TestDevice testDevice) : base(testDevice)
[Test]
[Category(UITestCategories.LifeCycle)]
[Category(UITestCategories.Compatibility)]
[FailsOnIOSWhenRunningOnXamarinUITest]
[FailsOnMacWhenRunningOnXamarinUITest]
public void Bugzilla29128Test()
{
App.WaitForElement("SliderId");
App.Screenshot("Slider and button should be centered");
VerifyScreenshot();
}
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS && TEST_FAILS_ON_WINDOWS
using NUnit.Framework;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -21,17 +20,12 @@ public void Issue33612RemovePagesWithoutRenderers()
App.Tap("Go To Page 2");

App.WaitForElement("This is Page 2");
App.Screenshot("At Page 2");
App.Tap("Go To Page 3");

App.WaitForElement("This is Page 3");
App.WaitForElement("Return To Page 2",
timeout: TimeSpan.FromSeconds(15));
App.Screenshot("At Page 3");
App.WaitForElement("Return To Page 2");
App.Tap("Return To Page 2");

App.WaitForElement("If you are seeing this, nothing crashed.");
App.Screenshot("Success Page");
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#if IOS
#if TEST_FAILS_ON_WINDOWS
// While using this GroupShortNameBinding property it throws an exception on Windows
// for more information:https://github.com/dotnet/maui/issues/26534.
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
Expand All @@ -16,12 +18,10 @@ public Bugzilla36802(TestDevice testDevice) : base(testDevice)
[Test]
[Category(UITestCategories.ListView)]
[Category(UITestCategories.Compatibility)]
[FailsOnIOSWhenRunningOnXamarinUITest]
[FailsOnMacWhenRunningOnXamarinUITest]
public void Bugzilla36802Test()
{
App.WaitForElement("TestReady");
App.Screenshot("AccessoryView partially hidden test");
VerifyScreenshot();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS && TEST_FAILS_ON_WINDOWS
using NUnit.Framework;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -17,7 +16,6 @@ public Bugzilla37462(TestDevice testDevice) : base(testDevice)
[Category(UITestCategories.Navigation)]
public void CanRemoveIntermediatePagesAndPopToFirstPage()
{
// Start at page 1
App.WaitForElement("Go To 2");
App.WaitForElement("This is a label on page 1");
App.Tap("Go To 2");
Expand All @@ -31,10 +29,7 @@ public void CanRemoveIntermediatePagesAndPopToFirstPage()
App.WaitForElement("Back to 1");
App.Tap("Back to 1");

// Clicking "Back to 1" should remove pages 2 and 3 from the stack
// Then call PopAsync, which should return to page 1
App.WaitForElement("Go To 2");
App.WaitForElement("This is a label on page 1");
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#if TEST_FAILS_ON_WINDOWS
#if TEST_FAILS_ON_WINDOWS
//After Button Click removes all Items in TableView
//For more information: https://github.com/dotnet/maui/issues/26699
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
Expand All @@ -13,9 +15,7 @@ public Bugzilla38112(TestDevice testDevice) : base(testDevice)
}

public override string Issue => "Switch becomes reenabled when previous ViewCell is removed from TableView";

[Test]
[FailsOnIOSWhenRunningOnXamarinUITest]
public void Bugzilla38112_SwitchIsStillOnScreen()
{
App.WaitForElement("Click");
Expand All @@ -24,16 +24,13 @@ public void Bugzilla38112_SwitchIsStillOnScreen()
}

[Test]
[FailsOnAllPlatformsWhenRunningOnXamarinUITest]
public void Bugzilla38112_SwitchIsStillDisabled()
{
App.WaitForElement("Click");
App.Tap("Click");
App.WaitForElement("switch3");
App.Tap("switch3");
App.WaitForNoElement("FAIL");
Assert.That(App.FindElement("resultlabel").GetText()?.Equals("FAIL",
StringComparison.OrdinalIgnoreCase), Is.False);
}
}
#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ public Bugzilla38723(TestDevice testDevice) : base(testDevice)
[Test]
[Category(UITestCategories.Picker)]
[Category(UITestCategories.Compatibility)]
[FailsOnAllPlatformsWhenRunningOnXamarinUITest]
public void Bugzilla38723Test()
{
App.WaitForElement("SELECT");
App.Tap("SELECT");
App.WaitForNoElement("Selected");
App.WaitForElement("Selected");
App.WaitForNoElement("SELECT");
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if IOS
#if TEST_FAILS_ON_WINDOWS // Maps Control not supported in Windows
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
Expand All @@ -17,10 +17,7 @@ public Bugzilla39489(TestDevice testDevice) : base(testDevice)
[Category(UITestCategories.Maps)]
[Category(UITestCategories.Performance)]
[Category(UITestCategories.Compatibility)]
[FailsOnAndroidWhenRunningOnXamarinUITest]
[FailsOnIOSWhenRunningOnXamarinUITest]
[FailsOnMacWhenRunningOnXamarinUITest]
public async Task Bugzilla39489Test()
public void Bugzilla39489Test()
{
// Original bug report (https://bugzilla.xamarin.com/show_bug.cgi?id=39489) had a crash (OOM) after 25-30
// page loads. Obviously it's going to depend heavily on the device and amount of available memory, but
Expand All @@ -32,8 +29,7 @@ public async Task Bugzilla39489Test()
App.WaitForElement("NewPage");
App.Tap("NewPage");
App.WaitForElement("NewPage");
await Task.Delay(1000);
App.Back();
App.TapBackArrow();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if IOS
using NUnit.Framework;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -15,14 +14,10 @@ public Bugzilla53834(TestDevice testDevice) : base(testDevice)

[Test]
[Category(UITestCategories.ListView)]
[Category(UITestCategories.Compatibility)]
[FailsOnIOSWhenRunningOnXamarinUITest]
[FailsOnMacWhenRunningOnXamarinUITest]
public void Bugzilla53834Test()
{
App.WaitForElement("TestReady");
App.Screenshot("Incorrect row heights test");
VerifyScreenshot();
}
}
}
#endif
}
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.
Loading