From d759a7287455ffac9b559d0c3d0e7c5ed3c771be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Mon, 20 May 2024 13:14:41 +0200 Subject: [PATCH 1/9] Remove IgnoreIfPlatforms usage on UITests --- .../IUITestContextExtensions.cs | 29 ----- ...ctionViewUITests.MultipleBoundSelection.cs | 3 - ...lectionViewUITests.SingleBoundSelection.cs | 3 - ...onViewUITests.VisitAndUpdateItemsSource.cs | 4 +- .../Tests/GestureRecognizerUITests.cs | 5 +- ...arouselViewUITests.AdjustPeekAreaInsets.cs | 9 +- .../CarouselViewUITests.LoopNoFreeze.cs | 16 +-- .../CarouselViewUITests.NoItemTemplate.cs | 3 +- .../CarouselViewUITests.PositionVisibility.cs | 7 +- .../Issues/CarouselViewUITests.RemoveAt.cs | 14 +-- .../CarouselViewUITests.SetOrientation.cs | 4 +- .../CarouselViewUITests.UpdateCurrentItem.cs | 8 +- .../CarouselViewUITests.UpdatePosition.cs | 9 +- ...llectionViewUITests.ClearGroupedNoCrash.cs | 6 +- ...ViewUITests.CollectionViewBindingErrors.cs | 4 +- ...s.CollectionViewItemsUpdatingScrollMode.cs | 6 +- ...ionViewUITests.CollectionViewTabbedPage.cs | 6 -- .../CollectionViewUITests.DynamicallyLoad.cs | 3 +- .../CollectionViewUITests.EmptyViewNoCrash.cs | 5 +- .../Issues/HideSoftInputOnTappedPageTests.cs | 18 +--- .../Tests/Issues/Issue16320.cs | 12 +-- .../Tests/Issues/Issue16561.cs | 8 +- .../Tests/Issues/Issue17490.cs | 9 +- .../Tests/Issues/Issue18111.cs | 3 +- .../Tests/Issues/Issue18242.cs | 4 +- .../Tests/Issues/Issue18623.cs | 4 +- .../Tests/Issues/Issue18716.cs | 6 +- .../Tests/Issues/Issue18751.cs | 7 +- .../Tests/Issues/Issue18754.cs | 7 +- .../Tests/Issues/Issue18896.cs | 9 +- .../Tests/Issues/Issue19786.cs | 3 +- .../Tests/Issues/Issue21314.cs | 6 +- .../Tests/Issues/Issue21513.cs | 4 +- .../Tests/Issues/Issue21726.cs | 6 +- .../Tests/Issues/Issue21846.cs | 4 +- .../Tests/Issues/Issue21967.cs | 10 +- .../Tests/Issues/Issue22035.cs | 6 +- .../Tests/Issues/Issue5555.cs | 8 +- .../Issues/ScrollViewUITests.Bugzilla28570.cs | 4 +- .../Issues/ScrollViewUITests.Bugzilla35127.cs | 5 +- .../Issues/ScrollViewUITests.Bugzilla44461.cs | 6 +- ...ollViewUITests.ScrollViewDelayedContent.cs | 4 +- ...rollViewUITests.ScrollViewDisableScroll.cs | 22 +--- .../ScrollViewUITests.ScrollViewIsEnabled.cs | 16 +-- ...ollViewUITests.ScrollViewObjectDisposed.cs | 5 +- .../UITestIgnoreAttributes.cs | 102 ++++++++++++++++++ 46 files changed, 215 insertions(+), 227 deletions(-) delete mode 100644 src/Controls/tests/TestCases.Shared.Tests/IUITestContextExtensions.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/UITestIgnoreAttributes.cs diff --git a/src/Controls/tests/TestCases.Shared.Tests/IUITestContextExtensions.cs b/src/Controls/tests/TestCases.Shared.Tests/IUITestContextExtensions.cs deleted file mode 100644 index 971b14d1bcfe..000000000000 --- a/src/Controls/tests/TestCases.Shared.Tests/IUITestContextExtensions.cs +++ /dev/null @@ -1,29 +0,0 @@ -using NUnit.Framework; -using UITest.Appium.NUnit; -using UITest.Core; - -namespace Microsoft.Maui.TestCases.Tests -{ - public static class IUITestContextExtensions - { - public static void IgnoreIfPlatforms(this UITestBase? context, IEnumerable devices, string? message = null) - { - foreach (var device in devices) - { - context?.IgnoreIfPlatform(device, message); - } - } - - public static void IgnoreIfPlatform(this UITestBase? context, TestDevice device, string? message = null) - { - if (context != null && context.Device == device) - { - if (string.IsNullOrEmpty(message)) - Assert.Ignore(); - else - Assert.Ignore(message); - } - } - } -} - diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.MultipleBoundSelection.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.MultipleBoundSelection.cs index ba673eaa1cc6..d1a843faf660 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.MultipleBoundSelection.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.MultipleBoundSelection.cs @@ -17,9 +17,6 @@ public CollectionViewBoundMultiSelectionUITests(TestDevice device) [Ignore("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"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.SingleBoundSelection.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.SingleBoundSelection.cs index 9840b5d7a20f..4d08f6666406 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.SingleBoundSelection.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.SingleBoundSelection.cs @@ -18,9 +18,6 @@ public CollectionViewSingleBoundSelectionUITests(TestDevice device) [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"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.VisitAndUpdateItemsSource.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.VisitAndUpdateItemsSource.cs index a9fa895f0f8f..5285fdb16c53 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.VisitAndUpdateItemsSource.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.VisitAndUpdateItemsSource.cs @@ -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); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/GestureRecognizerUITests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/GestureRecognizerUITests.cs index 1900a5cb6e5b..cf6483ed0511 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/GestureRecognizerUITests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/GestureRecognizerUITests.cs @@ -22,11 +22,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"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.AdjustPeekAreaInsets.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.AdjustPeekAreaInsets.cs index 2b52407f7bc3..23e1ad54be4a 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.AdjustPeekAreaInsets.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.AdjustPeekAreaInsets.cs @@ -1,4 +1,5 @@ -using NUnit.Framework; +#if ANDROID +using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -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"); } */ } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.LoopNoFreeze.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.LoopNoFreeze.cs index 8ae46c17f021..a04b2bbdf001 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.LoopNoFreeze.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.LoopNoFreeze.cs @@ -13,7 +13,7 @@ public CarouselViewLoopNoFreeze(TestDevice device) public override string Issue => "CarouselView Loop=True default freezes iOS app"; - /* + /* readonly string _carouselAutomationId = "carouselView"; readonly string _btnRemoveAutomationId = "btnRemove"; readonly string _btnRemoveAllAutomationId = "btnRemoveAll"; @@ -22,14 +22,9 @@ public CarouselViewLoopNoFreeze(TestDevice device) [Test] [Category(UITestCategories.CarouselView)] [Ignore("Currently fails")] + [FailsOnIOS("Currently fails on iOS; 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(); @@ -56,14 +51,9 @@ public void Issue12574Test() [Test] [Category(UITestCategories.CarouselView)] [Ignore("Currently fails")] + [FailsOnIOS("Currently fails on iOS; 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); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.NoItemTemplate.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.NoItemTemplate.cs index f0d110014aa2..70b00a85c078 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.NoItemTemplate.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.NoItemTemplate.cs @@ -16,10 +16,9 @@ public CarouselViewNoItemTemplate(TestDevice device) // Issue12777 (src\ControlGallery\src\Issues.Shared\Issue12777.cs [Test] [Category(UITestCategories.CarouselView)] + [FailsOnWindows] public void Issue12777Test() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Windows }); - App.WaitForElement("TestCarouselView"); App.Screenshot("Test passed"); } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.PositionVisibility.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.PositionVisibility.cs index f22f552f44e5..99def904fa3b 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.PositionVisibility.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.PositionVisibility.cs @@ -1,4 +1,5 @@ -using NUnit.Framework; +#if ANDROID +using NUnit.Framework; using NUnit.Framework.Legacy; using UITest.Appium; using UITest.Core; @@ -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(); @@ -36,3 +34,4 @@ public void Issue12848Test() } } } +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.RemoveAt.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.RemoveAt.cs index 3bbb0c001f91..e990b0dd7260 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.RemoveAt.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.RemoveAt.cs @@ -1,4 +1,5 @@ -using NUnit.Framework; +#if IOS +using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -16,15 +17,9 @@ 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"); @@ -32,4 +27,5 @@ public void Issue10300Test() App.WaitForNoElement("2"); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.SetOrientation.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.SetOrientation.cs index 7a321d133514..2f14310da215 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.SetOrientation.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.SetOrientation.cs @@ -18,10 +18,10 @@ public CarouselViewSetOrientation(TestDevice device) // Issue12193 (src\ControlGallery\src\Issues.Shared\Issue12193.cs [Test] [Category(UITestCategories.CarouselView)] + [FailsOnMac] + [FailsOnWindows] public async Task RotatingCarouselViewHTMLShouldNotDisappear() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Mac, TestDevice.Windows }); - int delay = 3000; App.SetOrientationPortrait(); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.UpdateCurrentItem.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.UpdateCurrentItem.cs index fff5b5641b77..e53584645f84 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.UpdateCurrentItem.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.UpdateCurrentItem.cs @@ -1,4 +1,4 @@ -using Microsoft.Maui.TestCases.Tests; +#if ANDROID using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -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"); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.UpdatePosition.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.UpdatePosition.cs index 71c37ee2344f..2ebc908a5b2d 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.UpdatePosition.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.UpdatePosition.cs @@ -1,4 +1,5 @@ -using NUnit.Framework; +#if ANDROID +using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -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"); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.ClearGroupedNoCrash.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.ClearGroupedNoCrash.cs index 25ebd2bf9ac1..1725a167098b 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.ClearGroupedNoCrash.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.ClearGroupedNoCrash.cs @@ -1,3 +1,4 @@ +#if ANDROID using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -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); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewBindingErrors.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewBindingErrors.cs index 0d89b9178c59..b521013727d8 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewBindingErrors.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewBindingErrors.cs @@ -16,10 +16,10 @@ public CollectionViewBindingErrorsUITests(TestDevice device) // CollectionViewBindingErrorsShouldBeZero (src\Compatibility\ControlGallery\src\Issues.Shared\CollectionViewBindingErrors.xaml.cs) [Test] [Category(UITestCategories.CollectionView)] + [FailsOnMac] + [FailsOnWindows] public void NoBindingErrors() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Mac, TestDevice.Windows }); - App.WaitForElement("WaitForStubControl"); App.WaitForNoElement("Binding Errors: 0"); } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs index 8da99e31f750..3e86bca15350 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs @@ -46,10 +46,9 @@ public void KeepItemsInView() // KeepScrollOffset (src\Compatibility\ControlGallery\src\Issues.Shared\CollectionViewItemsUpdatingScrollMode.cs) [Test] [Category(UITestCategories.CollectionView)] + [FailsOnAllPlatforms] public void KeepScrollOffset() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.iOS, TestDevice.Mac, TestDevice.Windows }); - App.WaitForElement("SelectScrollMode"); App.Click("SelectScrollMode"); App.Click("KeepScrollOffset"); @@ -64,10 +63,9 @@ public void KeepScrollOffset() // KeepLastItemInView(src\Compatibility\ControlGallery\src\Issues.Shared\CollectionViewItemsUpdatingScrollMode.cs) [Test] [Category(UITestCategories.CollectionView)] + [FailsOnAllPlatforms] public void KeepLastItemInView() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.iOS, TestDevice.Mac, TestDevice.Windows }); - App.WaitForElement("SelectScrollMode"); App.Click("SelectScrollMode"); App.Click("KeepLastItemInView"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewTabbedPage.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewTabbedPage.cs index 4090b30ac011..facfcc15b4de 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewTabbedPage.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewTabbedPage.cs @@ -26,9 +26,6 @@ public CollectionViewTabbedPageUITests(TestDevice device) [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); @@ -42,9 +39,6 @@ public void AddingItemToUnviewedCollectionViewShouldNotCrash() [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); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.DynamicallyLoad.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.DynamicallyLoad.cs index 11012012e7bf..1fb66c48d70a 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.DynamicallyLoad.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.DynamicallyLoad.cs @@ -18,10 +18,9 @@ public CollectionViewDynamicallyLoadUITests(TestDevice device) // CollectionViewShouldSourceShouldUpdateWhileInvisible (src\Compatibility\ControlGallery\src\Issues.Shared\Issue13126.cs) [Test] [Category(UITestCategories.CollectionView)] + [FailsOnWindows] public void DynamicallyLoadCollectionView() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Windows }); - App.WaitForNoElement(Success); } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.EmptyViewNoCrash.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.EmptyViewNoCrash.cs index c118297e8d80..cbf636c5e5fa 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.EmptyViewNoCrash.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.EmptyViewNoCrash.cs @@ -16,10 +16,11 @@ public EmptyViewNoCrashUITests(TestDevice device) // EmptyViewShouldNotCrash (src\Compatibility\ControlGallery\src\Issues.Shared\Issue9196.xaml.cs) [Test] [Category(UITestCategories.CollectionView)] + [FailsOnIOS] + [FailsOnMac] + [FailsOnWindows] public void EmptyViewShouldNotCrash() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS, TestDevice.Mac, TestDevice.Windows }); - App.WaitForNoElement("Success"); } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/HideSoftInputOnTappedPageTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/HideSoftInputOnTappedPageTests.cs index bc6b3c83fa47..f978a197dfdf 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/HideSoftInputOnTappedPageTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/HideSoftInputOnTappedPageTests.cs @@ -17,13 +17,9 @@ public HideSoftInputOnTappedPageTests(TestDevice device) : base(device) { } [TestCase("Entry", true)] [TestCase("Editor", true)] [TestCase("SearchBar", true)] + [FailsOnWindows] public void HideSoftInputOnTappedPageTest(string control, bool hideOnTapped) - { - this.IgnoreIfPlatforms(new[] - { - TestDevice.Windows - }); - + { App.WaitForElement("HideSoftInputOnTappedTrue"); if (this.Device == TestDevice.Mac) @@ -87,13 +83,9 @@ void HideSoftInputOnTappedPageTestForAndroidiOS(string control, bool hideOnTappe } [Test] + [FailsOnWindows] public void TogglingHideSoftInputOnTapped() - { - this.IgnoreIfPlatforms(new[] - { - TestDevice.Windows - }); - + { App.WaitForElement("HideSoftInputOnTappedFalse"); if (this.Device == TestDevice.Mac) @@ -163,4 +155,4 @@ public void TogglingHideSoftInputOnTappedForAndroidiOS() } } } -} +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16320.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16320.cs index 32d76ddfc219..4687714800bb 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16320.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16320.cs @@ -15,16 +15,12 @@ public Issue16320(TestDevice device) [Test] [Category(UITestCategories.CollectionView)] + // TODO: It looks like this test has never passed on Android, failing with + // "System.TimeoutException : Timed out waiting for element". We (e.g. ema) should + // investigate and properly fix, but we'll ignore for now. + [FailsOnAndroid] public void Issue16320Test() { - // TODO: It looks like this test has never passed on Android, failing with - // "System.TimeoutException : Timed out waiting for element". We (e.g. ema) should - // investigate and properly fix, but we'll ignore for now. - this.IgnoreIfPlatforms(new[] - { - TestDevice.Android - }); - App.Tap("Add"); ClassicAssert.NotNull(App.WaitForElement("item: 1")); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16561.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16561.cs index f4d6f5bf1ae4..2cb48700a6c2 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16561.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16561.cs @@ -23,14 +23,10 @@ public Issue16561(TestDevice device) : base(device) [Test] [Category(UITestCategories.Label)] + // https://github.com/dotnet/maui/issues/17435 + [FailsOnMac] public void TapTwoPlacesQuickly() { - // https://github.com/dotnet/maui/issues/17435 - this.IgnoreIfPlatforms(new[] - { - TestDevice.Mac - }); - if (App is not AppiumApp app2 || app2 is null || app2.Driver is null) { throw new InvalidOperationException("Cannot run test. Missing driver to run quick tap actions."); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17490.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17490.cs index becefa61589b..06e9762a839f 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17490.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17490.cs @@ -1,4 +1,5 @@ -using NUnit.Framework; +#if WINDOWS +using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -19,12 +20,8 @@ public Issue17490(TestDevice device) : base(device) //[Category(UITestCategories.Window)] //public void AppDoesntCrashWhenOpeningWinUIWindowParentedToCurrentWindow() //{ - // this.IgnoreIfPlatforms(new[] - // { - // TestDevice.Mac, TestDevice.iOS, TestDevice.Android - // }); - // App.WaitForElement("SuccessLabel"); //} } } +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18111.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18111.cs index ad8e0e3106b0..fb5d008c0e05 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18111.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18111.cs @@ -14,9 +14,10 @@ public Issue18111(TestDevice device) : base(device) [Test] [Category(UITestCategories.Slider)] + [FailsOnAndroid("Regression test validating the design differences between iOS and Mac specifically")] + [FailsOnWindows("Regression test validating the design differences between iOS and Mac specifically")] public void SettingMaximumTrackColorOnSliderWorks() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.Windows }, "Regression test validating the design differences between iOS and Mac specifically"); App.WaitForElement("WaitForSliderControl"); VerifyScreenshot(); } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18242.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18242.cs index e2387b6220b0..28056fbeb0c7 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18242.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18242.cs @@ -13,10 +13,10 @@ public Issue18242(TestDevice device) : base(device) public override string Issue => "Button ImageSource not Scaling as expected"; [Test] + [FailsOnIOS("iOS will be fixed in https://github.com/dotnet/maui/pull/20953")] + [FailsOnMac("Catalyst will be fixed in https://github.com/dotnet/maui/pull/20953")] public void Issue18242Test() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Mac, TestDevice.iOS }, "iOS will be fixed in https://github.com/dotnet/maui/pull/20953"); - App.WaitForElement("WaitForStubControl"); VerifyScreenshot(); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18623.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18623.cs index a45c38001049..b23fa9f63891 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18623.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18623.cs @@ -14,11 +14,9 @@ public Issue18623(TestDevice device) : base(device) [Test] [Category(UITestCategories.Entry)] + [FailsOnIOS("Currently fails on iOS; see https://github.com/dotnet/maui/issues/18981")] public async Task EntryIsPasswordObscureText() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS }, - "Currently fails on iOS; see https://github.com/dotnet/maui/issues/18981"); - App.WaitForElement("WaitForStubControl"); // 1. In the Entry control below, input some text. The test passes if the text is not obscured. diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18716.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18716.cs index 1258c815d03f..952dabc5629f 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18716.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18716.cs @@ -1,4 +1,5 @@ -using NUnit.Framework; +#if MACCATALYST +using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -18,8 +19,6 @@ public Issue18716(TestDevice device) [Category(UITestCategories.WebView)] public async Task CanScrollWebView() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.Windows, TestDevice.iOS }); - await Task.Delay(1000); // Wait WebView to load. App.WaitForElement("WaitForStubControl"); @@ -29,3 +28,4 @@ public async Task CanScrollWebView() } } +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18751.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18751.cs index abd7efa9eb83..76f331102614 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18751.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18751.cs @@ -15,11 +15,10 @@ public Issue18751(TestDevice device) : base(device) [Test] [Category(UITestCategories.CollectionView)] [Ignore("This test is failing on iOS17, https://github.com/dotnet/maui/issues/20582")] + [FailsOnAndroid("Currently fails on Android; see https://github.com/dotnet/maui/issues/15994")] + [FailsOnWindows("Currently fails on Windows; see https://github.com/dotnet/maui/issues/15994")] public async Task Issue18751Test() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.Windows }, - "Currently fails on Android and Windows; see https://github.com/dotnet/maui/issues/15994"); - App.WaitForElement("WaitForStubControl"); // Load images. @@ -29,4 +28,4 @@ public async Task Issue18751Test() VerifyScreenshot(); } } -} +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18754.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18754.cs index a105d1701080..ffffcdc94b01 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18754.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18754.cs @@ -13,11 +13,10 @@ public Issue18754(TestDevice device) : base(device) { } [Test] [Category(UITestCategories.Editor)] + [FailsOnMac("Currently IsKeyboardShown is not implemented.")] + [FailsOnWindows("Currently IsKeyboardShown is not implemented.")] public void Issue18754Test() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Mac, TestDevice.Windows }, - "Currently IsKeyboardShown is not implemented."); - App.WaitForElement("WaitForStubControl"); // 1. Attempt to enter any text into the editor below. @@ -33,4 +32,4 @@ public void Issue18754Test() ClassicAssert.IsFalse(App.IsKeyboardShown()); } } -} +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18896.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18896.cs index 1c7f7b8dc9e2..300594373317 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18896.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18896.cs @@ -16,14 +16,11 @@ public Issue18896(TestDevice device) : base(device) [Test] [Category(UITestCategories.ListView)] + [FailsOnIOS("Currently fails on iOS; see https://github.com/dotnet/maui/issues/18811")] + [FailsOnMac("Currently fails on Catalyst; see https://github.com/dotnet/maui/issues/18811")] + [FailsOnWindows("Currently fails on Windows; see https://github.com/dotnet/maui/issues/15994")] public async Task Issue18896Test() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS, TestDevice.Mac }, - "Currently fails on iOS; see https://github.com/dotnet/maui/issues/18811"); - - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Windows }, - "Currently fails on Windows; see https://github.com/dotnet/maui/issues/15994"); - App.WaitForElement("WaitForStubControl"); App.ScrollDown(ListView); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19786.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19786.cs index fdf68e37e0b8..d63a31ca65d4 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19786.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19786.cs @@ -14,9 +14,9 @@ public Issue19786(TestDevice device) : base(device) [Test] [Category(UITestCategories.CarouselView)] + [FailsOnWindows] public void RemovingItemsShouldNotCauseCrash() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Windows }); _ = App.WaitForElement("addItemButton"); App.Tap("addItemButton"); App.Tap("addItemButton"); @@ -27,6 +27,5 @@ public void RemovingItemsShouldNotCauseCrash() App.Tap("removeLastItemButton"); App.Tap("removeLastItemButton"); } - } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21314.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21314.cs index 71f641f55451..c09111786cbd 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21314.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21314.cs @@ -1,3 +1,4 @@ +#if IOS using Maui.Controls.Sample; using NUnit.Framework; using NUnit.Framework.Legacy; @@ -16,10 +17,9 @@ public Issue21314(TestDevice device) : base(device) [Test] public void ImageShouldBePortrait() { - this.IgnoreIfPlatforms (new TestDevice[] { TestDevice.Android, TestDevice.Windows }); - var image = App.WaitForElement ("theImage").GetRect(); ClassicAssert.Greater(image.Height, image.Width); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21513.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21513.cs index e6acff06d540..911d61744fa5 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21513.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21513.cs @@ -13,10 +13,10 @@ public Issue21513(TestDevice device) public override string Issue => "Buttons with images don't cover text"; [Test] + [FailsOnIOS] + [FailsOnMac] public void Issue21513Test() { - this.IgnoreIfPlatforms(new [] { TestDevice.Mac, TestDevice.iOS }); - App.WaitForElement("WaitForStubControl"); VerifyScreenshot(); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21726.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21726.cs index ae43a3b9393b..32e44481fad5 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21726.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21726.cs @@ -1,4 +1,5 @@ -using NUnit.Framework; +#if IOS +using NUnit.Framework; using NUnit.Framework.Legacy; using UITest.Appium; using UITest.Core; @@ -16,8 +17,6 @@ public Issue21726(TestDevice device) : base(device) [Test] public void PushViewControllerWithNullWindow() { - this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Mac, TestDevice.Windows]); - App.WaitForElement("AddVC"); App.Click("AddVC"); App.WaitForElement("TextField1").Click(); @@ -27,3 +26,4 @@ public void PushViewControllerWithNullWindow() } } } +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21846.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21846.cs index 35916395c402..72c8ffb81f27 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21846.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21846.cs @@ -14,10 +14,10 @@ public Issue21846(TestDevice device) : base(device) [Test] [Category(UITestCategories.WebView)] + [FailsOnAndroid] + [FailsOnWindows] public void WebViewNoCrashPopup() { - this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.Windows]); - App.WaitForElement("OpenModalButton"); App.Click("OpenModalButton"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21967.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21967.cs index ed91401c223a..bc3579cab266 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21967.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21967.cs @@ -24,10 +24,10 @@ public void CollectionViewItemsResizeWhenContraintsOnCollectionViewChange() App.Tap("Resize"); var smallSize = App.WaitForElement("Item1").GetRect(); - ClassicAssert.Greater(largestSize.Width, mediumSize.Width); + ClassicAssert.Greater(largestSize.Width, mediumSize.Width); ClassicAssert.Greater(mediumSize.Width, smallSize.Width); } - + [Test] [Category(UITestCategories.CollectionView)] public void CollectionViewFirstItemCorrectlySetsTheMeasure() @@ -35,13 +35,13 @@ public void CollectionViewFirstItemCorrectlySetsTheMeasure() var itemSize = App.WaitForElement("Item1").GetRect(); ClassicAssert.Greater(200, itemSize.Height); } - + [Test] [Category(UITestCategories.CollectionView)] + [FailsOnMac] + [FailsOnWindows] public void CollectionViewWorksWhenRotatingDevice() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Mac, TestDevice.Windows }); - try { App.WaitForElement("FullSize"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22035.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22035.cs index da2f3b75c415..8dbbadd0f953 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22035.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22035.cs @@ -14,11 +14,11 @@ public Issue22035(TestDevice device) : base(device) public override string Issue => "[Android] CarouselView: VirtualView cannot be null here, when clearing and adding items on second navigation"; [Test] + [FailsOnIOS("This test is failing, likely due to product issue. More information: https://github.com/dotnet/maui/issues/22287")] + [FailsOnMac("This test is failing, likely due to product issue. More information: https://github.com/dotnet/maui/issues/22287")] + [FailsOnWindows("This test is failing, likely due to product issue. More information: https://github.com/dotnet/maui/issues/22287")] public void CarouselViewVirtualViewNotNull() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS, TestDevice.Mac, TestDevice.Windows }, - "This test is failing, likely due to product issue. More information: https://github.com/dotnet/maui/issues/22287"); - for (int i = 0; i < 2; i++) { App.WaitForElement("TestNavigateButton"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5555.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5555.cs index 239a3db64801..d64118d38a94 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5555.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5555.cs @@ -13,14 +13,10 @@ public Issue5555(TestDevice device) : base(device) [Test] [Category(UITestCategories.TableView)] + [FailsOnIOS] + [FailsOnMac] public void TableViewMemoryLeakWhenUsingSwitchCellOrEntryCell() { - this.IgnoreIfPlatforms(new[] - { - TestDevice.Mac, - TestDevice.iOS, - }); - App.WaitForElement("PushPage"); App.Tap("PushPage"); App.WaitForElement("PushPage"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.Bugzilla28570.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.Bugzilla28570.cs index f5fff2602c09..ed1d671d1cfd 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.Bugzilla28570.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.Bugzilla28570.cs @@ -16,11 +16,9 @@ public Bugzilla28570UITests(TestDevice device) // Bugzilla28570 (src\Compatibility\ControlGallery\src\Issues.Shared\Bugzilla28570.cs) [Test] + [FailsOnAndroid("This test is failing, likely due to product issue")] public void Bugzilla28570Test() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android }, - "This test is failing, likely due to product issue"); - App.WaitForElement ("Tap"); App.Screenshot ("At test page"); App.Tap("Tap"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.Bugzilla35127.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.Bugzilla35127.cs index bb7ebd4a85ac..d797be79135f 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.Bugzilla35127.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.Bugzilla35127.cs @@ -17,11 +17,10 @@ public Bugzilla35127UITests(TestDevice device) // Bugzilla35127 (src\Compatibility\ControlGallery\src\Issues.Shared\Bugzilla35127.cs) [Test] + [FailsOnIOS("This test is failing, likely due to product issue")] + [FailsOnMac("This test is failing, likely due to product issue")] public void Issue35127Test() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS, TestDevice.Mac }, - "This test is failing, likely due to product issue"); - App.WaitForNoElement("See me?"); var count = App.FindElements("scrollView").Count; ClassicAssert.IsTrue(count == 0); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.Bugzilla44461.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.Bugzilla44461.cs index 7e0e452482e3..8776e8a54322 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.Bugzilla44461.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.Bugzilla44461.cs @@ -17,11 +17,11 @@ public Bugzilla44461UITests(TestDevice device) // Bugzilla44461 (src\Compatibility\ControlGallery\src\Issues.Shared\Bugzilla44461.cs) [Test] + [FailsOnIOS("This test is failing, likely due to product issue")] + [FailsOnMac("This test is failing, likely due to product issue")] + [FailsOnWindows("This test is failing, likely due to product issue")] public void Bugzilla44461Test() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS, TestDevice.Mac, TestDevice.Windows }, - "This test is failing, likely due to product issue"); - var positions = TapButton(0); ClassicAssert.AreEqual(positions.initialPosition.X, positions.finalPosition.X); ClassicAssert.LessOrEqual(positions.finalPosition.X, 1); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewDelayedContent.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewDelayedContent.cs index 03ac8beb3a65..c0e3f97d91de 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewDelayedContent.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewDelayedContent.cs @@ -17,10 +17,10 @@ public ScrollViewDelayedContentUITests(TestDevice device) // MeasuringEmptyScrollViewDoesNotCrash (src\Compatibility\ControlGallery\src\Issues.Shared\Issue1538.cs) [Test] [Description("Measuring empty ScrollView does not crash")] + [FailsOnIOS] + [FailsOnMac] public async Task MeasuringEmptyScrollViewDoesNotCrash() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS, TestDevice.Mac }); - // 1. Let's add a child after a second. await Task.Delay(1000); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewDisableScroll.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewDisableScroll.cs index 8e146e42529a..ddf3608c7977 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewDisableScroll.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewDisableScroll.cs @@ -21,19 +21,10 @@ public ScrollViewDisableScrollUITests(TestDevice device) // Issue2680Test_ScrollDisabled (src\Compatibility\ControlGallery\src\Issues.Shared\Issue2680ScrollView.cs) [Test] [Category(UITestCategories.ScrollView)] - [Ignore("Currently fails")] + [Ignore("Currently fails https://github.com/dotnet/maui/pull/19181")] + [FailsOnAndroid("Currently fails on Android; see https://github.com/dotnet/maui/issues/19213")] public void ScrollDisabled() { - this.IgnoreIfPlatforms(new[] - { - TestDevice.Android, - }, "Currently fails on Android; see https://github.com/dotnet/maui/issues/19213"); - - this.IgnoreIfPlatforms(new[] - { - TestDevice.iOS, TestDevice.Mac, TestDevice.Windows - }, "https://github.com/dotnet/maui/pull/19181"); - App.WaitForElement(FirstItemMark); // Waiting until merge https://github.com/dotnet/maui/pull/19181 @@ -46,14 +37,9 @@ public void ScrollDisabled() // Issue2680Test_ScrollEnabled (src\Compatibility\ControlGallery\src\Issues.Shared\Issue2680ScrollView.cs) [Test] [Category(UITestCategories.ScrollView)] - [Ignore("Currently fails")] + [Ignore("Currently fails https://github.com/dotnet/maui/pull/19181")] public void ScrollEnabled() - { - this.IgnoreIfPlatforms(new[] - { - TestDevice.Android, TestDevice.iOS, TestDevice.Mac, TestDevice.Windows - }, "https://github.com/dotnet/maui/pull/19181"); - + { App.WaitForElement(FirstItemMark); App.Tap(ToggleButtonMark); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewIsEnabled.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewIsEnabled.cs index 8e90ebbc886e..57ba491a2c6e 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewIsEnabled.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewIsEnabled.cs @@ -24,10 +24,10 @@ public ScrollViewIsEnabledTests(TestDevice device) // ScrollViewInitiallyEnabled (src\Compatibility\ControlGallery\src\Issues.Shared\ScrollViewIsEnabled.cs) [Test] + [FailsOnIOS("This test is failing, likely due to product issue")] + [FailsOnMac("This test is failing, likely due to product issue")] public void ScrollViewInitiallyEnabled() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS, TestDevice.Mac }, "This test is failing, likely due to product issue"); - // 1. Enable the ScrollView. App.WaitForElement(InitiallyEnabled); App.Tap(InitiallyEnabled); @@ -46,10 +46,10 @@ public void ScrollViewInitiallyEnabled() // ScrollViewInitiallyEnabledThenDisabled (src\Compatibility\ControlGallery\src\Issues.Shared\ScrollViewIsEnabled.cs) [Test] + [FailsOnIOS("This test is failing, likely due to product issue")] + [FailsOnMac("This test is failing, likely due to product issue")] public void ScrollViewInitiallyEnabledThenDisabled() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS, TestDevice.Mac }, "This test is failing, likely due to product issue"); - // 1. Enable the ScrollView. App.WaitForElement(InitiallyEnabled); App.Tap(InitiallyEnabled); @@ -74,10 +74,10 @@ public void ScrollViewInitiallyEnabledThenDisabled() // ScrollViewInitiallyNotEnabled (src\Compatibility\ControlGallery\src\Issues.Shared\ScrollViewIsEnabled.cs) [Test] + [FailsOnIOS("This test is failing, likely due to product issue")] + [FailsOnMac("This test is failing, likely due to product issue")] public void ScrollViewInitiallyNotEnabled() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS, TestDevice.Mac }, "This test is failing, likely due to product issue"); - // 1. Disable the ScrollView. App.WaitForElement(InitiallyNotEnabled); App.Tap(InitiallyNotEnabled); @@ -94,10 +94,10 @@ public void ScrollViewInitiallyNotEnabled() // ScrollViewInitiallyNotEnabledThenEnabled (src\Compatibility\ControlGallery\src\Issues.Shared\ScrollViewIsEnabled.cs) [Test] + [FailsOnIOS("This test is failing, likely due to product issue")] + [FailsOnMac("This test is failing, likely due to product issue")] public void ScrollViewInitiallyNotEnabledThenEnabled() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS, TestDevice.Mac }, "This test is failing, likely due to product issue"); - // 1. Disable the ScrollView. App.WaitForElement(InitiallyNotEnabled); App.Tap(InitiallyNotEnabled); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewObjectDisposed.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewObjectDisposed.cs index f31309a79df4..0a1b0598411c 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewObjectDisposed.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewObjectDisposed.cs @@ -16,11 +16,10 @@ public ScrollViewObjectDisposedUITests(TestDevice device) // ScrollViewObjectDisposedTest (src\Compatibility\ControlGallery\src\Issues.Shared\ScrollViewObjectDisposed.cs) [Test] [Description("Tapping a button inside the ScrollView does not cause an exception.")] + [FailsOnAndroid("This test is failing, likely due to product issue")] + [FailsOnWindows("This test is failing, likely due to product issue")] public void ScrollViewObjectDisposedTest() { - this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.Windows }, - "This test is failing, likely due to product issue"); - // 1. Tap the button. App.Tap("TestButtonId"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/UITestIgnoreAttributes.cs b/src/Controls/tests/TestCases.Shared.Tests/UITestIgnoreAttributes.cs new file mode 100644 index 000000000000..b06ec382d129 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/UITestIgnoreAttributes.cs @@ -0,0 +1,102 @@ +using NUnit.Framework; + +namespace Microsoft.Maui.TestCases.Tests +{ + public class FailsOnAllPlatforms : IgnoreAttribute + { + public FailsOnAllPlatforms() : base(nameof(FailsOnAndroid)) + { + } + public FailsOnAllPlatforms(string reason) : base(reason) + { + } + } + +#if ANDROID + public class FailsOnAndroid : IgnoreAttribute + { + public FailsOnAndroid() : base(nameof(FailsOnAndroid)) + { + } + public FailsOnAndroid(string reason) : base(reason) + { + } + } +#else + public class FailsOnAndroid : CategoryAttribute + { + public FailsOnAndroid() : base(nameof(FailsOnAndroid)) + { + } + public FailsOnAndroid(string name) : base(name) + { + } + } +#endif + +#if IOS + public class FailsOnIOS : IgnoreAttribute + { + public FailsOnIOS() : base(nameof(FailsOnIOS)) + { + } + public FailsOnIOS(string reason) : base(reason) + { + } + } +#else + public class FailsOnIOS : CategoryAttribute + { + public FailsOnIOS() : base(nameof(FailsOnIOS)) + { + } + public FailsOnIOS(string name) : base(name) + { + } + } +#endif + +#if MACCATALYST + public class FailsOnMac : IgnoreAttribute + { + public FailsOnMac() : base(nameof(FailsOnMac)) + { + } + public FailsOnMac(string reason) : base(reason) + { + } + } +#else + public class FailsOnMac : CategoryAttribute + { + public FailsOnMac() : base(nameof(FailsOnMac)) + { + } + public FailsOnMac(string name) : base(name) + { + } + } +#endif + +#if WINDOWS + public class FailsOnWindows : IgnoreAttribute + { + public FailsOnWindows() : base(nameof(FailsOnWindows)) + { + } + public FailsOnWindows(string reason) : base(reason) + { + } + } +#else + public class FailsOnWindows : CategoryAttribute + { + public FailsOnWindows() : base(nameof(FailsOnWindows)) + { + } + public FailsOnWindows(string name) : base(name) + { + } + } +#endif +} From 7d67f2cd55c6dbf95e8ca7a1fbd5ceb0f89417f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Tue, 21 May 2024 12:12:32 +0200 Subject: [PATCH 2/9] Changes in failing test --- src/Controls/tests/TestCases/Issues/Issue19509.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controls/tests/TestCases/Issues/Issue19509.xaml.cs b/src/Controls/tests/TestCases/Issues/Issue19509.xaml.cs index 83ad3c3ced7a..7160630dee02 100644 --- a/src/Controls/tests/TestCases/Issues/Issue19509.xaml.cs +++ b/src/Controls/tests/TestCases/Issues/Issue19509.xaml.cs @@ -29,8 +29,8 @@ public string Text void Button_Clicked(System.Object sender, System.EventArgs e) { - Text = "Updated text on button click"; button.IsVisible = false; + Text = "Updated text on button click"; } } } \ No newline at end of file From 50bc881522ce3792ee7503da642e6ffadf245b20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Tue, 21 May 2024 13:03:58 +0200 Subject: [PATCH 3/9] Re-enabled tests in some platforms --- .../Issues/CarouselViewUITests.LoopNoFreeze.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.LoopNoFreeze.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.LoopNoFreeze.cs index a04b2bbdf001..de86c16cc4a4 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.LoopNoFreeze.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.LoopNoFreeze.cs @@ -6,6 +6,10 @@ 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) { @@ -13,16 +17,11 @@ public CarouselViewLoopNoFreeze(TestDevice 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")] [FailsOnIOS("Currently fails on iOS; see https://github.com/dotnet/maui/issues/19488")] + [FailsOnMac("Currently fails on Catalyst; see https://github.com/dotnet/maui/issues/19488")] public void Issue12574Test() { App.WaitForNoElement("0 item"); @@ -50,8 +49,8 @@ public void Issue12574Test() [Test] [Category(UITestCategories.CarouselView)] - [Ignore("Currently fails")] [FailsOnIOS("Currently fails on iOS; see https://github.com/dotnet/maui/issues/19488")] + [FailsOnMac("Currently fails on Catalyst; see https://github.com/dotnet/maui/issues/19488")] public void RemoveItemsQuickly() { App.WaitForNoElement("0 item"); @@ -60,6 +59,5 @@ public void RemoveItemsQuickly() // If we haven't crashed, then the other button should be here App.WaitForElement(_btnRemoveAutomationId); } - */ } } \ No newline at end of file From abd1c4740cda1c041dde53cd94132f8335888756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Tue, 21 May 2024 13:07:40 +0200 Subject: [PATCH 4/9] Moved comment --- .../tests/TestCases.Shared.Tests/Tests/Issues/Issue16561.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16561.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16561.cs index 2cb48700a6c2..0c7f697a38ed 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16561.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16561.cs @@ -23,8 +23,7 @@ public Issue16561(TestDevice device) : base(device) [Test] [Category(UITestCategories.Label)] - // https://github.com/dotnet/maui/issues/17435 - [FailsOnMac] + [FailsOnMac("https://github.com/dotnet/maui/issues/17435")] public void TapTwoPlacesQuickly() { if (App is not AppiumApp app2 || app2 is null || app2.Driver is null) From 86b7b7fdd59ef7195c940d77f911de645426c88f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Tue, 21 May 2024 13:29:21 +0200 Subject: [PATCH 5/9] Changes based on PR feedback --- ...ctionViewUITests.MultipleBoundSelection.cs | 2 +- ...lectionViewUITests.SingleBoundSelection.cs | 2 +- .../CarouselViewUITests.NoItemTemplate.cs | 2 +- .../CarouselViewUITests.SetOrientation.cs | 4 +-- ...ViewUITests.CollectionViewBindingErrors.cs | 4 +-- ...s.CollectionViewItemsUpdatingScrollMode.cs | 4 +-- ...ionViewUITests.CollectionViewTabbedPage.cs | 4 +-- .../CollectionViewUITests.DynamicallyLoad.cs | 2 +- .../CollectionViewUITests.EmptyViewNoCrash.cs | 6 ++-- .../Issues/HideSoftInputOnTappedPageTests.cs | 4 +-- .../Tests/Issues/Issue16320.cs | 2 +- .../Tests/Issues/Issue17490.cs | 16 +++++----- .../Tests/Issues/Issue18751.cs | 3 +- .../Tests/Issues/Issue19786.cs | 2 +- .../Tests/Issues/Issue21513.cs | 4 +-- .../Tests/Issues/Issue21631.cs | 2 +- .../Tests/Issues/Issue21846.cs | 4 +-- .../Tests/Issues/Issue21967.cs | 4 +-- .../Tests/Issues/Issue5555.cs | 4 +-- ...ollViewUITests.ScrollViewDelayedContent.cs | 4 +-- ...rollViewUITests.ScrollViewDisableScroll.cs | 6 ++-- .../UITestIgnoreAttributes.cs | 29 +------------------ 22 files changed, 46 insertions(+), 68 deletions(-) diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.MultipleBoundSelection.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.MultipleBoundSelection.cs index d1a843faf660..12b8696d8e23 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.MultipleBoundSelection.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.MultipleBoundSelection.cs @@ -14,7 +14,7 @@ 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() { // Navigate to the selection galleries diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.SingleBoundSelection.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.SingleBoundSelection.cs index 4d08f6666406..857479cf2fc6 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.SingleBoundSelection.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.SingleBoundSelection.cs @@ -14,7 +14,7 @@ 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() { diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.NoItemTemplate.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.NoItemTemplate.cs index 70b00a85c078..145000c48d93 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.NoItemTemplate.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.NoItemTemplate.cs @@ -16,7 +16,7 @@ public CarouselViewNoItemTemplate(TestDevice device) // Issue12777 (src\ControlGallery\src\Issues.Shared\Issue12777.cs [Test] [Category(UITestCategories.CarouselView)] - [FailsOnWindows] + [FailsOnWindows("This test is failing, likely due to product issue")] public void Issue12777Test() { App.WaitForElement("TestCarouselView"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.SetOrientation.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.SetOrientation.cs index 2f14310da215..08d392d90682 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.SetOrientation.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.SetOrientation.cs @@ -18,8 +18,8 @@ public CarouselViewSetOrientation(TestDevice device) // Issue12193 (src\ControlGallery\src\Issues.Shared\Issue12193.cs [Test] [Category(UITestCategories.CarouselView)] - [FailsOnMac] - [FailsOnWindows] + [FailsOnMac("Set Orientation methods not implemented")] + [FailsOnWindows("Set Orientation methods not implemented")] public async Task RotatingCarouselViewHTMLShouldNotDisappear() { int delay = 3000; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewBindingErrors.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewBindingErrors.cs index b521013727d8..e3928c68b7df 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewBindingErrors.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewBindingErrors.cs @@ -16,8 +16,8 @@ public CollectionViewBindingErrorsUITests(TestDevice device) // CollectionViewBindingErrorsShouldBeZero (src\Compatibility\ControlGallery\src\Issues.Shared\CollectionViewBindingErrors.xaml.cs) [Test] [Category(UITestCategories.CollectionView)] - [FailsOnMac] - [FailsOnWindows] + [FailsOnMac("This test is failing, likely due to product issue")] + [FailsOnWindows("This test is failing, likely due to product issue")] public void NoBindingErrors() { App.WaitForElement("WaitForStubControl"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs index 3e86bca15350..765f7042d7a6 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewItemsUpdatingScrollMode.cs @@ -46,7 +46,7 @@ public void KeepItemsInView() // KeepScrollOffset (src\Compatibility\ControlGallery\src\Issues.Shared\CollectionViewItemsUpdatingScrollMode.cs) [Test] [Category(UITestCategories.CollectionView)] - [FailsOnAllPlatforms] + [FailsOnAllPlatforms("This test is failing, likely due to product issue")] public void KeepScrollOffset() { App.WaitForElement("SelectScrollMode"); @@ -63,7 +63,7 @@ public void KeepScrollOffset() // KeepLastItemInView(src\Compatibility\ControlGallery\src\Issues.Shared\CollectionViewItemsUpdatingScrollMode.cs) [Test] [Category(UITestCategories.CollectionView)] - [FailsOnAllPlatforms] + [FailsOnAllPlatforms("This test is failing, likely due to product issue")] public void KeepLastItemInView() { App.WaitForElement("SelectScrollMode"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewTabbedPage.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewTabbedPage.cs index facfcc15b4de..5f2de1bb422c 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewTabbedPage.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.CollectionViewTabbedPage.cs @@ -22,7 +22,7 @@ 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() { @@ -35,7 +35,7 @@ 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() { diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.DynamicallyLoad.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.DynamicallyLoad.cs index 1fb66c48d70a..4af1d2f30e5b 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.DynamicallyLoad.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.DynamicallyLoad.cs @@ -18,7 +18,7 @@ public CollectionViewDynamicallyLoadUITests(TestDevice device) // CollectionViewShouldSourceShouldUpdateWhileInvisible (src\Compatibility\ControlGallery\src\Issues.Shared\Issue13126.cs) [Test] [Category(UITestCategories.CollectionView)] - [FailsOnWindows] + [FailsOnWindows("This test is failing, likely due to product issue")] public void DynamicallyLoadCollectionView() { App.WaitForNoElement(Success); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.EmptyViewNoCrash.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.EmptyViewNoCrash.cs index cbf636c5e5fa..53bd404325b2 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.EmptyViewNoCrash.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CollectionViewUITests.EmptyViewNoCrash.cs @@ -16,9 +16,9 @@ public EmptyViewNoCrashUITests(TestDevice device) // EmptyViewShouldNotCrash (src\Compatibility\ControlGallery\src\Issues.Shared\Issue9196.xaml.cs) [Test] [Category(UITestCategories.CollectionView)] - [FailsOnIOS] - [FailsOnMac] - [FailsOnWindows] + [FailsOnIOS("This test is failing, likely due to product issue")] + [FailsOnMac("This test is failing, likely due to product issue")] + [FailsOnWindows("This test is failing, likely due to product issue")] public void EmptyViewShouldNotCrash() { App.WaitForNoElement("Success"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/HideSoftInputOnTappedPageTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/HideSoftInputOnTappedPageTests.cs index f978a197dfdf..d3ec0005a404 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/HideSoftInputOnTappedPageTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/HideSoftInputOnTappedPageTests.cs @@ -17,7 +17,7 @@ public HideSoftInputOnTappedPageTests(TestDevice device) : base(device) { } [TestCase("Entry", true)] [TestCase("Editor", true)] [TestCase("SearchBar", true)] - [FailsOnWindows] + [FailsOnWindows("Test ignored on Windows")] public void HideSoftInputOnTappedPageTest(string control, bool hideOnTapped) { App.WaitForElement("HideSoftInputOnTappedTrue"); @@ -83,7 +83,7 @@ void HideSoftInputOnTappedPageTestForAndroidiOS(string control, bool hideOnTappe } [Test] - [FailsOnWindows] + [FailsOnWindows("Test ignored on Windows")] public void TogglingHideSoftInputOnTapped() { App.WaitForElement("HideSoftInputOnTappedFalse"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16320.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16320.cs index 4687714800bb..47ebed43ba0f 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16320.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16320.cs @@ -18,7 +18,7 @@ public Issue16320(TestDevice device) // TODO: It looks like this test has never passed on Android, failing with // "System.TimeoutException : Timed out waiting for element". We (e.g. ema) should // investigate and properly fix, but we'll ignore for now. - [FailsOnAndroid] + [FailsOnAndroid("This test is failing, likely due to product issue")] public void Issue16320Test() { App.Tap("Add"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17490.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17490.cs index 06e9762a839f..2df2b18aebd5 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17490.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17490.cs @@ -15,13 +15,15 @@ public Issue17490(TestDevice device) : base(device) // I've commented this test out because nunit will still navigate to this test and then just not run any of the tests // Just navigating to this test will crash WinUI so we want to just completely remove it - //[Test] - //[Ignore("This broke with WinAPPSDK 1.4 and we currently don't have an alternative https://github.com/dotnet/maui/issues/20253")] - //[Category(UITestCategories.Window)] - //public void AppDoesntCrashWhenOpeningWinUIWindowParentedToCurrentWindow() - //{ - // App.WaitForElement("SuccessLabel"); - //} + /* + [Test] + [FailsOnWindows("This broke with WinAPPSDK 1.4 and we currently don't have an alternative https://github.com/dotnet/maui/issues/20253")] + [Category(UITestCategories.Window)] + public void AppDoesntCrashWhenOpeningWinUIWindowParentedToCurrentWindow() + { + App.WaitForElement("SuccessLabel"); + } + */ } } #endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18751.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18751.cs index 76f331102614..7ed72f2ad668 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18751.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18751.cs @@ -14,8 +14,9 @@ public Issue18751(TestDevice device) : base(device) [Test] [Category(UITestCategories.CollectionView)] - [Ignore("This test is failing on iOS17, https://github.com/dotnet/maui/issues/20582")] [FailsOnAndroid("Currently fails on Android; see https://github.com/dotnet/maui/issues/15994")] + [FailsOnIOS("This test is failing on iOS17, https://github.com/dotnet/maui/issues/20582")] + [FailsOnMac("This test is failing on Catalyst, https://github.com/dotnet/maui/issues/20582")] [FailsOnWindows("Currently fails on Windows; see https://github.com/dotnet/maui/issues/15994")] public async Task Issue18751Test() { diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19786.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19786.cs index d63a31ca65d4..105db6fa58af 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19786.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19786.cs @@ -14,7 +14,7 @@ public Issue19786(TestDevice device) : base(device) [Test] [Category(UITestCategories.CarouselView)] - [FailsOnWindows] + [FailsOnWindows("This test is failing, likely due to product issue")] public void RemovingItemsShouldNotCauseCrash() { _ = App.WaitForElement("addItemButton"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21513.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21513.cs index 911d61744fa5..f3fd73de70ab 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21513.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21513.cs @@ -13,8 +13,8 @@ public Issue21513(TestDevice device) public override string Issue => "Buttons with images don't cover text"; [Test] - [FailsOnIOS] - [FailsOnMac] + [FailsOnIOS("Not generated snapshot for this platform")] + [FailsOnMac("Not generated snapshot for this platform")] public void Issue21513Test() { App.WaitForElement("WaitForStubControl"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21631.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21631.cs index fa66329d03ff..48a3f9896f20 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21631.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21631.cs @@ -13,7 +13,7 @@ public Issue21631(TestDevice device) : base(device) { } "Injecting base tag in Webview2 works"; [Test] - [Ignore("WebView seems to be unreliably loading the image")] + [FailsOnWindows("WebView seems to be unreliably loading the image")] [Category(UITestCategories.WebView)] public async Task NavigateToStringWithWebviewWorks() { diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21846.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21846.cs index 72c8ffb81f27..ac9f7eb68252 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21846.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21846.cs @@ -14,8 +14,8 @@ public Issue21846(TestDevice device) : base(device) [Test] [Category(UITestCategories.WebView)] - [FailsOnAndroid] - [FailsOnWindows] + [FailsOnAndroid("This test is failing, likely due to product issue")] + [FailsOnWindows("This test is failing, likely due to product issue")] public void WebViewNoCrashPopup() { App.WaitForElement("OpenModalButton"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21967.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21967.cs index bc3579cab266..ee208b9f3a92 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21967.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21967.cs @@ -38,8 +38,8 @@ public void CollectionViewFirstItemCorrectlySetsTheMeasure() [Test] [Category(UITestCategories.CollectionView)] - [FailsOnMac] - [FailsOnWindows] + [FailsOnMac("This test is failing, likely due to product issue")] + [FailsOnWindows("This test is failing, likely due to product issue")] public void CollectionViewWorksWhenRotatingDevice() { try diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5555.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5555.cs index d64118d38a94..8d5d83876943 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5555.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue5555.cs @@ -13,8 +13,8 @@ public Issue5555(TestDevice device) : base(device) [Test] [Category(UITestCategories.TableView)] - [FailsOnIOS] - [FailsOnMac] + [FailsOnIOS("This test is failing, likely due to product issue")] + [FailsOnMac("This test is failing, likely due to product issue")] public void TableViewMemoryLeakWhenUsingSwitchCellOrEntryCell() { App.WaitForElement("PushPage"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewDelayedContent.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewDelayedContent.cs index c0e3f97d91de..30ee4c597c46 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewDelayedContent.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewDelayedContent.cs @@ -17,8 +17,8 @@ public ScrollViewDelayedContentUITests(TestDevice device) // MeasuringEmptyScrollViewDoesNotCrash (src\Compatibility\ControlGallery\src\Issues.Shared\Issue1538.cs) [Test] [Description("Measuring empty ScrollView does not crash")] - [FailsOnIOS] - [FailsOnMac] + [FailsOnIOS("This test is failing, likely due to product issue")] + [FailsOnMac("This test is failing, likely due to product issue")] public async Task MeasuringEmptyScrollViewDoesNotCrash() { // 1. Let's add a child after a second. diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewDisableScroll.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewDisableScroll.cs index ddf3608c7977..d7787263cb37 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewDisableScroll.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ScrollViewUITests.ScrollViewDisableScroll.cs @@ -21,8 +21,10 @@ public ScrollViewDisableScrollUITests(TestDevice device) // Issue2680Test_ScrollDisabled (src\Compatibility\ControlGallery\src\Issues.Shared\Issue2680ScrollView.cs) [Test] [Category(UITestCategories.ScrollView)] - [Ignore("Currently fails https://github.com/dotnet/maui/pull/19181")] [FailsOnAndroid("Currently fails on Android; see https://github.com/dotnet/maui/issues/19213")] + [FailsOnIOS("Currently fails https://github.com/dotnet/maui/pull/19181")] + [FailsOnMac("Currently fails https://github.com/dotnet/maui/pull/19181")] + [FailsOnWindows("Currently fails https://github.com/dotnet/maui/pull/19181")] public void ScrollDisabled() { App.WaitForElement(FirstItemMark); @@ -37,7 +39,7 @@ public void ScrollDisabled() // Issue2680Test_ScrollEnabled (src\Compatibility\ControlGallery\src\Issues.Shared\Issue2680ScrollView.cs) [Test] [Category(UITestCategories.ScrollView)] - [Ignore("Currently fails https://github.com/dotnet/maui/pull/19181")] + [FailsOnAllPlatforms("Currently fails https://github.com/dotnet/maui/pull/19181")] public void ScrollEnabled() { App.WaitForElement(FirstItemMark); diff --git a/src/Controls/tests/TestCases.Shared.Tests/UITestIgnoreAttributes.cs b/src/Controls/tests/TestCases.Shared.Tests/UITestIgnoreAttributes.cs index b06ec382d129..567378cdcb78 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/UITestIgnoreAttributes.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/UITestIgnoreAttributes.cs @@ -4,9 +4,6 @@ namespace Microsoft.Maui.TestCases.Tests { public class FailsOnAllPlatforms : IgnoreAttribute { - public FailsOnAllPlatforms() : base(nameof(FailsOnAndroid)) - { - } public FailsOnAllPlatforms(string reason) : base(reason) { } @@ -15,9 +12,6 @@ public FailsOnAllPlatforms(string reason) : base(reason) #if ANDROID public class FailsOnAndroid : IgnoreAttribute { - public FailsOnAndroid() : base(nameof(FailsOnAndroid)) - { - } public FailsOnAndroid(string reason) : base(reason) { } @@ -25,9 +19,6 @@ public FailsOnAndroid(string reason) : base(reason) #else public class FailsOnAndroid : CategoryAttribute { - public FailsOnAndroid() : base(nameof(FailsOnAndroid)) - { - } public FailsOnAndroid(string name) : base(name) { } @@ -37,9 +28,6 @@ public FailsOnAndroid(string name) : base(name) #if IOS public class FailsOnIOS : IgnoreAttribute { - public FailsOnIOS() : base(nameof(FailsOnIOS)) - { - } public FailsOnIOS(string reason) : base(reason) { } @@ -47,9 +35,6 @@ public FailsOnIOS(string reason) : base(reason) #else public class FailsOnIOS : CategoryAttribute { - public FailsOnIOS() : base(nameof(FailsOnIOS)) - { - } public FailsOnIOS(string name) : base(name) { } @@ -59,9 +44,6 @@ public FailsOnIOS(string name) : base(name) #if MACCATALYST public class FailsOnMac : IgnoreAttribute { - public FailsOnMac() : base(nameof(FailsOnMac)) - { - } public FailsOnMac(string reason) : base(reason) { } @@ -69,9 +51,6 @@ public FailsOnMac(string reason) : base(reason) #else public class FailsOnMac : CategoryAttribute { - public FailsOnMac() : base(nameof(FailsOnMac)) - { - } public FailsOnMac(string name) : base(name) { } @@ -81,9 +60,6 @@ public FailsOnMac(string name) : base(name) #if WINDOWS public class FailsOnWindows : IgnoreAttribute { - public FailsOnWindows() : base(nameof(FailsOnWindows)) - { - } public FailsOnWindows(string reason) : base(reason) { } @@ -91,10 +67,7 @@ public FailsOnWindows(string reason) : base(reason) #else public class FailsOnWindows : CategoryAttribute { - public FailsOnWindows() : base(nameof(FailsOnWindows)) - { - } - public FailsOnWindows(string name) : base(name) + public FailsOnWindows(string description) : base(description) { } } From 4abf06b9fb5716004153bf15f2b16490d169412c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Tue, 21 May 2024 13:43:42 +0200 Subject: [PATCH 6/9] Fixed test errors --- .../Tests/Issues/CarouselViewUITests.LoopNoFreeze.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.LoopNoFreeze.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.LoopNoFreeze.cs index de86c16cc4a4..da77639262b4 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.LoopNoFreeze.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.LoopNoFreeze.cs @@ -20,8 +20,7 @@ public CarouselViewLoopNoFreeze(TestDevice device) // Issue12574 (src\ControlGallery\src\Issues.Shared\Issue12574.cs [Test] [Category(UITestCategories.CarouselView)] - [FailsOnIOS("Currently fails on iOS; see https://github.com/dotnet/maui/issues/19488")] - [FailsOnMac("Currently fails on Catalyst; see https://github.com/dotnet/maui/issues/19488")] + [FailsOnAllPlatforms("Currently fails; see https://github.com/dotnet/maui/issues/19488")] public void Issue12574Test() { App.WaitForNoElement("0 item"); @@ -49,8 +48,7 @@ public void Issue12574Test() [Test] [Category(UITestCategories.CarouselView)] - [FailsOnIOS("Currently fails on iOS; see https://github.com/dotnet/maui/issues/19488")] - [FailsOnMac("Currently fails on Catalyst; see https://github.com/dotnet/maui/issues/19488")] + [FailsOnAllPlatforms("Currently fails; see https://github.com/dotnet/maui/issues/19488")] public void RemoveItemsQuickly() { App.WaitForNoElement("0 item"); From 347366f4150da50ea4a6de61a3e3704fbbdc17dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Wed, 22 May 2024 11:28:04 +0200 Subject: [PATCH 7/9] Fix build errors --- .../tests/TestCases.Shared.Tests/Tests/Issues/Issue21314.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21314.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21314.cs index c09111786cbd..a74c16bbdcc6 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21314.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21314.cs @@ -1,5 +1,4 @@ #if IOS -using Maui.Controls.Sample; using NUnit.Framework; using NUnit.Framework.Legacy; using UITest.Appium; @@ -7,7 +6,8 @@ namespace Microsoft.Maui.TestCases.Tests.Issues { - public class Issue21314 : _IssuesUITest { + public class Issue21314 : _IssuesUITest + { public override string Issue => "Image has wrong orientation on iOS"; public Issue21314(TestDevice device) : base(device) From 2d7992ddeb170ae6018fc88019e2c40d467134c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Mon, 27 May 2024 06:48:15 +0200 Subject: [PATCH 8/9] Ignore golden tests on macOS for now --- .../tests/TestCases.Shared.Tests/Tests/Issues/Issue15330.cs | 1 + .../tests/TestCases.Shared.Tests/Tests/Issues/Issue17789.cs | 1 + .../tests/TestCases.Shared.Tests/Tests/Issues/Issue18111.cs | 1 + .../tests/TestCases.Shared.Tests/Tests/Issues/Issue18623.cs | 1 + .../tests/TestCases.Shared.Tests/Tests/Issues/Issue18675.cs | 1 + .../tests/TestCases.Shared.Tests/Tests/Issues/Issue18706.cs | 1 + .../tests/TestCases.Shared.Tests/Tests/Issues/Issue19509.cs | 1 + .../tests/TestCases.Shared.Tests/Tests/Issues/Issue20156.cs | 1 + .../tests/TestCases.Shared.Tests/Tests/Issues/Issue20199.cs | 1 + .../tests/TestCases.Shared.Tests/Tests/Issues/Issue21513.cs | 2 +- .../tests/TestCases.Shared.Tests/Tests/Issues/Issue22000.cs | 1 + .../tests/TestCases.Shared.Tests/Tests/Issues/Issue7823.cs | 1 + 12 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue15330.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue15330.cs index ea6c63941860..8224b1293f68 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue15330.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue15330.cs @@ -15,6 +15,7 @@ public Issue15330(TestDevice device) [Test] [Category(UITestCategories.Layout)] + [FailsOnMac("VerifyScreenshot method not implemented on macOS")] public void Issue15330Test() { // Currently fails on iOS; see https://github.com/dotnet/maui/issues/17125 diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17789.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17789.cs index e9c3f04a2701..0180880ad74b 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17789.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17789.cs @@ -14,6 +14,7 @@ public Issue17789(TestDevice device) : base(device) [Test] [Category(UITestCategories.Page)] + [FailsOnMac("VerifyScreenshot method not implemented on macOS")] public void ContentPageBackgroundImageSourceWorks() { App.WaitForElement("WaitForStubControl"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18111.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18111.cs index fb5d008c0e05..587bf3567b83 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18111.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18111.cs @@ -15,6 +15,7 @@ public Issue18111(TestDevice device) : base(device) [Test] [Category(UITestCategories.Slider)] [FailsOnAndroid("Regression test validating the design differences between iOS and Mac specifically")] + [FailsOnMac("VerifyScreenshot method not implemented on macOS")] [FailsOnWindows("Regression test validating the design differences between iOS and Mac specifically")] public void SettingMaximumTrackColorOnSliderWorks() { diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18623.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18623.cs index b23fa9f63891..5450764ef72c 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18623.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18623.cs @@ -15,6 +15,7 @@ public Issue18623(TestDevice device) : base(device) [Test] [Category(UITestCategories.Entry)] [FailsOnIOS("Currently fails on iOS; see https://github.com/dotnet/maui/issues/18981")] + [FailsOnMac("VerifyScreenshot method not implemented on macOS")] public async Task EntryIsPasswordObscureText() { App.WaitForElement("WaitForStubControl"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18675.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18675.cs index 9dcc46ebf867..8515c19467e7 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18675.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18675.cs @@ -14,6 +14,7 @@ public Issue186751(TestDevice device) : base(device) [Test] [Category(UITestCategories.Editor)] + [FailsOnMac("VerifyScreenshot method not implemented on macOS")] public async Task EditorIsReadOnlyPreventModify() { App.WaitForElement("WaitForStubControl"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18706.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18706.cs index 5eae64d690b9..4bbbcc97aba1 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18706.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18706.cs @@ -12,6 +12,7 @@ public Issue18706(TestDevice device) : base(device) { } [Test] [Category(UITestCategories.Editor)] + [FailsOnMac("VerifyScreenshot method not implemented on macOS")] public void EditorBackgroundWorks() { App.WaitForElement("WaitForStubControl"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19509.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19509.cs index 7e2e99e4cf6a..86404e9db3a1 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19509.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19509.cs @@ -13,6 +13,7 @@ public Issue19509(TestDevice device) : base(device) public override string Issue => "Entry TextColor property not working when the Text value is bound after some time"; [Test] + [FailsOnMac("VerifyScreenshot method not implemented on macOS")] public async Task EntryTextColorStopsWorkingAfterPropertyIsUpdatedFromBinding() { App.WaitForElement("WaitForStubControl"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20156.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20156.cs index 92c38ed340db..b63e5df645f2 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20156.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20156.cs @@ -13,6 +13,7 @@ public Issue20156(TestDevice device) { } [Test] + [FailsOnMac("VerifyScreenshot method not implemented on macOS")] public void BorderShouldHaveNoThickness() { _ = App.WaitForElement("WaitForStubControl"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20199.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20199.cs index 4db5312819ca..de51da16da61 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20199.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20199.cs @@ -14,6 +14,7 @@ public Issue20199(TestDevice device) : base(device) } [Test] + [FailsOnMac("VerifyScreenshot method not implemented on macOS")] public void TitleViewShouldBeVisible() { _ = App.WaitForElement("button"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21513.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21513.cs index f3fd73de70ab..6bdb9446f755 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21513.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21513.cs @@ -14,7 +14,7 @@ public Issue21513(TestDevice device) [Test] [FailsOnIOS("Not generated snapshot for this platform")] - [FailsOnMac("Not generated snapshot for this platform")] + [FailsOnMac("VerifyScreenshot method not implemented on macOS")] public void Issue21513Test() { App.WaitForElement("WaitForStubControl"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22000.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22000.cs index 98ab2f905b0e..32054f8b8f75 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22000.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22000.cs @@ -12,6 +12,7 @@ public Issue22000(TestDevice device) : base(device) { } [Test] [Category(UITestCategories.CarouselView)] + [FailsOnMac("VerifyScreenshot method not implemented on macOS")] public async Task ResizeCarouselViewKeepsIndex() { App.WaitForElement("WaitForStubControl"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7823.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7823.cs index 61256fe7785c..2c595a659ad8 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7823.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7823.cs @@ -14,6 +14,7 @@ public Issue7823(TestDevice device) public override string Issue => "In a ToolbarItems, if an item has no icon but just text, MAUI uses the icon from the previous page in the Navigation"; [Test] + [FailsOnMac("VerifyScreenshot method not implemented on macOS")] public void UpdateToolbarItemAfterNavigate() { // 1. Navigate from Page with a ToolbarItem using an Icon. From 4ec9287533305cadf78b26093705ec978ac195a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Mon, 27 May 2024 12:00:36 +0200 Subject: [PATCH 9/9] Updated test --- .../Tests/Issues/Issue18857.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18857.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18857.cs index 329a36084efd..8d63a950530e 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18857.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18857.cs @@ -1,4 +1,5 @@ -using NUnit.Framework; +#if ANDROID +using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -16,13 +17,6 @@ public Issue18857(TestDevice device) [Category(UITestCategories.ImageButton)] public async Task GradientImageButtonBackground() { - this.IgnoreIfPlatforms(new[] - { - TestDevice.Mac, - TestDevice.iOS, - TestDevice.Windows - }); - App.WaitForElement("TestImageButton"); App.Tap("TestRemoveBackgroundButton"); @@ -33,4 +27,5 @@ public async Task GradientImageButtonBackground() VerifyScreenshot(); } } -} \ No newline at end of file +} +#endif \ No newline at end of file