From 7255a51d8c7873f60dfb12651066340bb77702b3 Mon Sep 17 00:00:00 2001 From: TamilarasanSF4853 Date: Fri, 25 Jul 2025 19:39:39 +0530 Subject: [PATCH 1/2] Added a failing condition for iOS --- .../FeatureMatrix/TimePickerFeatureTests.cs | 372 +++++++++--------- 1 file changed, 189 insertions(+), 183 deletions(-) diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/TimePickerFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/TimePickerFeatureTests.cs index 75e8187c5c14..f8ce0f1b033f 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/TimePickerFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/TimePickerFeatureTests.cs @@ -18,6 +18,8 @@ protected override void FixtureSetup() App.NavigateToGallery(TimePickerFeatureMatrix); } +#if TEST_FAILS_ON_IOS // Issue Link - https://github.com/dotnet/maui/issues/30837 + #if TEST_FAILS_ON_CATALYST [Test, Order(1)] @@ -36,76 +38,6 @@ public void TimePicker_InitialState_VerifyVisualState() } #endif -#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST - - [Test, Order(2)] - [Category(UITestCategories.TimePicker)] - public void TimePicker_ModifyOldTimeAndNewTime_VerifyVisualState() - { -#if ANDROID - App.WaitForElement("OK"); - App.Tap("OK"); - App.WaitForElement("TimePickerControl"); - App.Tap("TimePickerControl"); - App.WaitForElement(AppiumQuery.ByAccessibilityId("6")); - App.Tap(AppiumQuery.ByAccessibilityId("6")); - App.WaitForElement("OK"); - App.Tap("OK"); -#elif WINDOWS - App.WaitForElement("AcceptButton"); - App.Tap("AcceptButton"); - App.WaitForElement("TimePickerControl"); - App.Tap("TimePickerControl"); - App.WaitForElement("6"); - App.Tap("6"); - App.WaitForElement("AcceptButton"); - App.Tap("AcceptButton"); -#endif - Assert.That(App.WaitForElement("NewTimeSelectedLabel").GetText(), Is.EqualTo("06:00:00")); - Assert.That(App.WaitForElement("OldTimeSelectedLabel").GetText(), Is.EqualTo("10:00:00")); - VerifyScreenshot(); - } -#endif - -#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST - - [Test, Order(3)] - [Category(UITestCategories.TimePicker)] - public void TimePicker_OldTimeAndNewTime_VerifyVisualState() - { -#if ANDROID - App.WaitForElement("TimePickerControl"); - App.Tap("TimePickerControl"); - App.WaitForElement(AppiumQuery.ByAccessibilityId("7")); - App.Tap(AppiumQuery.ByAccessibilityId("7")); - App.WaitForElement("OK"); - App.Tap("OK"); - App.WaitForElement("TimePickerControl"); - App.Tap("TimePickerControl"); - App.WaitForElement(AppiumQuery.ByAccessibilityId("8")); - App.Tap(AppiumQuery.ByAccessibilityId("8")); - App.WaitForElement("Cancel"); - App.Tap("Cancel"); -#elif WINDOWS - App.WaitForElement("TimePickerControl"); - App.Tap("TimePickerControl"); - App.WaitForElement("7"); - App.Tap("7"); - App.WaitForElement("AcceptButton"); - App.Tap("AcceptButton"); - App.WaitForElement("TimePickerControl"); - App.Tap("TimePickerControl"); - App.WaitForElement("8"); - App.Tap("8"); - App.WaitForElement("DismissButton"); - App.Tap("DismissButton"); -#endif - Assert.That(App.WaitForElement("NewTimeSelectedLabel").GetText(), Is.EqualTo("07:00:00")); - Assert.That(App.WaitForElement("OldTimeSelectedLabel").GetText(), Is.EqualTo("06:00:00")); - VerifyScreenshot(); - } -#endif - #if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS // Issue Link - https://github.com/dotnet/maui/issues/30199 [Test, Order(4)] @@ -124,23 +56,6 @@ public void TimePicker_SetTimeAndCharacterSpacing_VerifyVisualState() } #endif -#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS // Issue Link - https://github.com/dotnet/maui/issues/30192 - - [Test, Order(5)] - [Category(UITestCategories.TimePicker)] - public void TimePicker_SetFlowDirectionAndTime_VerifyVisualState() - { - App.WaitForElement("Options"); - App.Tap("Options"); - App.WaitForElement("FlowDirectionRTL"); - App.Tap("FlowDirectionRTL"); - App.WaitForElement("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("TimePickerControl"); - VerifyScreenshot(); - } -#endif - #if TEST_FAILS_ON_CATALYST [Test, Order(6)] @@ -197,35 +112,6 @@ public void TimePicker_SetFontAttributesAndFontSize_VerifyVisualState() } #endif -#if TEST_FAILS_ON_CATALYST - - [Test, Order(9)] - [Category(UITestCategories.TimePicker)] - public void TimePicker_SetFontAttributesAndFormat_VerifyVisualState() - { - App.WaitForElement("Options"); - App.Tap("Options"); - App.WaitForElement("FontAttributesItalicButton"); - App.Tap("FontAttributesItalicButton"); - App.WaitForElement("FormatEntry"); - App.ClearText("FormatEntry"); - App.EnterText("FormatEntry", "HH:mm"); - App.WaitForElement("SetFormatButton"); - App.Tap("SetFormatButton"); - App.WaitForElement("TimeEntry"); - App.ClearText("TimeEntry"); - App.EnterText("TimeEntry", "17:00"); - App.WaitForElement("SetTimeButton"); - App.Tap("SetTimeButton"); - App.WaitForElement("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("TimePickerControl"); - App.WaitForElement("CultureFormatLabel"); - App.Tap("CultureFormatLabel"); - VerifyScreenshot(); - } -#endif - #if TEST_FAILS_ON_CATALYST [Test, Order(10)] @@ -246,60 +132,6 @@ public void TimePicker_SetFontFamilyAndFontSize_VerifyVisualState() } #endif -#if TEST_FAILS_ON_CATALYST - - [Test, Order(11)] - [Category(UITestCategories.TimePicker)] - public void TimePicker_SetFontFamilyAndFormat_VerifyVisualState() - { - App.WaitForElement("Options"); - App.Tap("Options"); - App.WaitForElement("FontFamilyDokdoButton"); - App.Tap("FontFamilyDokdoButton"); - App.WaitForElement("FormatEntry"); - App.ClearText("FormatEntry"); - App.EnterText("FormatEntry", "HH:mm"); - App.WaitForElement("SetFormatButton"); - App.Tap("SetFormatButton"); - App.WaitForElement("TimeEntry"); - App.ClearText("TimeEntry"); - App.EnterText("TimeEntry", "17:00"); - App.WaitForElement("SetTimeButton"); - App.Tap("SetTimeButton"); - App.WaitForElement("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("TimePickerControl"); - App.WaitForElement("CultureFormatLabel"); - App.Tap("CultureFormatLabel"); - VerifyScreenshot(); - } -#endif - -#if TEST_FAILS_ON_CATALYST - - [Test, Order(12)] - [Category(UITestCategories.TimePicker)] - public void TimePicker_SetFontSizeAndFormat_VerifyVisualState() - { - App.WaitForElement("Options"); - App.Tap("Options"); - App.WaitForElement("FontSizeEntry"); - App.ClearText("FontSizeEntry"); - App.EnterText("FontSizeEntry", "20"); - App.WaitForElement("FormatEntry"); - App.ClearText("FormatEntry"); - App.EnterText("FormatEntry", "hh:mm"); - App.WaitForElement("SetFormatButton"); - App.Tap("SetFormatButton"); - App.WaitForElement("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("TimePickerControl"); - App.WaitForElement("CultureFormatLabel"); - App.Tap("CultureFormatLabel"); - VerifyScreenshot(); - } -#endif - [Test, Order(13)] [Category(UITestCategories.TimePicker)] public void TimePicker_SetTimeAndIsEnabled_VerifyVisualState() @@ -315,19 +147,6 @@ public void TimePicker_SetTimeAndIsEnabled_VerifyVisualState() VerifyScreenshot(); } - [Test, Order(14)] - [Category(UITestCategories.TimePicker)] - public void TimePicker_SetTimeAndIsVisible_VerifyVisualState() - { - App.WaitForElement("Options"); - App.Tap("Options"); - App.WaitForElement("IsVisibleFalseButton"); - App.Tap("IsVisibleFalseButton"); - App.WaitForElement("Apply"); - App.Tap("Apply"); - App.WaitForNoElement("TimePickerControl"); - } - #if TEST_FAILS_ON_WINDOWS // Issue Link - https://github.com/dotnet/maui/issues/29812 [Test, Order(15)] @@ -454,6 +273,193 @@ public void TimePicker_SetFormat_T_WithFontSize_VerifyVisualState() } #endif +#endif + +#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST + + [Test, Order(2)] + [Category(UITestCategories.TimePicker)] + public void TimePicker_ModifyOldTimeAndNewTime_VerifyVisualState() + { +#if ANDROID + App.WaitForElement("OK"); + App.Tap("OK"); + App.WaitForElement("TimePickerControl"); + App.Tap("TimePickerControl"); + App.WaitForElement(AppiumQuery.ByAccessibilityId("6")); + App.Tap(AppiumQuery.ByAccessibilityId("6")); + App.WaitForElement("OK"); + App.Tap("OK"); +#elif WINDOWS + App.WaitForElement("AcceptButton"); + App.Tap("AcceptButton"); + App.WaitForElement("TimePickerControl"); + App.Tap("TimePickerControl"); + App.WaitForElement("6"); + App.Tap("6"); + App.WaitForElement("AcceptButton"); + App.Tap("AcceptButton"); +#endif + Assert.That(App.WaitForElement("NewTimeSelectedLabel").GetText(), Is.EqualTo("06:00:00")); + Assert.That(App.WaitForElement("OldTimeSelectedLabel").GetText(), Is.EqualTo("10:00:00")); + VerifyScreenshot(); + } +#endif + +#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST + + [Test, Order(3)] + [Category(UITestCategories.TimePicker)] + public void TimePicker_OldTimeAndNewTime_VerifyVisualState() + { +#if ANDROID + App.WaitForElement("TimePickerControl"); + App.Tap("TimePickerControl"); + App.WaitForElement(AppiumQuery.ByAccessibilityId("7")); + App.Tap(AppiumQuery.ByAccessibilityId("7")); + App.WaitForElement("OK"); + App.Tap("OK"); + App.WaitForElement("TimePickerControl"); + App.Tap("TimePickerControl"); + App.WaitForElement(AppiumQuery.ByAccessibilityId("8")); + App.Tap(AppiumQuery.ByAccessibilityId("8")); + App.WaitForElement("Cancel"); + App.Tap("Cancel"); +#elif WINDOWS + App.WaitForElement("TimePickerControl"); + App.Tap("TimePickerControl"); + App.WaitForElement("7"); + App.Tap("7"); + App.WaitForElement("AcceptButton"); + App.Tap("AcceptButton"); + App.WaitForElement("TimePickerControl"); + App.Tap("TimePickerControl"); + App.WaitForElement("8"); + App.Tap("8"); + App.WaitForElement("DismissButton"); + App.Tap("DismissButton"); +#endif + Assert.That(App.WaitForElement("NewTimeSelectedLabel").GetText(), Is.EqualTo("07:00:00")); + Assert.That(App.WaitForElement("OldTimeSelectedLabel").GetText(), Is.EqualTo("06:00:00")); + VerifyScreenshot(); + } +#endif + + + +#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS // Issue Link - https://github.com/dotnet/maui/issues/30192 + + [Test, Order(5)] + [Category(UITestCategories.TimePicker)] + public void TimePicker_SetFlowDirectionAndTime_VerifyVisualState() + { + App.WaitForElement("Options"); + App.Tap("Options"); + App.WaitForElement("FlowDirectionRTL"); + App.Tap("FlowDirectionRTL"); + App.WaitForElement("Apply"); + App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled("TimePickerControl"); + VerifyScreenshot(); + } +#endif + +#if TEST_FAILS_ON_CATALYST + + [Test, Order(9)] + [Category(UITestCategories.TimePicker)] + public void TimePicker_SetFontAttributesAndFormat_VerifyVisualState() + { + App.WaitForElement("Options"); + App.Tap("Options"); + App.WaitForElement("FontAttributesItalicButton"); + App.Tap("FontAttributesItalicButton"); + App.WaitForElement("FormatEntry"); + App.ClearText("FormatEntry"); + App.EnterText("FormatEntry", "HH:mm"); + App.WaitForElement("SetFormatButton"); + App.Tap("SetFormatButton"); + App.WaitForElement("TimeEntry"); + App.ClearText("TimeEntry"); + App.EnterText("TimeEntry", "17:00"); + App.WaitForElement("SetTimeButton"); + App.Tap("SetTimeButton"); + App.WaitForElement("Apply"); + App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled("TimePickerControl"); + App.WaitForElement("CultureFormatLabel"); + App.Tap("CultureFormatLabel"); + VerifyScreenshot(); + } +#endif + +#if TEST_FAILS_ON_CATALYST + + [Test, Order(11)] + [Category(UITestCategories.TimePicker)] + public void TimePicker_SetFontFamilyAndFormat_VerifyVisualState() + { + App.WaitForElement("Options"); + App.Tap("Options"); + App.WaitForElement("FontFamilyDokdoButton"); + App.Tap("FontFamilyDokdoButton"); + App.WaitForElement("FormatEntry"); + App.ClearText("FormatEntry"); + App.EnterText("FormatEntry", "HH:mm"); + App.WaitForElement("SetFormatButton"); + App.Tap("SetFormatButton"); + App.WaitForElement("TimeEntry"); + App.ClearText("TimeEntry"); + App.EnterText("TimeEntry", "17:00"); + App.WaitForElement("SetTimeButton"); + App.Tap("SetTimeButton"); + App.WaitForElement("Apply"); + App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled("TimePickerControl"); + App.WaitForElement("CultureFormatLabel"); + App.Tap("CultureFormatLabel"); + VerifyScreenshot(); + } +#endif + +#if TEST_FAILS_ON_CATALYST + + [Test, Order(12)] + [Category(UITestCategories.TimePicker)] + public void TimePicker_SetFontSizeAndFormat_VerifyVisualState() + { + App.WaitForElement("Options"); + App.Tap("Options"); + App.WaitForElement("FontSizeEntry"); + App.ClearText("FontSizeEntry"); + App.EnterText("FontSizeEntry", "20"); + App.WaitForElement("FormatEntry"); + App.ClearText("FormatEntry"); + App.EnterText("FormatEntry", "hh:mm"); + App.WaitForElement("SetFormatButton"); + App.Tap("SetFormatButton"); + App.WaitForElement("Apply"); + App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled("TimePickerControl"); + App.WaitForElement("CultureFormatLabel"); + App.Tap("CultureFormatLabel"); + VerifyScreenshot(); + } +#endif + + [Test, Order(14)] + [Category(UITestCategories.TimePicker)] + public void TimePicker_SetTimeAndIsVisible_VerifyVisualState() + { + App.WaitForElement("Options"); + App.Tap("Options"); + App.WaitForElement("IsVisibleFalseButton"); + App.Tap("IsVisibleFalseButton"); + App.WaitForElement("Apply"); + App.Tap("Apply"); + App.WaitForNoElement("TimePickerControl"); + } + #if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS // Issue Link - https://github.com/dotnet/maui/issues/30197 [Test, Order(21)] From cf691c616c4ea181a3f43933d57f094bd98022ca Mon Sep 17 00:00:00 2001 From: TamilarasanSF4853 Date: Fri, 25 Jul 2025 20:06:44 +0530 Subject: [PATCH 2/2] removed spaces --- .../Tests/FeatureMatrix/TimePickerFeatureTests.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/TimePickerFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/TimePickerFeatureTests.cs index f8ce0f1b033f..2a690b472359 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/TimePickerFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/TimePickerFeatureTests.cs @@ -345,8 +345,6 @@ public void TimePicker_OldTimeAndNewTime_VerifyVisualState() } #endif - - #if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS // Issue Link - https://github.com/dotnet/maui/issues/30192 [Test, Order(5)]