Skip to content

Commit

Permalink
[Testing] Remove IgnoreIfPlatforms usage on UITests (#22526)
Browse files Browse the repository at this point in the history
* Remove IgnoreIfPlatforms usage on UITests

* Changes in failing test

* Re-enabled tests in some platforms

* Moved comment

* Changes based on PR feedback

* Fixed test errors

* Fix build errors

* Ignore golden tests on macOS for now

* Updated test
  • Loading branch information
jsuarezruiz authored Jun 7, 2024
1 parent d8d9488 commit 5451aaf
Show file tree
Hide file tree
Showing 58 changed files with 226 additions and 258 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ public CollectionViewBoundMultiSelectionUITests(TestDevice device)
// ItemsFromViewModelShouldBeSelected (src\Compatibility\ControlGallery\src\Issues.Shared\CollectionViewBoundMultiSelection.cs)
[Test]
[Category(UITestCategories.CollectionView)]
[Ignore("Click does not find CollectionView elements.")]
[FailsOnAllPlatforms("Click does not find CollectionView elements.")]
public void ItemsFromViewModelShouldBeSelected()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.iOS, TestDevice.Mac, TestDevice.Windows },
"Click does not find CollectionView elements.");

// Navigate to the selection galleries
VisitInitialGallery("Selection");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ public CollectionViewSingleBoundSelectionUITests(TestDevice device)
/*
// SelectionShouldUpdateBinding (src\Compatibility\ControlGallery\src\Issues.Shared\CollectionViewBoundSingleSelection.cs)
[Test]
[Ignore("Click does not find CollectionView elements")]
[FailsOnAllPlatforms("Click does not find CollectionView elements")]
[Description("Single Selection Binding")]
public void SelectionShouldUpdateBinding()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.iOS, TestDevice.Mac, TestDevice.Windows },
"Click does not find CollectionView elements");
// Navigate to the selection galleries
VisitInitialGallery("Selection");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ public VisitAndUpdateItemsSourceUITests(TestDevice device)
[TestCase("DataTemplate", "VerticalGridCode", 19, 6)]
[TestCase("DataTemplate", "HorizontalGridCode", 19, 6)]
[Category(UITestCategories.CollectionView)]
[FailsOnWindows("This test is failing, likely due to product issue.")]
public void VisitAndUpdateItemsSource(string collectionTestName, string subGallery, int firstItem, int lastItem)
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Windows },
"This test is failing, likely due to product issue.");

try
{
VisitInitialGallery(collectionTestName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ protected override void FixtureSetup()

[Test]
[Category(UITestCategories.Gestures)]
[FailsOnAndroid("PointerGestureRecognizer doesn't work with mouse in Android")]
[FailsOnIOS("PointerGestureRecognizer doesn't work with mouse in iOS")]
public void PointerGestureTest()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.iOS },
"PointerGestureRecognizer doesn't work with mouse in Android or iOS");

App.WaitForElement("TargetView");
App.EnterText("TargetView", "PointerGestureRecognizerEvents");
App.Tap("GoButton");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
#if ANDROID
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -19,11 +20,9 @@ public CarouselViewAdjustPeekAreaInsets(TestDevice device)
[Category(UITestCategories.CarouselView)]
public void ChangePeekAreaInsetsInOnSizeAllocatedTest()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS, TestDevice.Mac, TestDevice.Windows },
"Android specific Test");
App.WaitForElement("CarouselId");
}
*/
}
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,23 @@ namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class CarouselViewLoopNoFreeze : _IssuesUITest
{
readonly string _carouselAutomationId = "carouselView";
readonly string _btnRemoveAutomationId = "btnRemove";
readonly string _btnRemoveAllAutomationId = "btnRemoveAll";

public CarouselViewLoopNoFreeze(TestDevice device)
: base(device)
{
}

public override string Issue => "CarouselView Loop=True default freezes iOS app";

/*
readonly string _carouselAutomationId = "carouselView";
readonly string _btnRemoveAutomationId = "btnRemove";
readonly string _btnRemoveAllAutomationId = "btnRemoveAll";
// Issue12574 (src\ControlGallery\src\Issues.Shared\Issue12574.cs
[Test]
[Category(UITestCategories.CarouselView)]
[Ignore("Currently fails")]
[FailsOnAllPlatforms("Currently fails; see https://github.com/dotnet/maui/issues/19488")]
public void Issue12574Test()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS },
"Currently fails on iOS; see https://github.com/dotnet/maui/issues/19488");
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.Mac, TestDevice.Windows },
"iOS specific Test");
App.WaitForNoElement("0 item");

var rect = App.FindElement(_carouselAutomationId).GetRect();
Expand All @@ -55,21 +48,14 @@ public void Issue12574Test()

[Test]
[Category(UITestCategories.CarouselView)]
[Ignore("Currently fails")]
[FailsOnAllPlatforms("Currently fails; see https://github.com/dotnet/maui/issues/19488")]
public void RemoveItemsQuickly()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS },
"Currently fails on iOS; see https://github.com/dotnet/maui/issues/19488");
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.Mac, TestDevice.Windows },
"iOS specific Test");
App.WaitForNoElement("0 item");
App.Click(_btnRemoveAllAutomationId);

// If we haven't crashed, then the other button should be here
App.WaitForElement(_btnRemoveAutomationId);
}
*/
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ public CarouselViewNoItemTemplate(TestDevice device)
// Issue12777 (src\ControlGallery\src\Issues.Shared\Issue12777.cs
[Test]
[Category(UITestCategories.CarouselView)]
[FailsOnWindows("This test is failing, likely due to product issue")]
public void Issue12777Test()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Windows });

App.WaitForElement("TestCarouselView");
App.Screenshot("Test passed");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
#if ANDROID
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;
Expand All @@ -19,9 +20,6 @@ public CarouselViewPositionVisibility(TestDevice device)
[Category(UITestCategories.CarouselView)]
public void Issue12848Test()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS, TestDevice.Mac, TestDevice.Windows },
"Android specific Test");

App.WaitForElement("TestCarouselView");
App.SwipeRightToLeft("TestCarouselView");
var position1 = App.FindElement("CarouselPosition").GetText();
Expand All @@ -36,3 +34,4 @@ public void Issue12848Test()
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
#if IOS
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -16,20 +17,15 @@ public CarouselViewRemoveAt(TestDevice device)
// Issue10300 (src\ControlGallery\src\Issues.Shared\Issue10300.cs
[Test]
[Category(UITestCategories.CarouselView)]
[Ignore("Currently fails")]
[FailsOnIOS("Currently fails on iOS; see https://github.com/dotnet/maui/issues/19488")]
public void Issue10300Test()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS },
"Currently fails on iOS; see https://github.com/dotnet/maui/issues/19488");

this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.Mac, TestDevice.Windows },
"iOS specific Test");

App.Click("Add");
App.Click("Delete");
App.WaitForElement("Close");
App.Click("Close");
App.WaitForNoElement("2");
}
}
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ public CarouselViewSetOrientation(TestDevice device)
// Issue12193 (src\ControlGallery\src\Issues.Shared\Issue12193.cs
[Test]
[Category(UITestCategories.CarouselView)]
[FailsOnMac("Set Orientation methods not implemented")]
[FailsOnWindows("Set Orientation methods not implemented")]
public async Task RotatingCarouselViewHTMLShouldNotDisappear()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Mac, TestDevice.Windows });

int delay = 3000;

App.SetOrientationPortrait();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.Maui.TestCases.Tests;
#if ANDROID
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
Expand All @@ -19,13 +19,11 @@ public CarouselViewUpdateCurrentItem(TestDevice device)
[Category(UITestCategories.CarouselView)]
public void Issue9827Test()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS, TestDevice.Mac, TestDevice.Windows },
"Android specific Test");

App.WaitForNoElement("Pos:0");
App.Click("btnNext");
App.WaitForNoElement("Item 1 with some additional text");
App.WaitForNoElement("Pos:1");
}
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
#if ANDROID
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -18,13 +19,11 @@ public CarouselViewUpdatePosition(TestDevice device)
[Category(UITestCategories.CarouselView)]
public void CarouselViewPositionFromVisibilityChangeTest()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS, TestDevice.Mac, TestDevice.Windows },
"Android specific Test");

App.WaitForElement("AppearButton");
App.Click("AppearButton");
App.WaitForNoElement("Item 4");
App.Screenshot("Success");
}
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if ANDROID
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
Expand All @@ -22,12 +23,11 @@ public ClearGroupedNoCrashUITests(TestDevice device)
[Category(UITestCategories.CollectionView)]
public void ClearingGroupedNoCrash()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS, TestDevice.Mac, TestDevice.Windows });

App.WaitForElement(Go);
App.Click(Go);

App.WaitForNoElement(Success);
}
}
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ public CollectionViewBindingErrorsUITests(TestDevice device)
// CollectionViewBindingErrorsShouldBeZero (src\Compatibility\ControlGallery\src\Issues.Shared\CollectionViewBindingErrors.xaml.cs)
[Test]
[Category(UITestCategories.CollectionView)]
[FailsOnMac("This test is failing, likely due to product issue")]
[FailsOnWindows("This test is failing, likely due to product issue")]
public void NoBindingErrors()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Mac, TestDevice.Windows });

App.WaitForElement("WaitForStubControl");
App.WaitForNoElement("Binding Errors: 0");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ public void KeepItemsInView()
// KeepScrollOffset (src\Compatibility\ControlGallery\src\Issues.Shared\CollectionViewItemsUpdatingScrollMode.cs)
[Test]
[Category(UITestCategories.CollectionView)]
[FailsOnAllPlatforms("This test is failing, likely due to product issue")]
public void KeepScrollOffset()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.iOS, TestDevice.Mac, TestDevice.Windows });

App.WaitForElement("SelectScrollMode");
App.Click("SelectScrollMode");
App.Click("KeepScrollOffset");
Expand All @@ -64,10 +63,9 @@ public void KeepScrollOffset()
// KeepLastItemInView(src\Compatibility\ControlGallery\src\Issues.Shared\CollectionViewItemsUpdatingScrollMode.cs)
[Test]
[Category(UITestCategories.CollectionView)]
[FailsOnAllPlatforms("This test is failing, likely due to product issue")]
public void KeepLastItemInView()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.iOS, TestDevice.Mac, TestDevice.Windows });

App.WaitForElement("SelectScrollMode");
App.Click("SelectScrollMode");
App.Click("KeepLastItemInView");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ public CollectionViewTabbedPageUITests(TestDevice device)
// AddingGroupToUnviewedGroupedCollectionViewShouldNotCrash (src\Compatibility\ControlGallery\src\Issues.Shared\Issue7700.cs)
[Test]
[Ignore("Click does not find Tab elements")]
[FailsOnAllPlatforms("Click does not find Tab elements")]
[Category(UITestCategories.CollectionView)]
public void AddingItemToUnviewedCollectionViewShouldNotCrash()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.iOS, TestDevice.Mac, TestDevice.Windows },
"Click does not find Tab elements");
App.WaitForElement(Add1);
App.Click(Add1);
App.Click(Tab2);
Expand All @@ -38,13 +35,10 @@ public void AddingItemToUnviewedCollectionViewShouldNotCrash()
// AddingGroupToUnviewedGroupedCollectionViewShouldNotCrash (src\Compatibility\ControlGallery\src\Issues.Shared\Issue7700.cs)
[Test]
[Ignore("Click does not find Tab elements")]
[FailsOnAllPlatforms("Click does not find Tab elements")]
[Category(UITestCategories.CollectionView)]
public void AddingGroupToUnviewedGroupedCollectionViewShouldNotCrash()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.iOS, TestDevice.Mac, TestDevice.Windows },
"Click does not find Tab elements");
App.WaitForElement(Add2);
App.Click(Add2);
App.Click(Tab3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ public CollectionViewDynamicallyLoadUITests(TestDevice device)
// CollectionViewShouldSourceShouldUpdateWhileInvisible (src\Compatibility\ControlGallery\src\Issues.Shared\Issue13126.cs)
[Test]
[Category(UITestCategories.CollectionView)]
[FailsOnWindows("This test is failing, likely due to product issue")]
public void DynamicallyLoadCollectionView()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Windows });

App.WaitForNoElement(Success);
}
}
Expand Down
Loading

0 comments on commit 5451aaf

Please sign in to comment.