From 5b61aae8948aa675c3cace14fe429c9fbf96c261 Mon Sep 17 00:00:00 2001 From: Ahamed-Ali <102580874+Ahamed-Ali@users.noreply.github.com> Date: Wed, 4 Nov 2026 14:17:43 +0530 Subject: [PATCH] Restricted the windows cv1 --- .../Tests/Issues/Issue38059.cs | 2 ++ .../TestCases.Shared.Tests/UtilExtensions.cs | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue38059.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue38059.cs index 50222923a6e1..8759f3b39521 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue38059.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue38059.cs @@ -24,6 +24,8 @@ public void Issue38059_UntemplatedVerticalGridLayout() [ShardedTestCategory(UITestCategories.CollectionView)] public void Issue38059_UntemplatedHorizontalGridLayout() { + this.IgnoreOnWindowsCV1("https://github.com/dotnet/maui/issues/39874"); + App.WaitForElement("ChangeLayoutButton"); App.Tap("ChangeLayoutButton"); VerifyScreenshot(); diff --git a/src/Controls/tests/TestCases.Shared.Tests/UtilExtensions.cs b/src/Controls/tests/TestCases.Shared.Tests/UtilExtensions.cs index d1a0b0ff300c..e823fde4351c 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/UtilExtensions.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/UtilExtensions.cs @@ -36,6 +36,32 @@ public static void IgnoreOnAndroidShellHandler(this UITestContextBase testBase, } } + /// + /// Ignores the current test only when running in the Windows CollectionView1 configuration. + /// + public static void IgnoreOnWindowsCV1(this UITestContextBase testBase, string reason) + { + if (testBase.Device == TestDevice.Windows && + Environment.GetEnvironmentVariable("TEST_CONFIGURATION_ARGS")?.Contains( + "UseWindowsCV1:true", StringComparison.OrdinalIgnoreCase) == true) + { + Assert.Ignore(reason); + } + } + + /// + /// Ignores the current test only when running in the Windows CollectionView2 configuration. + /// + public static void IgnoreOnWindowsCV2(this UITestContextBase testBase, string reason) + { + if (testBase.Device == TestDevice.Windows && + Environment.GetEnvironmentVariable("TEST_CONFIGURATION_ARGS")?.Contains( + "UseWindowsCV1:true", StringComparison.OrdinalIgnoreCase) != true) + { + Assert.Ignore(reason); + } + } + public static void Back(this UITestContextBase testBase) { if (testBase.Device == TestDevice.Android)