diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/AbsoluteLayoutFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/AbsoluteLayoutFeatureTests.cs index 130066c6cbd1..950e9d33245f 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/AbsoluteLayoutFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/AbsoluteLayoutFeatureTests.cs @@ -50,7 +50,7 @@ public void VerifyAbsoluteLayout_LayoutBounds() App.Tap(LayoutFlagNoneCheckBox); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -69,7 +69,7 @@ public void VerifyAbsoluteLayout_WidthAndHeight() App.Tap(LayoutFlagNoneCheckBox); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -91,7 +91,7 @@ public void VerifyAbsoluteLayout_XProportional() App.Tap(LayoutFlagXProportionalCheckBox); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -113,7 +113,7 @@ public void VerifyAbsoluteLayout_YProportional() App.Tap(LayoutFlagYProportionalCheckBox); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -140,7 +140,7 @@ public void VerifyAbsoluteLayout_XProportionalAndYProportional() App.Tap(LayoutFlagYProportionalCheckBox); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -165,7 +165,7 @@ public void VerifyAbsoluteLayout_PositionProportional() App.Tap(LayoutFlagPositionProportionalCheckBox); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -184,7 +184,7 @@ public void VerifyAbsoluteLayout_WidthProportional() App.Tap(LayoutFlagWidthProportionalCheckBox); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -203,7 +203,7 @@ public void VerifyAbsoluteLayout_HeightProportional() App.Tap(LayoutFlagHeightProportionalCheckBox); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -224,7 +224,7 @@ public void VerifyAbsoluteLayout_WidthProportionalAndHeightProportional() App.Tap(LayoutFlagWidthProportionalCheckBox); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -243,7 +243,7 @@ public void VerifyAbsoluteLayout_SizeProportional() App.Tap(LayoutFlagSizeProportionalCheckBox); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -262,7 +262,7 @@ public void VerifyAbsoluteLayout_SizeProportionalWithMaximumValue() App.Tap(LayoutFlagSizeProportionalCheckBox); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -287,7 +287,7 @@ public void VerifyAbsoluteLayout_AllProportional() App.Tap(LayoutFlagAllCheckBox); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -314,7 +314,7 @@ public void VerifyAbsoluteLayout_SizeProportionalAndPositionProportional() App.Tap(LayoutFlagPositionProportionalCheckBox); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -333,7 +333,7 @@ public void VerifyAbsoluteLayout_FlowDirection() App.Tap("FlowDirectionRTL"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -346,7 +346,7 @@ public void VerifyAbsoluteLayout_Visibility() App.Tap("IsVisibleFalse"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST // Issue Link: https://github.com/dotnet/maui/issues/31496 @@ -360,7 +360,7 @@ public void VerifyAbsoluteLayout_BackgroundColor() App.Tap("BackgroundColorGrayButton"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -388,7 +388,7 @@ public void VerifyAbsoluteLayout_Reset_LayoutBounds() App.WaitForElement(XEntry); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/AppThemeFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/AppThemeFeatureTests.cs index 9588350e6ac5..19cf117f945d 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/AppThemeFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/AppThemeFeatureTests.cs @@ -18,7 +18,7 @@ public void VerifyScreenshotWithPlatformCropping() #if IOS VerifyScreenshot(cropBottom: 1200); #else - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #endif } @@ -28,7 +28,7 @@ public void LightTheme_VerifyVisualState() { App.WaitForElement("DefaultLightThemeButton"); App.Tap("DefaultLightThemeButton"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(2)] @@ -37,7 +37,7 @@ public void DarkTheme_VerifyVisualState() { App.WaitForElement("DefaultDarkThemeButton"); App.Tap("DefaultDarkThemeButton"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(3)] @@ -52,7 +52,7 @@ public void LightTheme_CheckBox_VerifyVisualState() App.Tap("LightThemeButton"); App.WaitForElement("CheckBox"); App.Tap("CheckBox"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(4)] @@ -64,7 +64,7 @@ public void DarkTheme_CheckBox_VerifyVisualState() App.WaitForElement("CheckBox"); App.Tap("CheckBox"); App.Tap("CheckBox"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(5)] @@ -83,7 +83,7 @@ public void LightTheme_DatePicker_VerifyVisualState() App.Tap("DatePicker"); App.Tap("22"); #endif - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(6)] @@ -102,7 +102,7 @@ public void DarkTheme_DatePicker_VerifyVisualState() App.Tap("DatePicker"); App.Tap("23"); #endif - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(7)] @@ -111,7 +111,7 @@ public void LightTheme_RadioButton_VerifyVisualState() { App.WaitForElement("LightThemeButton"); App.Tap("LightThemeButton"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(8)] @@ -122,7 +122,7 @@ public void DarkTheme_RadioButton_VerifyVisualState() App.Tap("DarkThemeButton"); App.WaitForElement("RadioButton_Cat"); App.Tap("RadioButton_Cat"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST @@ -137,7 +137,7 @@ public void LightTheme_Picker_VerifyVisualState() App.Tap("Picker"); App.WaitForElement("Blue Monkey"); App.Tap("Blue Monkey"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(10)] @@ -150,7 +150,7 @@ public void DarkTheme_Picker_VerifyVisualState() App.Tap("Picker"); App.WaitForElement("Howler Monkey"); App.Tap("Howler Monkey"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -161,7 +161,7 @@ public void LightTheme_Slider_VerifyVisualState() App.WaitForElement("LightThemeButton"); App.Tap("LightThemeButton"); App.WaitForElement("Slider"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(12)] @@ -171,7 +171,7 @@ public void DarkTheme_Slider_VerifyVisualState() App.WaitForElement("DarkThemeButton"); App.Tap("DarkThemeButton"); App.WaitForElement("Slider"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(13)] @@ -182,7 +182,7 @@ public void LightTheme_Switch_VerifyVisualState() App.Tap("LightThemeButton"); App.WaitForElement("Switch"); App.Tap("Switch"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(14)] @@ -194,7 +194,7 @@ public void DarkTheme_Switch_VerifyVisualState() App.WaitForElement("Switch"); App.Tap("Switch"); App.Tap("Switch"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_IOS && TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST // Issue Link - https://github.com/dotnet/maui/issues/30837 @@ -219,7 +219,7 @@ public void LightTheme_TimePicker_VerifyVisualState() App.WaitForElement("AcceptButton"); App.Tap("AcceptButton"); #endif - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(16)] @@ -242,7 +242,7 @@ public void DarkTheme_TimePicker_VerifyVisualState() App.WaitForElement("AcceptButton"); App.Tap("AcceptButton"); #endif - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -253,7 +253,7 @@ public void LightTheme_SearchBar_VerifyVisualState() App.WaitForElement("LightThemeButton"); App.Tap("LightThemeButton"); App.WaitForElement("SearchBar"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(18)] @@ -263,7 +263,7 @@ public void DarkTheme_SearchBar_VerifyVisualState() App.WaitForElement("DarkThemeButton"); App.Tap("DarkThemeButton"); App.WaitForElement("SearchBar"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(19)] @@ -273,7 +273,7 @@ public void LightTheme_Editor_VerifyVisualState() App.WaitForElement("LightThemeButton"); App.Tap("LightThemeButton"); App.WaitForElement("Editor"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(20)] @@ -283,7 +283,7 @@ public void DarkTheme_Editor_VerifyVisualState() App.WaitForElement("DarkThemeButton"); App.Tap("DarkThemeButton"); App.WaitForElement("Editor"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS && TEST_FAILS_ON_WINDOWS //Issue Link - https://github.com/dotnet/maui/issues/19997 diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/BorderFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/BorderFeatureTests.cs index 3735f6398838..7fe9bb907229 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/BorderFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/BorderFeatureTests.cs @@ -30,7 +30,7 @@ public void Border_PaddingWithContent_Label() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -51,7 +51,7 @@ public void Border_StrokeColorWithPaddingAndContent_Image() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -69,7 +69,7 @@ public void Border_StrokeColorWithStrokeShape_RoundRectangle() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -87,7 +87,7 @@ public void Border_StrokeColorWithStrokeThickness() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -105,7 +105,7 @@ public void Border_StrokeShapeWithStrokeThickness_Ellipse() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } @@ -129,7 +129,7 @@ public void Border_StrokeShapeWithStrokeLineJoin_Bevel() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } @@ -151,7 +151,7 @@ public void Border_StrokeShapeWithDashArray_Path() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -173,7 +173,7 @@ public void Border_StrokeThicknessWithDashArray() #if WINDOWS VerifyScreenshot(cropTop: 100); #else - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #endif } @@ -199,7 +199,7 @@ public void Border_StrokeDashArrayWithDashOffset() #if WINDOWS VerifyScreenshot(cropTop: 100); #else - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #endif } @@ -221,7 +221,7 @@ public void Border_StrokeColorWithStrokeLineJoin_Round() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // For more information, see : https://github.com/dotnet/maui/issues/29741 [Test] @@ -242,7 +242,7 @@ public void Border_StrokeDashArrayWithStrokeLineCap_Round() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -263,7 +263,7 @@ public void Border_StrokeDashArrayWithDashOffsetAndStrokeLineCapRound() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -284,7 +284,7 @@ public void Border_StrokeDashArrayWithStrokeLineCap_Square() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -308,7 +308,7 @@ public void Border_StrokeDashArrayWithEllipseShapeAndStrokeLineCap_Square() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -332,7 +332,7 @@ public void Border_PolygonShapeWithStrokeLineCap_Round() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -355,7 +355,7 @@ public void Border_StrokeDashArrayWithStrokeColor() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -373,7 +373,7 @@ public void Border_StrokeThicknessWithStrokeLineJoin_Bevel() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -394,7 +394,7 @@ public void Border_PolygonShapeWithStrokeLineJoin_Bevel() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -420,7 +420,7 @@ public void Border_Shadow() #if WINDOWS VerifyScreenshot(cropTop: 100); #else - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #endif } @@ -446,7 +446,7 @@ public void Border_StrokeColorWithDashArrayAndOffset() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/BoxViewFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/BoxViewFeatureTests.cs index fbe8beb2cb47..7924be4cd6b4 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/BoxViewFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/BoxViewFeatureTests.cs @@ -27,7 +27,8 @@ public void BoxView_IsVisible() App.WaitForElement("VisibilityCheckBox"); App.Tap("VisibilityCheckBox"); - VerifyScreenshot(); + // Use retryTimeout to allow UI to settle after visibility change + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -46,7 +47,8 @@ public void BoxView_CornerRadiusWithColor() App.WaitForElement("RedRadioButton"); App.Tap("RedRadioButton"); - VerifyScreenshot(); + // Use retryTimeout to allow UI to settle after color change + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -65,7 +67,8 @@ public void BoxView_ColorWithOpacity() App.WaitForElement("OpacityLabel"); App.Tap("OpacityLabel"); - VerifyScreenshot(); + // Use retryTimeout to allow UI to settle after opacity change + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -84,7 +87,8 @@ public void BoxView_CornerRadiusWithFlowDirection() App.WaitForElement("FlowDirectionRTLCheckBox"); App.Tap("FlowDirectionRTLCheckBox"); - VerifyScreenshot(); + // Use retryTimeout to allow UI to settle after flow direction change + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // For more information see: https://github.com/dotnet/maui/issues/27732 [Test] @@ -109,7 +113,8 @@ public void BoxView_CornerRadiusWithOpacityAndShadow() App.WaitForElement("ShadowCheckBox"); App.Tap("ShadowCheckBox"); - VerifyScreenshot(); + // Use retryTimeout to allow UI to settle after shadow change + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -131,7 +136,8 @@ public void BoxView_CornerRadiusWithColorAndShadow() App.WaitForElement("ShadowCheckBox"); App.Tap("ShadowCheckBox"); - VerifyScreenshot(); + // Use retryTimeout to allow UI to settle after shadow change + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -153,7 +159,8 @@ public void BoxView_ColorWithOpacityAndShadow() App.WaitForElement("ShadowCheckBox"); App.Tap("ShadowCheckBox"); - VerifyScreenshot(); + // Use retryTimeout to allow UI to settle after shadow change + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ButtonFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ButtonFeatureTests.cs index 708200d6d21c..d7a0701ecb20 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ButtonFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ButtonFeatureTests.cs @@ -34,7 +34,7 @@ public void Button_SetBorderColorAndTextColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("ButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -54,7 +54,7 @@ public void Button_SetBorderWidthEntryAndLineBreakMode_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("ButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST //CharacterSpacingEntry property not working on iOS and Catalyst, Issue: https://github.com/dotnet/maui/issues/21488 @@ -74,7 +74,7 @@ public void Button_SetCharacterSpacingAndText_VerifyVisualState() App.WaitForElementTillPageNavigationSettled("ButtonControl"); App.WaitForElement("ClickedEventLabel"); App.Tap("ClickedEventLabel"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -116,7 +116,7 @@ public void Button_SetCornerRadiusAndBorderWidth_VerifyVisualState() App.WaitForElementTillPageNavigationSettled("ButtonControl"); App.WaitForElement("ClickedEventLabel"); App.Tap("ClickedEventLabel"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -145,7 +145,7 @@ public void Button_setFontAttributesAndFontFamily_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("ButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -161,7 +161,7 @@ public void Button_setFontAttributesAndText_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("ButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -179,7 +179,7 @@ public void Button_setFontAttributesAndTextTransform_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("ButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -195,7 +195,7 @@ public void Button_setFontFamilyAndText_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("ButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -213,7 +213,7 @@ public void Button_setFontFamilyAndTextTransform_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("ButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -233,7 +233,7 @@ public void Button_setFontSizeAndLineBreakMode_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("ButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -252,7 +252,7 @@ public void Button_setFontSizeAndText_VerifyVisualState() App.WaitForElementTillPageNavigationSettled("ButtonControl"); App.WaitForElement("ClickedEventLabel"); App.Tap("ClickedEventLabel"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -271,7 +271,7 @@ public void Button_setFontSizeAndTextTransform_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("ButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -317,7 +317,7 @@ public void Button_SetLineBreakModeCharacterWrap_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("ButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -334,7 +334,7 @@ public void Button_SetLineBreakModeHeadTruncation_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("ButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -351,7 +351,7 @@ public void Button_SetLineBreakModeMiddleTruncation_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("ButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -368,7 +368,7 @@ public void Button_SetLineBreakModeTailTruncation_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("ButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -385,7 +385,7 @@ public void Button_SetLineBreakModeWordWrap_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("ButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -407,7 +407,7 @@ public void Button_setPaddingAndText_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("ButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -423,7 +423,7 @@ public void Button_setShadowAndText_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("ButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -439,7 +439,7 @@ public void Button_setTextAndTextColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("ButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CheckBoxFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CheckBoxFeatureTests.cs index f6b455b8190f..b5fd1e75b075 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CheckBoxFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CheckBoxFeatureTests.cs @@ -100,7 +100,7 @@ public void CheckBox_ChangeColor_VerifyVisualState() App.WaitForElement("GreenColorButton"); App.Tap("GreenColorButton"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -118,7 +118,7 @@ public void CheckBox_SetIsCheckedAndColor_VerifyVisualState() Assert.That(App.FindElement(IsCheckedLabel).GetText(), Is.EqualTo("False")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ItemsSourceFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ItemsSourceFeatureTests.cs index f8f3f2f36dab..6057e8d1e7c2 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ItemsSourceFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ItemsSourceFeatureTests.cs @@ -607,7 +607,7 @@ public void VerifyStringItemsObservableCollectionWhenSingleModePreSelection() App.EnterText(IndexEntry, "0"); App.WaitForElement(RemoveItems); App.Tap(RemoveItems); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -627,7 +627,7 @@ public void VerifyStringItemsObservableCollectionWhenMultipleModePreSelection() App.EnterText(IndexEntry, "0"); App.WaitForElement(RemoveItems); App.Tap(RemoveItems); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -649,7 +649,7 @@ public void VerifyModelItemsObservableCollectionWhenSingleModePreSelection() App.EnterText(IndexEntry, "0"); App.WaitForElement(RemoveItems); App.Tap(RemoveItems); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -671,7 +671,7 @@ public void VerifyModelItemsObservableCollectionWhenMultipleModePreSelection() App.EnterText(IndexEntry, "0"); App.WaitForElement(RemoveItems); App.Tap(RemoveItems); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -719,7 +719,7 @@ public void VerifyStringItemsGroupedListWhenMultipleModePreSelection() App.EnterText(IndexEntry, "0"); App.WaitForElement(RemoveItems); App.Tap(RemoveItems); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -745,7 +745,7 @@ public void VerifyModelItemsGroupedListWhenSingleModePreSelection() App.EnterText(IndexEntry, "0"); App.WaitForElement(RemoveItems); App.Tap(RemoveItems); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -771,6 +771,6 @@ public void VerifyModelItemsGroupedListWhenMultipleModePreSelection() App.EnterText(IndexEntry, "0"); App.WaitForElement(RemoveItems); App.Tap(RemoveItems); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs index 82fc2db912c9..be979e21d6d1 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs @@ -46,7 +46,7 @@ public void VerifyMeasureAllItemsWithObservableCollection() App.Tap(ItemSizingMeasureAllItems); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // [Windows] NullReferenceException thrown When Toggling IsGrouped to True in ObservableCollection Binding Issue Link: https://github.com/dotnet/maui/issues/28824 @@ -64,7 +64,7 @@ public void VerifyMeasureAllItemsWithGroupedList() App.Tap(ItemsSourceGroupedList2); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -85,7 +85,7 @@ public void VerifyMeasureFirstItemsWithObservableCollection() App.Tap(ItemSizingMeasureFirstItem); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -102,7 +102,7 @@ public void VerifyMeasureFirstItemsWithObservableCollectionWhenVerticalGrid() App.Tap(ItemsLayoutVerticalGrid); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -119,7 +119,7 @@ public void VerifyMeasureFirstItemsWithGroupedList() App.Tap(ItemsSourceGroupedList2); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -136,7 +136,7 @@ public void VerifyMeasureAllItemsWithObservableCollectionWhenHorizontalGrid() App.Tap(ItemsLayoutHorizontalGrid); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -153,7 +153,7 @@ public void VerifyMeasureAllItemsWithObservableCollectionWhenHorizontalList() App.Tap(ItemsLayoutHorizontalList); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -170,7 +170,7 @@ public void VerifyMeasureAllItemsWithObservableCollectionWhenVerticalGrid() App.Tap(ItemsLayoutVerticalGrid); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -189,7 +189,7 @@ public void VerifyMeasureAllItemsWithGroupedListWhenVerticalGrid() App.Tap(ItemsLayoutVerticalGrid); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -208,7 +208,7 @@ public void VerifyMeasureAllItemsWithGroupedListWhenHorizontalGrid() App.Tap(ItemsLayoutHorizontalGrid); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -227,7 +227,7 @@ public void VerifyMeasureAllItemsWithGroupedListWhenHorizontalList() App.Tap(ItemsLayoutHorizontalList); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_ANDROID @@ -247,7 +247,7 @@ public void VerifyMeasureFirstItemsWithObservableCollectionWhenHorizontalGrid() App.Tap(ItemsLayoutHorizontalGrid); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -264,7 +264,7 @@ public void VerifyMeasureFirstItemsWithObservableCollectionWhenHorizontalList() App.Tap(ItemsLayoutHorizontalList); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -283,7 +283,7 @@ public void VerifyMeasureFirstItemsWithGroupedListWhenVerticalGrid() App.Tap(ItemsLayoutVerticalGrid); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -302,7 +302,7 @@ public void VerifyMeasureFirstItemsWithGroupedListWhenHorizontalList() App.Tap(ItemsLayoutHorizontalList); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -321,7 +321,7 @@ public void VerifyMeasureFirstItemsWithGroupedListWhenHorizontalGrid() App.Tap(ItemsLayoutHorizontalGrid); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif #endif diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_SelectionFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_SelectionFeatureTests.cs index 478d5b436408..c78f09f96b11 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_SelectionFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_SelectionFeatureTests.cs @@ -467,7 +467,7 @@ public void VerifySelectionModeSingleWhenProgrammaticSelectionWorksWithHorizonta App.Tap(Apply); Assert.That(App.WaitForElement(SelectedSingle).GetText(), Is.EqualTo("Apple")); Assert.That(App.WaitForElement(SelectedMultiple).GetText(), Is.EqualTo("1")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_CATALYST //related issue link: https://github.com/dotnet/maui/issues/18028 @@ -487,7 +487,7 @@ public void VerifySelectionModeMultipleWhenProgrammaticSelectionWorksWithHorizon App.Tap(Apply); Assert.That(App.WaitForElement(SelectedSingle).GetText(), Is.EqualTo("Apple, Orange")); Assert.That(App.WaitForElement(SelectedMultiple).GetText(), Is.EqualTo("2")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif #endif @@ -506,7 +506,7 @@ public void VerifySelectionModeSingleWhenProgrammaticSelectionWorksWithVerticalL App.Tap(Apply); Assert.That(App.WaitForElement(SelectedSingle).GetText(), Is.EqualTo("Apple")); Assert.That(App.WaitForElement(SelectedMultiple).GetText(), Is.EqualTo("1")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_CATALYST //related issue link: https://github.com/dotnet/maui/issues/18028 @@ -524,7 +524,7 @@ public void VerifySelectionModeMultipleWhenProgrammaticSelectionWorksWithVertica App.Tap(Apply); Assert.That(App.WaitForElement(SelectedSingle).GetText(), Is.EqualTo("Apple, Orange")); Assert.That(App.WaitForElement(SelectedMultiple).GetText(), Is.EqualTo("2")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -545,7 +545,7 @@ public void VerifySelectionModeSingleWhenProgrammaticSelectionWhithItemsSourceGr App.Tap("SingleModePreselection"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_CATALYST //related issue link: https://github.com/dotnet/maui/issues/18028 @@ -567,7 +567,7 @@ public void VerifySelectionModeMultipleWhenProgrammaticSelectionWhithItemsSource App.Tap(Apply); Assert.That(App.WaitForElement(SelectedSingle).GetText(), Is.EqualTo("Apple, Orange, Carrot, Spinach")); Assert.That(App.WaitForElement(SelectedMultiple).GetText(), Is.EqualTo("4")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif #endif diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ContentPageFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ContentPageFeatureTests.cs index f576763cf052..9e82aae437ca 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ContentPageFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ContentPageFeatureTests.cs @@ -27,7 +27,7 @@ public void ContentPage_zContent() App.WaitForElement("ContentButton"); App.Tap("ContentButton"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); App.WaitForElement("ResetContentButton"); App.Tap("ResetContentButton"); @@ -42,7 +42,7 @@ public void ContentPage_IsVisible_WithTitle() App.WaitForElement("VisibilityCheckBox"); App.Tap("VisibilityCheckBox"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -58,7 +58,7 @@ public void ContentPage_IsVisible_WithoutTitle() App.WaitForElement("VisibilityCheckBox"); App.Tap("VisibilityCheckBox"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -73,7 +73,7 @@ public void ContentPage_Padding_WithBackgroundColor() App.WaitForElement("BackgroundButton"); App.Tap("BackgroundButton"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -89,7 +89,7 @@ public void ContentPage_Title_WithBackgroundColor() App.WaitForElement("BackgroundButton"); App.Tap("BackgroundButton"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -108,7 +108,7 @@ public void ContentPage_Title_WithBackgroundColorAndPadding() App.WaitForElement("PaddingButton"); App.Tap("PaddingButton"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -123,7 +123,7 @@ public void ContentPage_Background_WithRTL() App.WaitForElement("FlowDirectionButton"); App.Tap("FlowDirectionButton"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -138,7 +138,7 @@ public void ContentPage_Padding_WithRTL() App.WaitForElement("FlowDirectionButton"); App.Tap("FlowDirectionButton"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -154,7 +154,7 @@ public void ContentPage_Padding_WithTitle() App.ClearText("TitleEntry"); App.EnterText("TitleEntry", "New Title"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if ANDROID || IOS @@ -182,7 +182,7 @@ public void ContentPage_HideSoftinput_WithRTLAndPadding() App.WaitForElement("KeyboardTestLabel"); App.Tap("KeyboardTestLabel"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -206,7 +206,7 @@ public void ContentPage_HideSoftinput_WithPaddingAndBackground() App.WaitForElement("KeyboardTestLabel"); App.Tap("KeyboardTestLabel"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -231,7 +231,7 @@ public void ContentPage_Title_WithPaddingAndHideSoftInput() App.WaitForElement("KeyboardTestLabel"); App.Tap("KeyboardTestLabel"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ContentViewFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ContentViewFeatureTests.cs index f55e55aa3c0a..6a2e2da6c0bf 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ContentViewFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ContentViewFeatureTests.cs @@ -103,7 +103,7 @@ public void DefaultContentWithBackgroundColor() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElement("This is Default Page"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -116,7 +116,7 @@ public void DefaultContentWithHeightRequest() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElement("This is Default Page"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -129,7 +129,7 @@ public void DefaultContentWithWidthRequest() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElement("This is Default Page"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // related issue link: https://github.com/dotnet/maui/issues/29812 @@ -143,7 +143,7 @@ public void DefaultContentWithShadow() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElement("This is Default Page"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -169,7 +169,7 @@ public void DefaultContentWithFlowDirection() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElement("This is Default Page"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -213,7 +213,7 @@ public void FirstCustomPageWithBackgroundColor() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElement("First ContentView Page"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -242,7 +242,7 @@ public void FirstCustomPageWithFlowDirection() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElement("First ContentView Page"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -271,7 +271,7 @@ public void FirstCustomPageWithIconImageChanged() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElement("First ContentView Page"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -286,7 +286,7 @@ public void FirstCustomPageWithCardColorChanged() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElement("First ContentView Page"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -301,7 +301,7 @@ public void SecondCustomPageWithBackgroundColorChanged() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElement("Second Custom Title"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -330,6 +330,6 @@ public void SecondCustomPageWithFlowDirectionChanged() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElement("Second Custom Title"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/DatePickerFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/DatePickerFeatureTests.cs index e9ec5214a976..00c2317bef63 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/DatePickerFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/DatePickerFeatureTests.cs @@ -31,7 +31,7 @@ public void DatePicker_InitialState_VerifyVisualState() #elif WINDOWS App.Tap("25"); #endif - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(2)] @@ -52,7 +52,7 @@ public void DatePicker_ModifyOldDateAndNewDate_VerifyVisualState() #elif WINDOWS App.Tap("26"); #endif - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(3)] @@ -80,7 +80,7 @@ public void DatePicker_OldDateAndNewDate_VerifyVisualState() #elif WINDOWS App.Tap("27"); #endif - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -97,7 +97,7 @@ public void DatePicker_SetCharacterSpacingAndDate_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("DatePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -114,7 +114,7 @@ public void DatePicker_DateSelectedEvent_FiresOnDateChange() App.Tap("SetDateButton"); App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS // Issue Links - https://github.com/dotnet/maui/issues/23793, https://github.com/dotnet/maui/issues/29099, https://github.com/dotnet/maui/issues/30011 @@ -136,7 +136,7 @@ public void DatePicker_SetDateAndFormat_VerifyVisualState() var datePicker = App.WaitForElement("DatePickerControl").GetText(); Assert.That(datePicker, Is.EqualTo("Wednesday, December 24, 2025")); #else - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #endif } #endif @@ -153,7 +153,7 @@ public void DatePicker_SetDateAndTextColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("DatePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -169,7 +169,7 @@ public void DatePicker_SetDateAndFlowDirection_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("DatePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -187,7 +187,7 @@ public void DatePicker_SetFontAttributesAndFontFamily_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("DatePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(10)] @@ -204,7 +204,7 @@ public void DatePicker_SetFontAttributesAndFontSize_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("DatePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(12)] @@ -221,7 +221,7 @@ public void DatePicker_SetFontFamilyAndFontSize_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("DatePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -242,7 +242,7 @@ public void DatePicker_SetFontAttributesAndFormat_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("DatePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -263,7 +263,7 @@ public void DatePicker_SetFontFamilyAndFormat_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("DatePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -287,7 +287,7 @@ public void DatePicker_SetFontSizeAndFormat_VerifyVisualState() App.WaitForElementTillPageNavigationSettled("DatePickerControl"); App.WaitForElement("CultureFormatLabel"); App.Tap("CultureFormatLabel"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -305,7 +305,7 @@ public void DatePicker_SetDateAndIsEnabled_VerifyVisualState() App.WaitForElementTillPageNavigationSettled("DatePickerControl"); App.WaitForElement("DatePickerControl"); App.Tap("DatePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -320,7 +320,7 @@ public void DatePicker_SetDateAndIsVisible_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForNoElement("DatePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_IOS// Issue Links - https://github.com/dotnet/maui/issues/29812, https://github.com/dotnet/maui/issues/31167 @@ -335,7 +335,7 @@ public void DatePicker_SetDateAndShadowOpacity_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("DatePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -360,7 +360,7 @@ public void DatePicker_SetMinimumDateAndDate_VerifyVisualState() App.WaitForElementTillPageNavigationSettled("DatePickerControl"); App.WaitForElement("CultureFormatLabel"); App.Tap("CultureFormatLabel"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(19)] @@ -384,7 +384,7 @@ public void DatePicker_SetMaximumDateAndDate_VerifyVisualState() App.WaitForElementTillPageNavigationSettled("DatePickerControl"); App.WaitForElement("CultureFormatLabel"); App.Tap("CultureFormatLabel"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS // Issue Links - https://github.com/dotnet/maui/issues/30011 @@ -402,7 +402,7 @@ public void DatePicker_Format_D_LongDatePattern() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("DatePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -421,7 +421,7 @@ public void DatePicker_Format_f_FullDateShortTime() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("DatePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -440,7 +440,7 @@ public void DatePicker_Format_F_FullDateLongTime() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("DatePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -461,7 +461,7 @@ public void DatePicker_SetFontAttributesAndFormat_f_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("DatePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -482,7 +482,7 @@ public void DatePicker_SetFontFamilyAndFormat_f_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("DatePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -506,7 +506,7 @@ public void DatePicker_SetFontSizeAndFormat_f_VerifyVisualState() App.WaitForElementTillPageNavigationSettled("DatePickerControl"); App.WaitForElement("CultureFormatLabel"); App.Tap("CultureFormatLabel"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -531,7 +531,7 @@ public void DatePicker_SetCulture_enUS_VerifyDateFormat() var cultureFormatText = App.WaitForElement("CultureFormatLabel").GetText(); Assert.That(cultureFormatText, Is.EqualTo("Culture: en-US, Date: 12/24/2026 12:00:00 AM")); #else - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #endif } #endif @@ -557,7 +557,7 @@ public void DatePicker_SetCulture_frFR_VerifyDateFormat() var cultureFormatText = App.WaitForElement("CultureFormatLabel").GetText(); Assert.That(cultureFormatText, Is.EqualTo("Culture: fr-FR, Date: 24/12/2026 00:00:00")); #else - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #endif } #endif @@ -583,7 +583,7 @@ public void DatePicker_SetCulture_jaJP_VerifyDateFormat() var cultureFormatText = App.WaitForElement("CultureFormatLabel").GetText(); Assert.That(cultureFormatText, Is.EqualTo("Culture: ja-JP, Date: 2026/12/24 0:00:00")); #else - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #endif } #endif @@ -609,7 +609,7 @@ public void DatePicker_SetCulture_svFI_VerifyDateFormat() var cultureFormatText = App.WaitForElement("CultureFormatLabel").GetText(); Assert.That(cultureFormatText, Is.EqualTo("Culture: sv-FI, Date: 2026-12-24 00:00:00")); #else - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #endif } #endif diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/EditorFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/EditorFeatureTests.cs index f2ba5a1eebfc..b5971265c9c3 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/EditorFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/EditorFeatureTests.cs @@ -451,7 +451,7 @@ public void VerifyEditorTextWhenKeyboardTypeSet() App.Tap("Apply"); App.WaitForElement("TestEditor"); App.Tap("TestEditor"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -465,7 +465,7 @@ public void VerifyEditorTextWhenReturnTypeSet() App.Tap("Apply"); App.WaitForElement("TestEditor"); App.Tap("TestEditor"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/FlexLayoutFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/FlexLayoutFeatureTests.cs index 1036cf33d62c..5d82d28f2e77 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/FlexLayoutFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/FlexLayoutFeatureTests.cs @@ -22,7 +22,7 @@ public void FlexLayout_ValidateDefaultValues() Assert.That(App.FindElement("JustifyContentLabel").GetText(), Is.EqualTo("Start")); Assert.That(App.FindElement("WrapLabel").GetText(), Is.EqualTo("NoWrap")); Assert.That(App.FindElement("Child1AlignSelfLabel").GetText(), Is.EqualTo("Auto")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(2)] @@ -41,7 +41,7 @@ public void FlexLayout_SetWrapAlignContentStretch() App.WaitForElementTillPageNavigationSettled("AlignContentLabel"); Assert.That(App.FindElement("WrapLabel").GetText(), Is.EqualTo("Wrap")); Assert.That(App.FindElement("AlignContentLabel").GetText(), Is.EqualTo("Stretch")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(3)] @@ -58,7 +58,7 @@ public void FlexLayout_SetWrapAlignContentCenter() App.WaitForElementTillPageNavigationSettled("AlignContentLabel"); Assert.That(App.FindElement("WrapLabel").GetText(), Is.EqualTo("Wrap")); Assert.That(App.FindElement("AlignContentLabel").GetText(), Is.EqualTo("Center")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(4)] @@ -75,7 +75,7 @@ public void FlexLayout_SetWrapAlignContentStart() App.WaitForElementTillPageNavigationSettled("AlignContentLabel"); Assert.That(App.FindElement("WrapLabel").GetText(), Is.EqualTo("Wrap")); Assert.That(App.FindElement("AlignContentLabel").GetText(), Is.EqualTo("Start")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(5)] @@ -92,7 +92,7 @@ public void FlexLayout_SetWrapAlignContentEnd() App.WaitForElementTillPageNavigationSettled("AlignContentLabel"); Assert.That(App.FindElement("WrapLabel").GetText(), Is.EqualTo("Wrap")); Assert.That(App.FindElement("AlignContentLabel").GetText(), Is.EqualTo("End")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(6)] @@ -109,7 +109,7 @@ public void FlexLayout_SetWrapAlignContentSpaceAround() App.WaitForElementTillPageNavigationSettled("AlignContentLabel"); Assert.That(App.FindElement("WrapLabel").GetText(), Is.EqualTo("Wrap")); Assert.That(App.FindElement("AlignContentLabel").GetText(), Is.EqualTo("SpaceAround")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(7)] @@ -126,7 +126,7 @@ public void FlexLayout_SetWrapAlignContentSpaceBetween() App.WaitForElementTillPageNavigationSettled("AlignContentLabel"); Assert.That(App.FindElement("WrapLabel").GetText(), Is.EqualTo("Wrap")); Assert.That(App.FindElement("AlignContentLabel").GetText(), Is.EqualTo("SpaceBetween")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(8)] @@ -143,7 +143,7 @@ public void FlexLayout_SetWrapAlignContentSpaceEvenly() App.WaitForElementTillPageNavigationSettled("AlignContentLabel"); Assert.That(App.FindElement("WrapLabel").GetText(), Is.EqualTo("Wrap")); Assert.That(App.FindElement("AlignContentLabel").GetText(), Is.EqualTo("SpaceEvenly")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(9)] @@ -160,7 +160,7 @@ public void FlexLayout_SetWrapReverseAlignContentStretch() App.WaitForElementTillPageNavigationSettled("AlignContentLabel"); Assert.That(App.FindElement("WrapLabel").GetText(), Is.EqualTo("Reverse")); Assert.That(App.FindElement("AlignContentLabel").GetText(), Is.EqualTo("Stretch")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(10)] @@ -177,7 +177,7 @@ public void FlexLayout_SetWrapReverseAlignContentCenter() App.WaitForElementTillPageNavigationSettled("AlignContentLabel"); Assert.That(App.FindElement("WrapLabel").GetText(), Is.EqualTo("Reverse")); Assert.That(App.FindElement("AlignContentLabel").GetText(), Is.EqualTo("Center")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(11)] @@ -194,7 +194,7 @@ public void FlexLayout_SetWrapReverseAlignContentStart() App.WaitForElementTillPageNavigationSettled("AlignContentLabel"); Assert.That(App.FindElement("WrapLabel").GetText(), Is.EqualTo("Reverse")); Assert.That(App.FindElement("AlignContentLabel").GetText(), Is.EqualTo("Start")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(12)] @@ -211,7 +211,7 @@ public void FlexLayout_SetWrapReverseAlignContentEnd() App.WaitForElementTillPageNavigationSettled("AlignContentLabel"); Assert.That(App.FindElement("WrapLabel").GetText(), Is.EqualTo("Reverse")); Assert.That(App.FindElement("AlignContentLabel").GetText(), Is.EqualTo("End")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS && TEST_FAILS_ON_WINDOWS // Issue Link - https://github.com/dotnet/maui/issues/31565 @@ -230,7 +230,7 @@ public void FlexLayout_SetWrapReverseAlignContentSpaceAround() App.WaitForElementTillPageNavigationSettled("AlignContentLabel"); Assert.That(App.FindElement("WrapLabel").GetText(), Is.EqualTo("Reverse")); Assert.That(App.FindElement("AlignContentLabel").GetText(), Is.EqualTo("SpaceAround")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(14)] @@ -247,7 +247,7 @@ public void FlexLayout_SetWrapReverseAlignContentSpaceBetween() App.WaitForElementTillPageNavigationSettled("AlignContentLabel"); Assert.That(App.FindElement("WrapLabel").GetText(), Is.EqualTo("Reverse")); Assert.That(App.FindElement("AlignContentLabel").GetText(), Is.EqualTo("SpaceBetween")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(15)] @@ -264,7 +264,7 @@ public void FlexLayout_SetWrapReverseAlignContentSpaceEvenly() App.WaitForElementTillPageNavigationSettled("AlignContentLabel"); Assert.That(App.FindElement("WrapLabel").GetText(), Is.EqualTo("Reverse")); Assert.That(App.FindElement("AlignContentLabel").GetText(), Is.EqualTo("SpaceEvenly")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -281,7 +281,7 @@ public void FlexLayout_AlignItemsCenter() App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("AlignItemsLabel"); Assert.That(App.FindElement("AlignItemsLabel").GetText(), Is.EqualTo("Center")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(17)] @@ -295,7 +295,7 @@ public void FlexLayout_AlignItemsEnd() App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("AlignItemsLabel"); Assert.That(App.FindElement("AlignItemsLabel").GetText(), Is.EqualTo("End")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(18)] @@ -309,7 +309,7 @@ public void FlexLayout_AlignItemsStretch() App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("AlignItemsLabel"); Assert.That(App.FindElement("AlignItemsLabel").GetText(), Is.EqualTo("Stretch")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(19)] @@ -323,7 +323,7 @@ public void FlexLayout_DirectionRowReverse() App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("DirectionLabel"); Assert.That(App.FindElement("DirectionLabel").GetText(), Is.EqualTo("RowReverse")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(20)] @@ -341,7 +341,7 @@ public void FlexLayout_DirectionColumn() App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("DirectionLabel"); Assert.That(App.FindElement("DirectionLabel").GetText(), Is.EqualTo("Column")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(21)] @@ -355,7 +355,7 @@ public void FlexLayout_DirectionColumnReverse() App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("DirectionLabel"); Assert.That(App.FindElement("DirectionLabel").GetText(), Is.EqualTo("ColumnReverse")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(22)] @@ -373,7 +373,7 @@ public void FlexLayout_JustifyContentCenter() App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("JustifyContentLabel"); Assert.That(App.FindElement("JustifyContentLabel").GetText(), Is.EqualTo("Center")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(23)] @@ -387,7 +387,7 @@ public void FlexLayout_JustifyContentEnd() App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("JustifyContentLabel"); Assert.That(App.FindElement("JustifyContentLabel").GetText(), Is.EqualTo("End")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(24)] @@ -401,7 +401,7 @@ public void FlexLayout_JustifyContentSpaceBetween() App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("JustifyContentLabel"); Assert.That(App.FindElement("JustifyContentLabel").GetText(), Is.EqualTo("SpaceBetween")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(25)] @@ -415,7 +415,7 @@ public void FlexLayout_JustifyContentSpaceAround() App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("JustifyContentLabel"); Assert.That(App.FindElement("JustifyContentLabel").GetText(), Is.EqualTo("SpaceAround")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(26)] @@ -429,7 +429,7 @@ public void FlexLayout_JustifyContentSpaceEvenly() App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("JustifyContentLabel"); Assert.That(App.FindElement("JustifyContentLabel").GetText(), Is.EqualTo("SpaceEvenly")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(27)] @@ -443,7 +443,7 @@ public void FlexLayout_AlignSelfStart() App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("Child1AlignSelfLabel"); Assert.That(App.FindElement("Child1AlignSelfLabel").GetText(), Is.EqualTo("Start")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(28)] @@ -457,7 +457,7 @@ public void FlexLayout_AlignSelfCenter() App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("Child1AlignSelfLabel"); Assert.That(App.FindElement("Child1AlignSelfLabel").GetText(), Is.EqualTo("Center")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(29)] @@ -471,7 +471,7 @@ public void FlexLayout_AlignSelfEnd() App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("Child1AlignSelfLabel"); Assert.That(App.FindElement("Child1AlignSelfLabel").GetText(), Is.EqualTo("End")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(30)] @@ -485,7 +485,7 @@ public void FlexLayout_AlignSelfStretch() App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("Child1AlignSelfLabel"); Assert.That(App.FindElement("Child1AlignSelfLabel").GetText(), Is.EqualTo("Stretch")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(31)] @@ -500,7 +500,7 @@ public void FlexLayout_Child1Grow() App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("Child1GrowLabel"); Assert.That(App.FindElement("Child1GrowLabel").GetText(), Is.EqualTo("100")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(32)] @@ -521,7 +521,7 @@ public void FlexLayout_Child1Shrink() #endif App.WaitForElementTillPageNavigationSettled("ChildShrinkLabel"); Assert.That(App.FindElement("ChildShrinkLabel").GetText(), Is.EqualTo("10")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(33)] @@ -540,7 +540,7 @@ public void FlexLayout_Child1Order() App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("Child1OrderLabel"); Assert.That(App.FindElement("Child1OrderLabel").GetText(), Is.EqualTo("4")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(34)] @@ -557,7 +557,7 @@ public void FlexLayout_BasisAuto_DirectionRow() App.WaitForElementTillPageNavigationSettled("Child1BasisLabel"); Assert.That(App.FindElement("DirectionLabel").GetText(), Is.EqualTo("Row")); Assert.That(App.FindElement("Child1BasisLabel").GetText(), Is.EqualTo("Auto")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(35)] @@ -574,7 +574,7 @@ public void FlexLayout_BasisFixed_DirectionRow() App.WaitForElementTillPageNavigationSettled("Child1BasisLabel"); Assert.That(App.FindElement("DirectionLabel").GetText(), Is.EqualTo("Row")); Assert.That(App.FindElement("Child1BasisLabel").GetText(), Is.EqualTo("Fixed100")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(36)] @@ -591,7 +591,7 @@ public void FlexLayout_BasisPercentage_DirectionRow() App.WaitForElementTillPageNavigationSettled("Child1BasisLabel"); Assert.That(App.FindElement("DirectionLabel").GetText(), Is.EqualTo("Row")); Assert.That(App.FindElement("Child1BasisLabel").GetText(), Is.EqualTo("Percent50")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(37)] @@ -608,7 +608,7 @@ public void FlexLayout_BasisAuto_DirectionRowReverse() App.WaitForElementTillPageNavigationSettled("Child1BasisLabel"); Assert.That(App.FindElement("DirectionLabel").GetText(), Is.EqualTo("RowReverse")); Assert.That(App.FindElement("Child1BasisLabel").GetText(), Is.EqualTo("Auto")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(38)] @@ -625,7 +625,7 @@ public void FlexLayout_BasisFixed_DirectionRowReverse() App.WaitForElementTillPageNavigationSettled("Child1BasisLabel"); Assert.That(App.FindElement("DirectionLabel").GetText(), Is.EqualTo("RowReverse")); Assert.That(App.FindElement("Child1BasisLabel").GetText(), Is.EqualTo("Fixed100")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(39)] @@ -642,7 +642,7 @@ public void FlexLayout_BasisPercentage_DirectionRowReverse() App.WaitForElementTillPageNavigationSettled("Child1BasisLabel"); Assert.That(App.FindElement("DirectionLabel").GetText(), Is.EqualTo("RowReverse")); Assert.That(App.FindElement("Child1BasisLabel").GetText(), Is.EqualTo("Percent50")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(40)] @@ -663,7 +663,7 @@ public void FlexLayout_BasisAuto_DirectionColumn() App.WaitForElementTillPageNavigationSettled("Child1BasisLabel"); Assert.That(App.FindElement("DirectionLabel").GetText(), Is.EqualTo("Column")); Assert.That(App.FindElement("Child1BasisLabel").GetText(), Is.EqualTo("Auto")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(41)] @@ -680,7 +680,7 @@ public void FlexLayout_BasisFixed_DirectionColumn() App.WaitForElementTillPageNavigationSettled("Child1BasisLabel"); Assert.That(App.FindElement("DirectionLabel").GetText(), Is.EqualTo("Column")); Assert.That(App.FindElement("Child1BasisLabel").GetText(), Is.EqualTo("Fixed100")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(42)] @@ -701,7 +701,7 @@ public void FlexLayout_BasisPercentage_DirectionColumn() App.WaitForElementTillPageNavigationSettled("Child1BasisLabel"); Assert.That(App.FindElement("DirectionLabel").GetText(), Is.EqualTo("Column")); Assert.That(App.FindElement("Child1BasisLabel").GetText(), Is.EqualTo("Percent50")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(43)] @@ -718,7 +718,7 @@ public void FlexLayout_BasisAuto_DirectionColumnReverse() App.WaitForElementTillPageNavigationSettled("Child1BasisLabel"); Assert.That(App.FindElement("DirectionLabel").GetText(), Is.EqualTo("ColumnReverse")); Assert.That(App.FindElement("Child1BasisLabel").GetText(), Is.EqualTo("Auto")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(44)] @@ -735,7 +735,7 @@ public void FlexLayout_BasisFixed_DirectionColumnReverse() App.WaitForElementTillPageNavigationSettled("Child1BasisLabel"); Assert.That(App.FindElement("DirectionLabel").GetText(), Is.EqualTo("ColumnReverse")); Assert.That(App.FindElement("Child1BasisLabel").GetText(), Is.EqualTo("Fixed100")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(45)] @@ -756,7 +756,7 @@ public void FlexLayout_BasisPercentage_DirectionColumnReverse() App.WaitForElementTillPageNavigationSettled("Child1BasisLabel"); Assert.That(App.FindElement("DirectionLabel").GetText(), Is.EqualTo("ColumnReverse")); Assert.That(App.FindElement("Child1BasisLabel").GetText(), Is.EqualTo("Percent50")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(46)] @@ -777,7 +777,7 @@ public void FlexLayout_SetAlignItemsCenterWrap() App.WaitForElementTillPageNavigationSettled("AlignItemsLabel"); Assert.That(App.FindElement("AlignItemsLabel").GetText(), Is.EqualTo("Center")); Assert.That(App.FindElement("WrapLabel").GetText(), Is.EqualTo("Wrap")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(47)] @@ -798,6 +798,6 @@ public void FlexLayout_SetAlignItemsEndWrap() App.WaitForElementTillPageNavigationSettled("AlignItemsLabel"); Assert.That(App.FindElement("AlignItemsLabel").GetText(), Is.EqualTo("End")); Assert.That(App.FindElement("WrapLabel").GetText(), Is.EqualTo("Wrap")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/FlyoutPageFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/FlyoutPageFeatureTests.cs index 19fd79fe8fd2..d2bc6e2dd96a 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/FlyoutPageFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/FlyoutPageFeatureTests.cs @@ -183,7 +183,7 @@ public void VerifyFlyoutPage_IsEnabled() App.Tap(IsEnabledFalse); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST // Issue Link: https://github.com/dotnet/maui/issues/26726 @@ -197,7 +197,7 @@ public void VerifyFlyoutPage_IsFlowDirectionRTL() App.Tap(FlowDirectionRTL); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWS // Issue Link: https://github.com/dotnet/maui/issues/31374, https://github.com/dotnet/maui/issues/31372 @@ -213,7 +213,7 @@ public void VerifyFlyoutPage_IsFlowDirectionRTLWithIsPresented() App.Tap(IsPresentedTrue); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif #endif @@ -247,7 +247,7 @@ public void VerifyFlyoutPage_Title() App.EnterText(TitleEntry, "New Title"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST// FlyoutLayoutBehavior is not changed in mobile platforms, Issue Link: https://github.com/dotnet/maui/issues/16245 @@ -261,7 +261,7 @@ public void VerifyFlyoutPage_FlyoutLayoutBehavior_Split() App.Tap(FlyoutLayoutBehaviorSplit); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // Issue Link: https://github.com/dotnet/maui/issues/31390 @@ -275,7 +275,7 @@ public void VerifyFlyoutPage_FlyoutLayoutBehavior_SplitOnPortrait() App.Tap(FlyoutLayoutBehaviorSplitOnPortrait); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif #endif @@ -291,7 +291,7 @@ public void VerifyFlyoutPage_FlyoutLayoutBehaviorPopover() App.Tap(FlyoutLayoutBehaviorPopover); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -334,7 +334,7 @@ public void VerifyFlyoutPage_DetailPageIconImageSource() App.Tap("IconFontIconButton"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(18)] @@ -349,7 +349,7 @@ public void VerifyFlyoutPage_DetailPageIconImageSource_FlyoutLayoutBehavior() App.Tap(FlyoutLayoutBehaviorPopover); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -394,7 +394,7 @@ public void VerifyFlyoutPage_BackgroundColor() App.Tap("BackgroundColorLightYellowButton"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(22)] @@ -407,6 +407,6 @@ public void VerifyFlyoutPage_IsVisible() App.Tap(IsVisibleFalse); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/GridFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/GridFeatureTests.cs index 3016c1815a86..17fa703cef61 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/GridFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/GridFeatureTests.cs @@ -38,7 +38,7 @@ public void VerifyGrid_SetRow() App.EnterText(RowEntry, "3"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -52,7 +52,7 @@ public void VerifyGrid_SetColumn() App.EnterText(ColumnEntry, "4"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -65,7 +65,7 @@ public void VerifyGrid_IsVisible() App.Tap("IsVisibleCheckBox"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -78,7 +78,7 @@ public void VerifyGrid_FlowDirection() App.Tap("FlowDirectionCheckBox"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -91,7 +91,7 @@ public void VerifyGrid_BackgroundColor() App.Tap("ColorGray"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -105,7 +105,7 @@ public void VerifyGrid_Padding() App.EnterText(PaddingEntry, "50,50,50,50"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -119,7 +119,7 @@ public void VerifyGrid_RowSpacing() App.EnterText(RowSpacingEntry, "20"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -133,7 +133,7 @@ public void VerifyGrid_ColumnSpacing() App.EnterText(ColumnSpacingEntry, "30"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -146,7 +146,7 @@ public void VerifyGrid_NestedGrid() App.Tap("NestedGridCheckBox"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } @@ -161,7 +161,7 @@ public void VerifyGrid_ColumnSpan() App.EnterText(MainContentColumnSpanEntry, "2"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -175,7 +175,7 @@ public void VerifyGrid_RowSpan() App.EnterText(MainContentRowSpanEntry, "2"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -188,7 +188,7 @@ public void VerifyGrid_HorizontalOptionsStart() App.Tap("HorizontalStart"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -201,7 +201,7 @@ public void VerifyGrid_HorizontalOptionsCenter() App.Tap("HorizontalCenter"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -214,7 +214,7 @@ public void VerifyGrid_HorizontalOptionsEnd() App.Tap("HorizontalEnd"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -227,7 +227,7 @@ public void VerifyGrid_VerticalOptionsStart() App.Tap("VerticalStart"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -240,7 +240,7 @@ public void VerifyGrid_VerticalOptionsCenter() App.Tap("VerticalCenter"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -253,7 +253,7 @@ public void VerifyGrid_VerticalOptionsEnd() App.Tap("VerticalEnd"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -268,7 +268,7 @@ public void VerifyGrid_VerticalAndHorizontalOptionsStart() App.Tap("HorizontalStart"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -283,7 +283,7 @@ public void VerifyGrid_VerticalAndHorizontalOptionsCenter() App.Tap("HorizontalCenter"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -298,7 +298,7 @@ public void VerifyGrid_VerticalAndHorizontalOptionsEnd() App.Tap("HorizontalEnd"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -319,7 +319,7 @@ public void VerifyGrid_RowAndColumnTypeAbsolute() App.Tap("RowAbsoluteRadio"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -338,7 +338,7 @@ public void VerifyGrid_SetRowAndColumn_BackgroundColor() App.Tap("ColorGray"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -357,7 +357,7 @@ public void VerifyGrid_SetRowAndColumnSpacing_BackgroundColor() App.Tap("ColorGray"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -376,7 +376,7 @@ public void VerifyGrid_SetRow_SetRowSpacing() App.Tap("ColumnStarRadio"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -395,7 +395,7 @@ public void VerifyGrid_SetColumn_SetColumnSpacing() App.Tap("ColumnStarRadio"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -414,7 +414,7 @@ public void VerifyGrid_SetRow_SetColumnSpacing() App.Tap("ColumnStarRadio"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -433,7 +433,7 @@ public void VerifyGrid_SetColumn_SetRowSpacing() App.Tap("ColumnStarRadio"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -452,7 +452,7 @@ public void VerifyGrid_SetRowSpacingAndPadding() App.Tap("ColumnStarRadio"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -471,7 +471,7 @@ public void VerifyGrid_SetColumnSpacingAndPadding() App.Tap("ColumnStarRadio"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -487,6 +487,6 @@ public void VerifyGrid_SetPaddingAndBackgroundColor() App.Tap("ColorRed"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/HybridWebViewFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/HybridWebViewFeatureTests.cs index 269b70c5ea06..ceb91b7fe32b 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/HybridWebViewFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/HybridWebViewFeatureTests.cs @@ -123,7 +123,7 @@ public void VerifyHybridWebViewWithShadow() App.WaitForElement("ShadowCheckBox"); App.Tap("ShadowCheckBox"); Thread.Sleep(2000); // Allow time for the UI to update - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -168,7 +168,7 @@ public void VerifyHybridWebViewWithFlowDirection() App.WaitForElement("FlowDirectionCheckBox"); App.Tap("FlowDirectionCheckBox"); Thread.Sleep(2000); // Allow time for the UI to update - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ImageButtonFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ImageButtonFeatureTests.cs index 5a183907e0c6..fa32bd3a463f 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ImageButtonFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ImageButtonFeatureTests.cs @@ -48,7 +48,7 @@ public void VerifyImageButtonAspect_AspectFitWithImageSourceFromFile() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -64,7 +64,7 @@ public void VerifyImageButtonAspect_AspectFitWithImageSourceFromUri() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl", timeout: TimeSpan.FromSeconds(3)); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_ANDROID // Issue Link: https://github.com/dotnet/maui/issues/30576 [Test] @@ -80,7 +80,7 @@ public void VerifyImageButtonAspect_AspectFitWithImageSourceFromStream() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -96,7 +96,7 @@ public void VerifyImageButtonAspect_FillWithImageSourceFromStream() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif [Test] @@ -112,7 +112,7 @@ public void VerifyImageButtonAspect_AspectFitWithImageSourceFromFontImage() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_ANDROID // Issue Link: https://github.com/dotnet/maui/issues/29956 @@ -129,7 +129,7 @@ public void VerifyImageButtonAspect_AspectFillWithImageSourceFromUri() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl", timeout: TimeSpan.FromSeconds(3)); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -146,7 +146,7 @@ public void VerifyImageButtonAspect_FillWithImageSourceFromFile() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -162,7 +162,7 @@ public void VerifyImageButtonAspect_FillWithImageSourceFromUri() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl", timeout: TimeSpan.FromSeconds(3)); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -178,7 +178,7 @@ public void VerifyImageButtonAspect_CenterWithImageSourceFromFile() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } @@ -198,7 +198,7 @@ public void VerifyImageButtonAspect_AspectFillWithImageSourceFromStream() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -214,7 +214,7 @@ public void VerifyImageButtonAspect_CenterWithImageSourceFromStream() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -231,7 +231,7 @@ public void VerifyImageButtonAspect_AspectFillWithImageSourceFromFontImage() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -247,7 +247,7 @@ public void VerifyImageButtonAspect_FillWithImageSourceFromFontImage() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -263,7 +263,7 @@ public void VerifyImageButtonAspect_CenterWithImageSourceFromFontImage() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_ANDROID // Issue Link: https://github.com/dotnet/maui/issues/29956 @@ -280,7 +280,7 @@ public void VerifyImageButtonAspect_AspectFillWithImageSourceFromFile() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -296,7 +296,7 @@ public void VerifyImageButtonAspect_CenterWithImageSourceFromUri() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl", timeout: TimeSpan.FromSeconds(3)); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif #endif @@ -341,7 +341,7 @@ public void VerifyImageButtonWithShadow() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -356,7 +356,7 @@ public void VerifyImageButtonFlowDirectionRTL() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -431,7 +431,7 @@ public void VerifyImageButtonWithPadding() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -446,7 +446,7 @@ public void VerifyImageButtonWithCornerRadius() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -460,7 +460,7 @@ public void VerifyImageButtonWithBorderColor() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -475,7 +475,7 @@ public void VerifyImageButtonWithBorderWidth() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -492,7 +492,7 @@ public void VerifyImageButtonWithBorderColorAndWidth() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -512,6 +512,6 @@ public void VerifyImageButtonWithBorderWidthAndCornerRadius() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageButtonControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ImageFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ImageFeatureTests.cs index 27998423a4d8..d93b20a1cbf8 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ImageFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ImageFeatureTests.cs @@ -44,7 +44,7 @@ public void VerifyImageAspect_AspectFitWithImageSourceFromFile() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -60,7 +60,7 @@ public void VerifyImageAspect_AspectFitWithImageSourceFromUri() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl", timeout: TimeSpan.FromSeconds(3)); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_ANDROID // Issue Link: https://github.com/dotnet/maui/issues/30576 [Test] @@ -76,7 +76,7 @@ public void VerifyImageAspect_AspectFitWithImageSourceFromStream() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -92,7 +92,7 @@ public void VerifyImageAspect_FillWithImageSourceFromStream() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif [Test] @@ -108,7 +108,7 @@ public void VerifyImageAspect_AspectFitWithImageSourceFromFontImage() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // Issue Link: https://github.com/dotnet/maui/issues/29812 @@ -125,7 +125,7 @@ public void VerifyImageAspect_AspectFillWithImageSourceFromFile() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -141,7 +141,7 @@ public void VerifyImageAspect_AspectFillWithImageSourceFromUri() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl", timeout: TimeSpan.FromSeconds(3)); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_ANDROID // Issue Link: https://github.com/dotnet/maui/issues/30576 [Test] @@ -157,7 +157,7 @@ public void VerifyImageAspect_AspectFillWithImageSourceFromStream() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -174,7 +174,7 @@ public void VerifyImageAspect_AspectFillWithImageSourceFromFontImage() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -191,7 +191,7 @@ public void VerifyImageAspect_FillWithImageSourceFromFile() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -207,7 +207,7 @@ public void VerifyImageAspect_FillWithImageSourceFromUri() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl", timeout: TimeSpan.FromSeconds(3)); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -223,7 +223,7 @@ public void VerifyImageAspect_FillWithImageSourceFromFontImage() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -239,7 +239,7 @@ public void VerifyImageAspect_CenterWithImageSourceFromFile() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -255,7 +255,7 @@ public void VerifyImageAspect_CenterWithImageSourceFromUri() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl", timeout: TimeSpan.FromSeconds(3)); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_ANDROID // Issue Link for Windows: https://github.com/dotnet/maui/issues/29813 and for Android: https://github.com/dotnet/maui/issues/30576 @@ -272,7 +272,7 @@ public void VerifyImageAspect_CenterWithImageSourceFromStream() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -289,7 +289,7 @@ public void VerifyImageAspect_CenterWithImageSourceFromFontImage() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -305,7 +305,7 @@ public void VerifyFontImageWithFontColorGreen() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // Issue Link: https://github.com/dotnet/maui/issues/22210 @@ -324,7 +324,7 @@ public void VerifyFontImageWithFontSize() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -357,7 +357,7 @@ public void VerifyImageWithShadow() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -374,7 +374,7 @@ public void VerifyImageFlowDirectionRTL() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ImageControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/IndicatorViewFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/IndicatorViewFeatureTests.cs index 70602fa5d566..ede4f3b91ef3 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/IndicatorViewFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/IndicatorViewFeatureTests.cs @@ -49,7 +49,7 @@ public void VerifyIndicatorColor() App.Tap(IndicatorColorGreenButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(2)] @@ -62,7 +62,7 @@ public void VerifySelectedIndicatorColor() App.Tap(SelectedIndicatorColorPurpleButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(3)] @@ -105,7 +105,7 @@ public void VerifySelectedIndicatorColorWhenItemsChanged() IncreasePositionStepper(); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(18)] @@ -119,7 +119,7 @@ public void VerifySelectedIndicatorColorWithPosition() IncreasePositionStepper(); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(29)] @@ -133,7 +133,7 @@ public void VerifyIndicatorShapeWithPosition() IncreasePositionStepper(); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -147,7 +147,7 @@ public void VerifySelectedIndicatorSize() IncreaseIndicatorSizeStepper(); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -162,7 +162,7 @@ public void VerifyIndicatorShape() App.Tap(IndicatorShapeSquareRadioButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(16)] @@ -177,7 +177,7 @@ public void VerifyIndicatorColorWithIndicatorShape() App.Tap(IndicatorShapeSquareRadioButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(17)] @@ -192,7 +192,7 @@ public void VerifySelectedIndicatorColorWithIndicatorShape() App.Tap(IndicatorShapeSquareRadioButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(21)] @@ -206,7 +206,7 @@ public void VerifyIndicatorSizeWithIndicatorShape() App.Tap(IndicatorShapeSquareRadioButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(26)] @@ -221,7 +221,7 @@ public void VerifyIndicatorShapeWithFlowDirection() App.Tap(FlowDirectionRightToLeftRadioButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(27)] @@ -241,7 +241,7 @@ public void VerifyIndicatorShapeWithHideSingle() App.WaitForElement(RemoveItemButton); App.Tap(RemoveItemButton); } - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(28)] @@ -255,7 +255,7 @@ public void VerifyIndicatorShapeWithMaximumVisible() DecreaseMaximumVisibleStepper(); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // Issue Link: https://github.com/dotnet/maui/issues/29812 [Test, Order(30)] @@ -270,7 +270,7 @@ public void VerifyIndicatorShapeWithShadow() App.Tap(ShadowTrueRadioButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif #endif @@ -290,7 +290,7 @@ public void VerifyIndicatorView_HideSingle() App.WaitForElement(RemoveItemButton); App.Tap(RemoveItemButton); } - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(8)] @@ -302,7 +302,7 @@ public void VerifyIndicatorView_MaximumVisible() DecreaseMaximumVisibleStepper(); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(9)] @@ -315,7 +315,7 @@ public void VerifyIndicatorView_FlowDirection() App.Tap(FlowDirectionRightToLeftRadioButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(10)] @@ -328,7 +328,7 @@ public void VerifyIndicatorView_IsVisible() App.Tap(IsVisibleFalseRadioButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // https://github.com/dotnet/maui/issues/29812 @@ -342,7 +342,7 @@ public void VerifyIndicatorView_Shadow() App.Tap(ShadowTrueRadioButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -358,7 +358,7 @@ public void VerifyIndicatorColorWhenItemsAdded() App.Tap(Apply); App.WaitForElement(AddItemButton); App.Tap(AddItemButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(14)] @@ -372,7 +372,7 @@ public void VerifyIndicatorColorWithIndicatorSize() IncreaseIndicatorSizeStepper(); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(15)] @@ -386,7 +386,7 @@ public void VerifySelectedIndicatorColorWithIndicatorSize() IncreaseIndicatorSizeStepper(); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(19)] @@ -401,7 +401,7 @@ public void VerifySelectedIndicatorColorWithFlowDirection() App.Tap(FlowDirectionRightToLeftRadioButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(20)] @@ -416,7 +416,7 @@ public void VerifyIndicatorColorWithFlowDirection() App.Tap(FlowDirectionRightToLeftRadioButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(22)] @@ -435,7 +435,7 @@ public void VerifyIndicatorHideSingleWithIndicatorSize() App.WaitForElement(RemoveItemButton); App.Tap(RemoveItemButton); } - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS && TEST_FAILS_ON_WINDOWS //Issue Link: https://github.com/dotnet/maui/issues/31140 , https://github.com/dotnet/maui/issues/29812 @@ -450,7 +450,7 @@ public void VerifyIndicatorSizeWithShadow() App.Tap(ShadowTrueRadioButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -465,7 +465,7 @@ public void VerifyIndicatorSizeWithFlowDirection() App.Tap(FlowDirectionRightToLeftRadioButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(25)] @@ -478,7 +478,7 @@ public void VerifyIndicatorSizeWithMaximumVisible() DecreaseMaximumVisibleStepper(); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(31)] @@ -493,7 +493,7 @@ public void VerifySelectedIndicatorColorWithIndicatorColor() App.Tap(IndicatorColorGreenButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(32)] @@ -511,7 +511,7 @@ public void VerifyIndicatorHideSingleIsFalse() App.WaitForElement(RemoveItemButton); App.Tap(RemoveItemButton); } - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(33)] @@ -531,7 +531,7 @@ public void VerifyIndicatorHideSingleIsFalseWithSelectedIndicatorColor() App.WaitForElement(RemoveItemButton); App.Tap(RemoveItemButton); } - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST @@ -548,7 +548,7 @@ public void VerifyIndicatorTemplate() App.Tap(IconTemplateButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(35)] @@ -563,7 +563,7 @@ public void VerifyIndicatorTemplateWithFlowDirection() App.Tap(FlowDirectionRightToLeftRadioButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(36)] @@ -577,7 +577,7 @@ public void VerifyIndicatorTemplateWithMaximumVisible() DecreaseMaximumVisibleStepper(); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(37)] @@ -592,7 +592,7 @@ public void VerifyIndicatorTemplateWithShadow() App.Tap(ShadowTrueRadioButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(38)] @@ -607,7 +607,7 @@ public void VerifyIndicatorTemplateWithIsVisible() App.Tap(IsVisibleFalseRadioButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(39)] @@ -622,7 +622,7 @@ public void VerifyIndicatorTemplateWithSelectedIndicatorColor() App.Tap(SelectedIndicatorColorOrangeButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(40)] @@ -637,7 +637,7 @@ public void VerifyIndicatorTemplateWithIndicatorColor() App.Tap(IndicatorColorGreenButton); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/LabelFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/LabelFeatureTests.cs index 483bc97328c3..3bbc6fb84eed 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/LabelFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/LabelFeatureTests.cs @@ -65,7 +65,7 @@ public void VerifyLabelWithFormattedText() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(2)] @@ -81,7 +81,7 @@ public void VerifyLabelWhenFormattedTextWithHorizontalAndVerticalAlignmentStart( App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(3)] @@ -97,7 +97,7 @@ public void VerifyLabelWithFormattedTextWhenHorizontalAndVerticalAlignmentCenter App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(4)] @@ -113,7 +113,7 @@ public void VerifyLabelWithFormattedTextWhenHorizontalAndVerticalAlignmentEnd() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(5)] @@ -129,7 +129,7 @@ public void VerifyLabelWithFormattedTextAndTextTransformLower() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(6)] @@ -145,7 +145,7 @@ public void VerifyLabelWithFormattedTextWhenTextTransformUpper() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(7)] @@ -161,7 +161,7 @@ public void VerifyLabelWithFormattedTextWhenTextColor() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(8)] @@ -182,7 +182,7 @@ public void VerifyLabelWhenFormattedTextWithPadding() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } @@ -200,7 +200,7 @@ public void VerifyLabelWithFormattedTextWhenMaxLines() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS && TEST_FAILS_ON_ANDROID // Issue Link: https://github.com/dotnet/maui/issues/27828 @@ -218,7 +218,7 @@ public void VerifyLabelWithFormattedTextAndLineHeight() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(11)] @@ -234,7 +234,7 @@ public void VerifyLabelWithFormattedTextWhenTextDecorationsUnderLine() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(12)] @@ -250,7 +250,7 @@ public void VerifyLabelWithFormattedTextWhenTextDecorationsStrikethrough() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // Issue Link: https://github.com/dotnet/maui/issues/27828 @@ -268,7 +268,7 @@ public void VerifyLabelWithFormattedTextAndCharacterSpacing() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(14)] @@ -284,7 +284,7 @@ public void VerifyLabelWithFormattedTextWhenFontAttributesBold() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(15)] @@ -300,7 +300,7 @@ public void VerifyLabelWithFormattedTextWhenFontAttributesItalic() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(16)] @@ -316,7 +316,7 @@ public void VerifyLabelWithFormattedTextWhenFontFamilyDokdo() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(17)] @@ -332,7 +332,7 @@ public void VerifyLabelWithFormattedTextWhenFontFamilyMonserratBold() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif #endif @@ -352,7 +352,7 @@ public void VerifyLabelWithFormattedTextWhenFontSize() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -370,7 +370,7 @@ public void VerifyLabelWithFormattedTextAndLineBreakModeCharacterWrap() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(42)] @@ -386,7 +386,7 @@ public void VerifyLabelWithTextAndLineBreakModeCharacterWrap() App.Tap(LineBreakModeCharacterWrap); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -405,7 +405,7 @@ public void VerifyLabelWithFormattedTextWhenLineBreakModeTailTruncation() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(41)] @@ -421,7 +421,7 @@ public void VerifyLabelWithTextAndLineBreakModeTailTruncation() App.Tap(LineBreakModeTailTruncation); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -438,7 +438,7 @@ public void VerifyLabelWithFormattedTextWhenLineBreakModeWordWrap() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(22)] @@ -454,7 +454,7 @@ public void VerifyLabelWithFormattedTextAndLineBreakModeNoWrap() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // Issue Link: https://github.com/dotnet/maui/issues/21294 @@ -471,7 +471,7 @@ public void VerifyLabelWithFormattedTextWhenLineBreakModeHeadTruncation() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(24)] @@ -487,7 +487,7 @@ public void VerifyLabelWithFormattedTextWhenLineBreakModeMiddleTruncation() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -521,7 +521,7 @@ public void VerifyLabelWithTextAndFontSize() App.Tap(Apply); App.WaitForElement(MainLabel); App.Tap(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(27)] @@ -537,7 +537,7 @@ public void VerifyLabelWithTextAndFontColor() App.Tap(TextColorGreen); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(28)] @@ -553,7 +553,7 @@ public void VerifyLabelWithTextAndTextTransform() App.Tap(TextTransformUpper); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(29)] @@ -572,7 +572,7 @@ public void VerifyLabelWithTextAndCharacterSpacing() App.Tap(Apply); App.WaitForElement(MainLabel); App.Tap(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(30)] @@ -588,7 +588,7 @@ public void VerifyLabelWithTextAndTextDecorations() App.Tap(TextDecorationsLine); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(31)] @@ -604,7 +604,7 @@ public void VerifyLabelWithTextAndFontFamily() App.Tap(FontFamilyDokdo); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(32)] @@ -620,7 +620,7 @@ public void VerifyLabelWithTextAndFontAttributes() App.Tap(FontAttributesItalic); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(33)] @@ -638,7 +638,7 @@ public void VerifyLabelWithTextWhenVerticalAndHorizontalAlignmentStart() App.Tap(VerticalTextStart); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(34)] @@ -656,7 +656,7 @@ public void VerifyLabelWithTextWhenVerticalAndHorizontalAlignmentCenter() App.Tap(VerticalTextCenter); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(35)] @@ -674,7 +674,7 @@ public void VerifyLabelWithTextWhenVerticalAndHorizontalAlignmentEnd() App.Tap(VerticalTextEnd); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(36)] @@ -695,7 +695,7 @@ public void VerifyLabelWithTextWhenPaddingApplied() App.EnterText(PaddingEntry, "20,20,20,20"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(37)] @@ -714,7 +714,7 @@ public void VerifyLabelWithTextAndMaxlines() App.Tap(Apply); App.WaitForElement(MainLabel); App.Tap(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(59)] @@ -733,7 +733,7 @@ public void VerifyLabelWithTextWhenLineHeight() App.Tap(Apply); App.WaitForElement(MainLabel); App.Tap(MainLabel); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(38)] @@ -749,7 +749,7 @@ public void VerifyLabelWithTextAndLineBreakModeNoWrap() App.Tap(LineBreakModeNoWrap); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // Issue Link: https://github.com/dotnet/maui/issues/21294 @@ -766,7 +766,7 @@ public void VerifyLabelWithTextAndLineBreakModeHeadTruncation() App.Tap(LineBreakModeHeadTruncation); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(40)] @@ -782,7 +782,7 @@ public void VerifyLabelWithTextAndLineBreakModeMiddleTruncation() App.Tap(LineBreakModeMiddleTruncation); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -801,7 +801,7 @@ public void VerifyLabelWithFontAttributesAndFontFamily() App.Tap(FontAttributesBold); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(46)] @@ -820,7 +820,7 @@ public void VerifyLabelWithFontAttributesAndFontSize() App.EnterText(FontSizeEntry, "24"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(47)] @@ -838,7 +838,7 @@ public void VerifyLabelWithFontAttributesAndTextColor() App.Tap(TextColorRed); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(48)] @@ -856,7 +856,7 @@ public void VerifyLabelWithFontAttributesAndTextTransform() App.Tap(TextTransformLower); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(49)] @@ -874,7 +874,7 @@ public void VerifyLabelWithFontAttributesAndTextDecorations() App.Tap(TextDecorationsStrike); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS // Issue Link: https://github.com/dotnet/maui/issues/20372, https://github.com/dotnet/maui/issues/29672, https://github.com/dotnet/maui/issues/29668 @@ -891,7 +891,7 @@ public void VerifyLabelWithTextAndTextType() App.Tap(TextTypeHtml); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(50)] @@ -909,7 +909,7 @@ public void VerifyLabelWithFontAttributesAndTextType() App.Tap(TextTypeHtml); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(56)] @@ -927,7 +927,7 @@ public void VerifyLabelWithTextTypeAndTextColor() App.Tap(TextColorRed); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(57)] @@ -946,7 +946,7 @@ public void VerifyLabelWithTextTypeAndFontSize() App.EnterText(FontSizeEntry, "24"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(58)] @@ -964,7 +964,7 @@ public void VerifyLabelWithTextTypeAndLineBreakModeNoWrap() App.Tap(LineBreakModeNoWrap); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(43)] @@ -982,7 +982,7 @@ public void VerifyLabelWithTextTypeAndLineBreakModeWordWrap() App.Tap(LineBreakModeWordWrap); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(60)] @@ -1000,7 +1000,7 @@ public void VerifyLabelWithFontFamilyAndTextType() App.Tap(TextTypeHtml); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_ANDROID// Issue Link: https://github.com/dotnet/maui/issues/29672, https://github.com/dotnet/maui/issues/29668, https://github.com/dotnet/maui/issues/22594 @@ -1020,7 +1020,7 @@ public void VerifyLabelWithTextTypeAndLineHeight() App.EnterText(LineHeightEntry, "2"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(68)] @@ -1039,7 +1039,7 @@ public void VerifyLabelWithTextTypeAndCharacterSpacing() App.EnterText(CharacterSpacingEntry, "3"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // Issue Link: https://github.com/dotnet/maui/issues/21294 @@ -1058,7 +1058,7 @@ public void VerifyLabelWithTextTypeAndLineBreakModeCharacterWrap() App.Tap(LineBreakModeCharacterWrap); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif #endif @@ -1079,7 +1079,7 @@ public void VerifyLabelWithFontFamilyAndFontColor() App.Tap(TextColorRed); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(52)] @@ -1098,7 +1098,7 @@ public void VerifyLabelWithFontFamilyAndFontSize() App.EnterText(FontSizeEntry, "22"); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(53)] @@ -1116,7 +1116,7 @@ public void VerifyLabelWithFontFamilyAndTextDecorations() App.Tap(TextDecorationsStrike); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(54)] @@ -1134,7 +1134,7 @@ public void VerifyLabelWithFontFamilyAndTextTransform() App.Tap(TextTransformLower); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(55)] @@ -1152,7 +1152,7 @@ public void VerifyLabelWithTextDecorationsAndTextTransform() App.Tap(TextTransformUpper); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS // Issue Link: https://github.com/dotnet/maui/issues/24298 , https://github.com/dotnet/maui/issues/29673, https://github.com/dotnet/maui/issues/29674 @@ -1171,7 +1171,7 @@ public void VerifyLabelWithTextTypeAndLineBreakModeTailTruncation() App.Tap(LineBreakModeTailTruncation); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(62)] @@ -1189,7 +1189,7 @@ public void VerifyLabelWithTextTypeAndTextDecorations() App.Tap(TextTypeHtml); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // Issue Link: https://github.com/dotnet/maui/issues/21294 @@ -1208,7 +1208,7 @@ public void VerifyLabelWithTextTypeAndLineBreakModeHeadTruncation() App.Tap(LineBreakModeHeadTruncation); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(64)] @@ -1226,7 +1226,7 @@ public void VerifyLabelWithTextTypeAndLineBreakModeMiddleTruncation() App.Tap(LineBreakModeMiddleTruncation); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(65)] @@ -1244,7 +1244,7 @@ public void VerifyLabelWithTextTypeAndTextTransform() App.Tap(TextTypeHtml); App.WaitForElement(Apply); App.Tap(Apply); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif #endif diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/NavigationPageFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/NavigationPageFeatureTests.cs index 98e419010c79..37b099c1db06 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/NavigationPageFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/NavigationPageFeatureTests.cs @@ -133,7 +133,7 @@ public void BackButtonTitle_AppliesOnNextPage_Visual() App.WaitForElement("PushPageButton"); App.Tap("PushPageButton"); // Validate visually on page 2 (back button title) - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif #endif @@ -284,7 +284,7 @@ public void TitleIcon_Add_Visual() App.WaitForElement("TitleIconButton"); App.Tap("TitleIconButton"); // Screenshot: Title icon applied on current page - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_ANDROID //Issue Link: https://github.com/dotnet/maui/issues/31445 @@ -300,7 +300,7 @@ public void TitleIcon_AddingTwice_DoesNotDuplicate() App.Tap("TitleIconButton"); App.WaitForElement("TitleIconButton"); App.Tap("TitleIconButton"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -320,7 +320,7 @@ public void Combine_BarBackgroundColor_TextColor_IconColor_Visual() App.WaitForElement("PushPageButton"); App.Tap("PushPageButton"); // Screenshot: Combined bar background, text color and icon color on pushed page - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(14)] @@ -346,7 +346,7 @@ public void TitleIcon_And_TitleView_Persist_On_Push_Then_Clear() App.WaitForElement("PushPageButton"); App.Tap("PushPageButton"); // Screenshot: Title icon and custom title view present on pushed page - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(15)] diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/PickerFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/PickerFeatureTests.cs index 4992e8641ea4..c3e80d443eda 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/PickerFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/PickerFeatureTests.cs @@ -19,7 +19,7 @@ public void VerifyPickerScreenshot() #if WINDOWS VerifyScreenshot(cropTop: 100); #else - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #endif } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ProgressBarFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ProgressBarFeatureTests.cs index 508f8c7e9153..140362118ac1 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ProgressBarFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ProgressBarFeatureTests.cs @@ -50,7 +50,7 @@ public void ProgressBar_ProgressToMethod_VerifyVisualState() App.WaitForElement("ProgressToButton"); App.Tap("ProgressToButton"); Task.Delay(1000).Wait(); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -64,7 +64,7 @@ public void ProgressBar_SetProgressOutOfRange() App.EnterText("ProgressEntry", "1.44"); App.PressEnter(); App.WaitForElement("ProgressBarControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -78,7 +78,7 @@ public void ProgressBar_SetProgressNegativeValue() App.EnterText("ProgressEntry", "-0.44"); App.PressEnter(); App.WaitForElement("ProgressBarControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -96,7 +96,7 @@ public void ProgressBar_SetProgressColorAndBackgroundColor_VerifyVisualState() App.WaitForElement("BackgroundColorLightBlueButton"); App.Tap("BackgroundColorLightBlueButton"); App.WaitForElement("ProgressBarControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -108,7 +108,7 @@ public void ProgressBar_SetIsVisibleFalse_VerifyLabel() App.WaitForElement("IsVisibleFalseRadio"); App.Tap("IsVisibleFalseRadio"); App.WaitForNoElement("ProgressBarControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -120,7 +120,7 @@ public void ProgressBar_ChangeFlowDirection_RTL_VerifyLabel() App.WaitForElement("FlowDirectionRTL"); App.Tap("FlowDirectionRTL"); App.WaitForElement("ProgressBarControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -132,7 +132,7 @@ public void ProgressBar_ToggleShadow_VerifyVisualState() App.WaitForElement("ShadowTrueRadio"); App.Tap("ShadowTrueRadio"); App.WaitForElement("ProgressBarControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/RadioButtonFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/RadioButtonFeatureTests.cs index 9bd4c72f047c..68a64f622745 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/RadioButtonFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/RadioButtonFeatureTests.cs @@ -20,7 +20,7 @@ public RadioButtonFeatureTests(TestDevice device) public void RadioButton_Checking_Default_Configuration_VerifyVisualState() { App.WaitForElement("RadioButtonControlOne"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(2)] @@ -35,7 +35,7 @@ public void RadioButton_Checking_Initial_Configuration_VerifyVisualState() App.Tap("RadioButtonControlFour"); App.WaitForElement("SelectedValueLabelTwo"); Assert.That(App.WaitForElement("SelectedValueLabelTwo").GetText(), Is.EqualTo("All Notifications")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_ANDROID // This test fails on Windows and Android because the RadioButton control does not update the BorderColor at runtime. Issue Link - https://github.com/dotnet/maui/issues/15806 @@ -56,7 +56,7 @@ public void RadioButton_SetTextColorAndBorderColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("RadioButtonControlOne"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -73,7 +73,7 @@ public void RadioButton_SetFontAttributesAndTextColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("RadioButtonControlOne"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -91,7 +91,7 @@ public void RadioButton_SetFontFamilyAndFontSize_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("RadioButtonControlOne"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_ANDROID // This test fails on Windows and Android because the RadioButton control does not update the BorderColor at runtime. Issue Link - https://github.com/dotnet/maui/issues/15806 @@ -114,7 +114,7 @@ public void RadioButton_SetBorderWidthAndCornerRadius_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("RadioButtonControlOne"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -132,7 +132,7 @@ public void RadioButton_SetFontFamilyAndTextTransform_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("RadioButtonControlOne"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -148,7 +148,7 @@ public void RadioButton_SetContentWithView() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("RadioButtonControlOne"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -167,7 +167,7 @@ public void RadioButton_SetContentAndTextColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("RadioButtonControlOne"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // This test fails on Windows because the character spacing is not applied correctly. @@ -188,7 +188,7 @@ public void RadioButton_SetContentAndCharacterSpacing_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("RadioButtonControlOne"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -211,7 +211,7 @@ public void RadioButton_SetContentAndFontSize_VerifyVisualState() App.WaitForElementTillPageNavigationSettled("RadioButtonControlOne"); App.WaitForElement("SelectedValueLabelOne"); App.Tap("SelectedValueLabelOne"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -229,7 +229,7 @@ public void RadioButton_SetContentAndFontAttributes_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("RadioButtonControlOne"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWS // This test fails on Android and Windows because the text transform is not applied correctly. Issue Link - https://github.com/dotnet/maui/issues/29729 @@ -247,7 +247,7 @@ public void RadioButton_SetContentAndTextTransform() App.Tap("TextTransformUpper"); App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -264,7 +264,7 @@ public void RadioButton_SetFontFamilyAndFontAttributes_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("RadioButtonControlOne"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -282,7 +282,7 @@ public void RadioButton_SetFontSizeAndFontAttributes_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("RadioButtonControlOne"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -348,7 +348,7 @@ public void RadioButton_FlowDirectionAndContent_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("RadioButtonControlOne"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/RefreshViewFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/RefreshViewFeatureTests.cs index c79986ccd5bd..497ecb526464 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/RefreshViewFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/RefreshViewFeatureTests.cs @@ -196,7 +196,7 @@ public void RefreshView_SetShadow_VerifyShadowApplied() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElement("RefreshView"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(13)] @@ -212,7 +212,7 @@ public void RefreshView_SetShadowWithCollectionView_VerifyShadowApplied() App.WaitForElement("RefreshView"); App.WaitForElement("CollectionViewContentButton"); App.Tap("CollectionViewContentButton"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollViewFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollViewFeatureTests.cs index 3c9aa9818832..dd3018cc2df0 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollViewFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollViewFeatureTests.cs @@ -47,7 +47,7 @@ public void VerifyScrollViewWithScrollToPositionEnd() App.WaitForElement(ScrollToEndPosition); App.Tap(ScrollToEndPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(2)] @@ -57,7 +57,7 @@ public void VerifyScrollViewWithScrollToPositionStart() App.WaitForElement(ScrollToStartPosition); App.Tap(ScrollToStartPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(3)] @@ -67,7 +67,7 @@ public void VerifyScrollViewWithScrollToPositionCenter() App.WaitForElement(ScrollToCenterPosition); App.Tap(ScrollToCenterPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(4)] @@ -77,7 +77,7 @@ public void VerifyScrollViewWithScrollToPositionMakeVisible() App.WaitForElement(ScrollToMakeVisiblePosition); App.Tap(ScrollToMakeVisiblePosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // Issue Link: https://github.com/dotnet/maui/issues/29805 @@ -94,7 +94,7 @@ public void VerifyScrollViewWithScrollToPositionEndAndEditorContent() App.WaitForElement(ScrollToEndPosition); App.Tap(ScrollToEndPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(10)] @@ -110,7 +110,7 @@ public void VerifyScrollViewWithScrollToPositionStartAndEditorContent() App.WaitForElement(ScrollToStartPosition); App.Tap(ScrollToStartPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(11)] @@ -126,7 +126,7 @@ public void VerifyScrollViewWithScrollToPositionCenterAndEditorContent() App.WaitForElement(ScrollToCenterPosition); App.Tap(ScrollToCenterPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(12)] @@ -142,7 +142,7 @@ public void VerifyScrollViewWithScrollToPositionMakeVisibleAndEditorContent() App.WaitForElement(ScrollToMakeVisiblePosition); App.Tap(ScrollToMakeVisiblePosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -159,7 +159,7 @@ public void VerifyScrollViewWithScrollToPositionEndAndImageContent() App.WaitForElement(ScrollToEndPosition); App.Tap(ScrollToEndPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(14)] @@ -175,7 +175,7 @@ public void VerifyScrollViewWithScrollToPositionStartAndImageContent() App.WaitForElement(ScrollToStartPosition); App.Tap(ScrollToStartPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(15)] @@ -191,7 +191,7 @@ public void VerifyScrollViewWithScrollToPositionCenterAndImageContent() App.WaitForElement(ScrollToCenterPosition); App.Tap(ScrollToCenterPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(16)] @@ -207,7 +207,7 @@ public void VerifyScrollViewWithScrollToPositionMakeVisibleAndImageContent() App.WaitForElement(ScrollToMakeVisiblePosition); App.Tap(ScrollToMakeVisiblePosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(17)] @@ -223,7 +223,8 @@ public void VerifyScrollViewWithScrollToPositionEndAndGridContent() App.WaitForElement(ScrollToEndPosition); App.Tap(ScrollToEndPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + // Use retryTimeout to allow scroll animation to settle + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(18)] @@ -239,7 +240,8 @@ public void VerifyScrollViewWithScrollToPositionStartAndGridContent() App.WaitForElement(ScrollToStartPosition); App.Tap(ScrollToStartPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + // Use retryTimeout to allow scroll animation to settle + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(19)] @@ -255,7 +257,8 @@ public void VerifyScrollViewWithScrollToPositionCenterAndGridContent() App.WaitForElement(ScrollToCenterPosition); App.Tap(ScrollToCenterPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + // Use retryTimeout to allow scroll animation to settle + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(20)] @@ -271,7 +274,8 @@ public void VerifyScrollViewWithScrollToPositionMakeVisibleAndGridContent() App.WaitForElement(ScrollToMakeVisiblePosition); App.Tap(ScrollToMakeVisiblePosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + // Use retryTimeout to allow scroll animation to settle + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(21)] @@ -287,7 +291,7 @@ public void VerifyScrollViewWithScrollToPositionEndAndAbsoluteLayoutContent() App.WaitForElement(ScrollToEndPosition); App.Tap(ScrollToEndPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(22)] @@ -303,7 +307,7 @@ public void VerifyScrollViewWithScrollToPositionStartAndAbsoluteLayoutContent() App.WaitForElement(ScrollToStartPosition); App.Tap(ScrollToStartPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(23)] @@ -319,7 +323,7 @@ public void VerifyScrollViewWithScrollToPositionCenterAndAbsoluteLayoutContent() App.WaitForElement(ScrollToCenterPosition); App.Tap(ScrollToCenterPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(24)] @@ -335,7 +339,7 @@ public void VerifyScrollViewWithScrollToPositionMakeVisibleAndAbsoluteContent() App.WaitForElement(ScrollToMakeVisiblePosition); App.Tap(ScrollToMakeVisiblePosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(25)] @@ -351,7 +355,7 @@ public void VerifyScrollViewWithScrollToPositionEndAndVerticalLayoutContent() App.WaitForElement(ScrollToEndPosition); App.Tap(ScrollToEndPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(26)] @@ -367,7 +371,7 @@ public void VerifyScrollViewWithScrollToPositionStartAndVerticalLayoutContent() App.WaitForElement(ScrollToStartPosition); App.Tap(ScrollToStartPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(27)] @@ -383,7 +387,7 @@ public void VerifyScrollViewWithScrollToPositionCenterAndVerticalLayoutContent() App.WaitForElement(ScrollToCenterPosition); App.Tap(ScrollToCenterPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(28)] @@ -399,7 +403,7 @@ public void VerifyScrollViewWithScrollToPositionMakeVisibleAndVerticalLayoutCont App.WaitForElement(ScrollToMakeVisiblePosition); App.Tap(ScrollToMakeVisiblePosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS // Issue Link: https://github.com/dotnet/maui/issues/30070 @@ -417,7 +421,7 @@ public void VerifyScrollViewWithScrollToPositionEndAndOrientationHorizontal() App.WaitForElement(ScrollToEndPosition); App.Tap(ScrollToEndPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(6)] @@ -433,7 +437,7 @@ public void VerifyScrollViewWithScrollToPositionStartAndOrientationHorizontal() App.WaitForElement(ScrollToStartPosition); App.Tap(ScrollToStartPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(7)] @@ -449,7 +453,7 @@ public void VerifyScrollViewWithScrollToPositionCenterAndOrientationHorizontal() App.WaitForElement(ScrollToCenterPosition); App.Tap(ScrollToCenterPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(8)] @@ -465,7 +469,7 @@ public void VerifyScrollViewWithScrollToPositionMakeVisibleAndOrientationHorizon App.WaitForElement(ScrollToMakeVisiblePosition); App.Tap(ScrollToMakeVisiblePosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(33)] @@ -483,7 +487,7 @@ public void VerifyScrollViewWithScrollToPositionEndAndImageContentWhenOrientatio App.WaitForElement(ScrollToEndPosition); App.Tap(ScrollToEndPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(34)] @@ -501,7 +505,7 @@ public void VerifyScrollViewWithScrollToPositionStartAndImageContentWhenOrientat App.WaitForElement(ScrollToStartPosition); App.Tap(ScrollToStartPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(35)] @@ -519,7 +523,7 @@ public void VerifyScrollViewWithScrollToPositionCenterAndImageContentWhenOrienta App.WaitForElement(ScrollToCenterPosition); App.Tap(ScrollToCenterPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(36)] @@ -537,7 +541,7 @@ public void VerifyScrollViewWithScrollToPositionMakeVisibleAndImageContentWhenOr App.WaitForElement(ScrollToMakeVisiblePosition); App.Tap(ScrollToMakeVisiblePosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(37)] @@ -555,7 +559,7 @@ public void VerifyScrollViewWithScrollToPositionEndAndGridContentWhenOrientation App.WaitForElement(ScrollToEndPosition); App.Tap(ScrollToEndPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(38)] @@ -573,7 +577,7 @@ public void VerifyScrollViewWithScrollToPositionStartAndGridContentWhenOrientati App.WaitForElement(ScrollToStartPosition); App.Tap(ScrollToStartPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(39)] @@ -591,7 +595,7 @@ public void VerifyScrollViewWithScrollToPositionCenterAndGridContentWhenOrientat App.WaitForElement(ScrollToCenterPosition); App.Tap(ScrollToCenterPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(40)] @@ -609,7 +613,7 @@ public void VerifyScrollViewWithScrollToPositionMakeVisibleAndGridContentWhenOri App.WaitForElement(ScrollToMakeVisiblePosition); App.Tap(ScrollToMakeVisiblePosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(41)] @@ -627,7 +631,7 @@ public void VerifyScrollViewWithScrollToPositionEndAndAbsoluteLayoutContentWhenO App.WaitForElement(ScrollToEndPosition); App.Tap(ScrollToEndPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(42)] @@ -645,7 +649,7 @@ public void VerifyScrollViewWithScrollToPositionStartAndAbsoluteLayoutContentWhe App.WaitForElement(ScrollToStartPosition); App.Tap(ScrollToStartPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(43)] @@ -663,7 +667,7 @@ public void VerifyScrollViewWithScrollToPositionCenterAndAbsoluteLayoutContentWh App.WaitForElement(ScrollToCenterPosition); App.Tap(ScrollToCenterPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(44)] @@ -681,7 +685,7 @@ public void VerifyScrollViewWithScrollToPositionMakeVisibleAndAbsoluteContentWhe App.WaitForElement(ScrollToMakeVisiblePosition); App.Tap(ScrollToMakeVisiblePosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(45)] @@ -699,7 +703,7 @@ public void VerifyScrollViewWithScrollToPositionEndAndHorizontalLayoutContentWhe App.WaitForElement(ScrollToEndPosition); App.Tap(ScrollToEndPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(46)] @@ -717,7 +721,7 @@ public void VerifyScrollViewWithScrollToPositionStartAndHorizontalLayoutContentW App.WaitForElement(ScrollToStartPosition); App.Tap(ScrollToStartPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(47)] @@ -735,7 +739,7 @@ public void VerifyScrollViewWithScrollToPositionCenterAndHorizontalLayoutContent App.WaitForElement(ScrollToCenterPosition); App.Tap(ScrollToCenterPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(48)] @@ -753,7 +757,7 @@ public void VerifyScrollViewWithScrollToPositionMakeVisibleAndHorizontalLayoutCo App.WaitForElement(ScrollToMakeVisiblePosition); App.Tap(ScrollToMakeVisiblePosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // Issue Link: https://github.com/dotnet/maui/issues/29805 @@ -772,7 +776,7 @@ public void VerifyScrollViewWithScrollToPositionEndAndEditorContentWhenOrientati App.WaitForElement(ScrollToEndPosition); App.Tap(ScrollToEndPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(30)] @@ -790,7 +794,7 @@ public void VerifyScrollViewWithScrollToPositionStartAndEditorContentWhenOrienta App.WaitForElement(ScrollToStartPosition); App.Tap(ScrollToStartPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(31)] @@ -808,7 +812,7 @@ public void VerifyScrollViewWithScrollToPositionCenterAndEditorContentWhenOrient App.WaitForElement(ScrollToCenterPosition); App.Tap(ScrollToCenterPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(32)] @@ -826,7 +830,7 @@ public void VerifyScrollViewWithScrollToPositionMakeVisibleAndEditorContentWhenO App.WaitForElement(ScrollToMakeVisiblePosition); App.Tap(ScrollToMakeVisiblePosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif #endif @@ -953,7 +957,7 @@ public void VerifyScrollViewWithVerticalScrollBarVisibilityAlways() App.WaitForElement(ScrollToCenterPosition); App.Tap(ScrollToCenterPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -971,7 +975,7 @@ public void VerifyScrollViewWithHorizontalScrollBarVisibilityAlways() App.WaitForElement(ScrollToStartPosition); App.Tap(ScrollToStartPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -990,7 +994,7 @@ public void VerifyScrollViewWithVerticalScrollBarVisibilityNever() App.WaitForElement(ScrollToStartPosition); App.Tap(ScrollToStartPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -1008,7 +1012,7 @@ public void VerifyScrollViewWithHorizontalScrollBarVisibilityNever() App.WaitForElement(ScrollToStartPosition); App.Tap(ScrollToStartPosition); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWS // Issue Link for Android : https://github.com/dotnet/maui/issues/13634 and Windows: https://github.com/dotnet/maui/issues/29805 @@ -1075,7 +1079,7 @@ public void VerifyScrollViewWithRTL() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -1093,7 +1097,8 @@ public void VerifyScrollViewWithRTLAndGridContent() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + // Use retryTimeout to allow layout/RTL changes to settle + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -1111,7 +1116,7 @@ public void VerifyScrollViewWithRTLAndImageContent() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -1129,7 +1134,7 @@ public void VerifyScrollViewWithRTLAndAbsoluteLayout() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // Issue Link: https://github.com/dotnet/maui/issues/29805 @@ -1148,7 +1153,7 @@ public void VerifyScrollViewWithRTLAndEditor() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif #endif @@ -1171,7 +1176,7 @@ public void VerifyScrollViewWithRTLWhenOrientationBoth() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -1191,7 +1196,7 @@ public void VerifyScrollViewWithRTLWhenHorizontalOrientation() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -1211,7 +1216,7 @@ public void VerifyScrollViewWithRTLWhenHorizontalOrientationAndImageContent() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -1231,7 +1236,7 @@ public void VerifyScrollViewWithRTLWhenHorizontalOrientationAndGridContent() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -1251,7 +1256,7 @@ public void VerifyScrollViewWithRTLWhenHorizontalOrientationAndHorizontalLayoutC App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -1271,7 +1276,7 @@ public void VerifyScrollViewWithRTLWhenHorizontalOrientationLAndAbsoluteLayout() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // Issue Link: https://github.com/dotnet/maui/issues/29805 @@ -1292,7 +1297,7 @@ public void VerifyScrollViewWithRTLWhenHorizontalOrientationAndContentEditor() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElement("ScrollViewControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif #endif diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollViewWithLayoutOptionsFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollViewWithLayoutOptionsFeatureTests.cs index f119a98b9503..dd5830d6ff26 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollViewWithLayoutOptionsFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollViewWithLayoutOptionsFeatureTests.cs @@ -46,7 +46,7 @@ public void VerifyLayoutWithOrientationVertical_HorizontalOptionsStart() App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(2)] @@ -61,7 +61,7 @@ public void VerifyLayoutWithOrientationVertical_HorizontalOptionsFill() App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(3)] @@ -76,7 +76,7 @@ public void VerifyLayoutWithOrientationVertical_HorizontalOptionsCenter() App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(4)] @@ -91,7 +91,7 @@ public void VerifyLayoutWithOrientationVertical_HorizontalOptionsEnd() App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(5)] @@ -108,7 +108,7 @@ public void VerifyLayoutWithOrientationVertical_HorizontalOptionsStartWithWidthR App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(6)] @@ -125,7 +125,7 @@ public void VerifyLayoutWithOrientationVertical_HorizontalOptionsFillWithWidthRe App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(7)] @@ -142,7 +142,7 @@ public void VerifyLayoutWithOrientationVertical_HorizontalOptionsCenterWithWidth App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(8)] @@ -159,7 +159,7 @@ public void VerifyLayoutWithOrientationVertical_HorizontalOptionsEndWithWidthReq App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(9)] @@ -174,7 +174,7 @@ public void VerifyLayoutWithOrientationVertical_VerticalOptionsStart() App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(10)] @@ -189,7 +189,7 @@ public void VerifyLayoutWithOrientationVertical_VerticalOptionsFill() App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(11)] @@ -204,7 +204,7 @@ public void VerifyLayoutWithOrientationVertical_VerticalOptionsCenter() App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(12)] @@ -219,7 +219,7 @@ public void VerifyLayoutWithOrientationVertical_VerticalOptionsEnd() App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(13)] @@ -236,7 +236,7 @@ public void VerifyLayoutWithOrientationVertical_VerticalOptionsStartWithHeightRe App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(14)] @@ -253,7 +253,7 @@ public void VerifyLayoutWithOrientationVertical_VerticalOptionsFillWithHeightReq App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(15)] @@ -270,7 +270,7 @@ public void VerifyLayoutWithOrientationVertical_VerticalOptionsCenterWithHeightR App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(16)] @@ -287,7 +287,7 @@ public void VerifyLayoutWithOrientationVertical_VerticalOptionsEndWithHeightRequ App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(17)] @@ -304,7 +304,7 @@ public void VerifyLayoutWithOrientationHorizontal_HorizontalOptionsStart() App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(18)] @@ -321,7 +321,7 @@ public void VerifyLayoutWithOrientationHorizontal_HorizontalOptionsFill() App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(19)] @@ -338,7 +338,7 @@ public void VerifyLayoutWithOrientationHorizontal_HorizontalOptionsCenter() App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(20)] @@ -355,7 +355,7 @@ public void VerifyLayoutWithOrientationHorizontal_HorizontalOptionsEnd() App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(21)] @@ -374,7 +374,7 @@ public void VerifyLayoutWithOrientationHorizontal_HorizontalOptionsStartWithWidt App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(22)] @@ -393,7 +393,7 @@ public void VerifyLayoutWithOrientationHorizontal_HorizontalOptionsFillWithWidth App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(23)] @@ -412,7 +412,7 @@ public void VerifyLayoutWithOrientationHorizontal_HorizontalOptionsCenterWithWid App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(24)] @@ -431,7 +431,7 @@ public void VerifyLayoutWithOrientationHorizontal_HorizontalOptionsEndWithWidthR App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(25)] @@ -448,7 +448,7 @@ public void VerifyLayoutWithOrientationHorizontal_VerticalOptionsStart() App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(26)] @@ -465,7 +465,7 @@ public void VerifyLayoutWithOrientationHorizontal_VerticalOptionsFill() App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(27)] @@ -482,7 +482,7 @@ public void VerifyLayoutWithOrientationHorizontal_VerticalOptionsCenter() App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(28)] @@ -499,7 +499,7 @@ public void VerifyLayoutWithOrientationHorizontal_VerticalOptionsEnd() App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(29)] @@ -518,7 +518,7 @@ public void VerifyLayoutWithOrientationHorizontal_VerticalOptionsStartWithHeight App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(30)] @@ -537,7 +537,7 @@ public void VerifyLayoutWithOrientationHorizontal_VerticalOptionsFillWithHeightR App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(31)] @@ -556,7 +556,7 @@ public void VerifyLayoutWithOrientationHorizontal_VerticalOptionsCenterWithHeigh App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(32)] @@ -575,7 +575,7 @@ public void VerifyLayoutWithOrientationHorizontal_VerticalOptionsEndWithHeightRe App.Tap(Apply); App.WaitForElement(StackLayoutButton); App.Tap(StackLayoutButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(33)] @@ -590,7 +590,7 @@ public void VerifyGridLayout_HorizontalOptionsStart() App.Tap(Apply); App.WaitForElement(GridButton); App.Tap(GridButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(34)] @@ -605,7 +605,7 @@ public void VerifyGridLayout_HorizontalOptionsCenter() App.Tap(Apply); App.WaitForElement(GridButton); App.Tap(GridButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(35)] @@ -620,7 +620,7 @@ public void VerifyGridLayout_HorizontalOptionsEnd() App.Tap(Apply); App.WaitForElement(GridButton); App.Tap(GridButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(36)] @@ -635,7 +635,7 @@ public void VerifyGridLayout_HorizontalOptionsFill() App.Tap(Apply); App.WaitForElement(GridButton); App.Tap(GridButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(37)] @@ -650,7 +650,7 @@ public void VerifyGridLayout_VerticalOptionsStart() App.Tap(Apply); App.WaitForElement(GridButton); App.Tap(GridButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(38)] @@ -665,7 +665,7 @@ public void VerifyGridLayout_VerticalOptionsCenter() App.Tap(Apply); App.WaitForElement(GridButton); App.Tap(GridButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(39)] @@ -680,7 +680,7 @@ public void VerifyGridLayout_VerticalOptionsEnd() App.Tap(Apply); App.WaitForElement(GridButton); App.Tap(GridButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(40)] @@ -695,7 +695,7 @@ public void VerifyGridLayout_VerticalOptionsFill() App.Tap(Apply); App.WaitForElement(GridButton); App.Tap(GridButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(41)] @@ -712,7 +712,7 @@ public void VerifyGridLayout_HorizontalOptionsStartWithWidthRequest() App.Tap(Apply); App.WaitForElement(GridButton); App.Tap(GridButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(42)] @@ -729,7 +729,7 @@ public void VerifyGridLayout_HorizontalOptionsCenterWithWidthRequest() App.Tap(Apply); App.WaitForElement(GridButton); App.Tap(GridButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(43)] @@ -746,7 +746,7 @@ public void VerifyGridLayout_HorizontalOptionsEndWithWidthRequest() App.Tap(Apply); App.WaitForElement(GridButton); App.Tap(GridButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(44)] @@ -763,7 +763,7 @@ public void VerifyGridLayout_HorizontalOptionsFillWithWidthRequest() App.Tap(Apply); App.WaitForElement(GridButton); App.Tap(GridButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(45)] @@ -780,7 +780,7 @@ public void VerifyGridLayout_VerticalOptionsStartWithHeightRequest() App.Tap(Apply); App.WaitForElement(GridButton); App.Tap(GridButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(46)] @@ -797,7 +797,7 @@ public void VerifyGridLayout_VerticalOptionsCenterWithHeightRequest() App.Tap(Apply); App.WaitForElement(GridButton); App.Tap(GridButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(47)] @@ -814,7 +814,7 @@ public void VerifyGridLayout_VerticalOptionsEndWithHeightRequest() App.Tap(Apply); App.WaitForElement(GridButton); App.Tap(GridButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(48)] @@ -831,6 +831,6 @@ public void VerifyGridLayout_VerticalOptionsFillWithHeightRequest() App.Tap(Apply); App.WaitForElement(GridButton); App.Tap(GridButton); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollView_DynamicFlexWithChildrenFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollView_DynamicFlexWithChildrenFeatureTests.cs index cfcfd56837d1..72ff4b02e6af 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollView_DynamicFlexWithChildrenFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollView_DynamicFlexWithChildrenFeatureTests.cs @@ -83,7 +83,7 @@ public void VerifyFlexWithResizesCorrectly_AfterAddingAndRemovingWithRowDirectio { App.Tap("RemoveButton"); } - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(6)] @@ -105,7 +105,7 @@ public void VerifyFlexWithResizesCorrectly_AfterAddingAndRemovingWithColumnDirec { App.Tap("RemoveButton"); } - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollView_DynamicGridWithChildrenFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollView_DynamicGridWithChildrenFeatureTests.cs index 7c2bc6812099..1e4caec46f1e 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollView_DynamicGridWithChildrenFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollView_DynamicGridWithChildrenFeatureTests.cs @@ -84,7 +84,7 @@ public void VerifyGridWithResizesCorrectly_AfterAddingAndRemovingChildrenWithRow { App.Tap("RemoveButton"); } - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(6)] @@ -106,7 +106,7 @@ public void VerifyGridWithResizesCorrectly_AfterAddingAndRemovingChildrenWithCol { App.Tap("RemoveButton"); } - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollView_DynamicStackWithChildrenFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollView_DynamicStackWithChildrenFeatureTests.cs index 4fd9f1a6e886..2c88e2e10ab7 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollView_DynamicStackWithChildrenFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollView_DynamicStackWithChildrenFeatureTests.cs @@ -83,7 +83,7 @@ public void VerifyVerticalStackLayoutResizesCorrectly_AfterAddingAndRemovingChil { App.Tap("RemoveButton"); } - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(6)] @@ -105,7 +105,7 @@ public void VerifyHorizontalStackLayoutResizesCorrectly_AfterAddingAndRemovingCh { App.Tap("RemoveButton"); } - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/SearchBarFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/SearchBarFeatureTests.cs index 7e5a36fd8577..f92f011e9225 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/SearchBarFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/SearchBarFeatureTests.cs @@ -19,7 +19,7 @@ public void VerifyScreenshotWithPlatformCropping() #if IOS VerifyScreenshot(cropBottom: 1200); #else - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #endif } @@ -28,7 +28,7 @@ public void VerifyScreenshotWithPlatformCropping() public void SearchBar_InitialState_VerifyVisualState() { App.WaitForElement("SearchBar"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWS // Issue Link - https://github.com/dotnet/maui/issues/14061 diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ShadowFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ShadowFeatureTests.cs index 3f3d570a3200..486a7909d37a 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ShadowFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ShadowFeatureTests.cs @@ -25,7 +25,7 @@ public void Shadow_SetColor() App.EnterText("ColorEntry", "#00FF00"); App.WaitForElement("LabelShadow").Tap(); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(2)] @@ -71,7 +71,7 @@ public void Shadow_SetOffset_PositiveValues() Assert.That(App.FindElement("OffsetYEntry").GetText(), Is.EqualTo("20")); App.WaitForElement("LabelShadow").Tap(); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(4)] @@ -90,7 +90,7 @@ public void Shadow_SetOffset_Zero() Assert.That(App.FindElement("OffsetYEntry").GetText(), Is.EqualTo("0")); App.WaitForElement("LabelShadow").Tap(); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(5)] @@ -105,7 +105,7 @@ public void Shadow_SetRadius() Assert.That(App.FindElement("RadiusEntry").GetText(), Is.EqualTo("20")); App.WaitForElement("LabelShadow").Tap(); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(6)] @@ -120,7 +120,7 @@ public void Shadow_SetRadius_Zero() Assert.That(App.FindElement("RadiusEntry").GetText(), Is.EqualTo("0")); App.WaitForElement("LabelShadow").Tap(); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -135,7 +135,7 @@ public void Shadow_SetOpacity() Assert.That(App.FindElement("OpacityEntry").GetText(), Is.EqualTo("1")); App.WaitForElement("LabelShadow").Tap(); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(7)] @@ -150,7 +150,7 @@ public void Shadow_SetOpacity_Zero() Assert.That(App.FindElement("OpacityEntry").GetText(), Is.EqualTo("0")); App.WaitForElement("LabelShadow").Tap(); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(7)] @@ -160,7 +160,7 @@ public void Shadow_SetEnabledStateToFalse_VerifyScreenshot() App.WaitForElement("ResetButton").Tap(); App.WaitForElement("IsEnabledFalseRadio"); App.Tap("IsEnabledFalseRadio"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(8)] @@ -170,7 +170,7 @@ public void Shadow_ChangeFlowDirection_RTL_VerifyScreenshot() App.WaitForElement("ResetButton").Tap(); App.WaitForElement("FlowDirectionRTL"); App.Tap("FlowDirectionRTL"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(9)] @@ -180,7 +180,7 @@ public void Shadow_SetVisibilityToFalse_VerifyScreenshot() App.WaitForElement("ResetButton").Tap(); App.WaitForElement("IsVisibleFalseRadio"); App.Tap("IsVisibleFalseRadio"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if !WINDOWS // Shadow not updated when Clipping a View: https://github.com/dotnet/maui/issues/27730 @@ -191,7 +191,7 @@ public void Shadow_AddClip_VerifyShadow() App.WaitForElement("ResetButton").Tap(); App.WaitForElement("ClipButton"); App.Tap("ClipButton"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(11)] @@ -223,7 +223,7 @@ public void Shadow_Remove_AtRuntime() App.WaitForElement("ResetButton").Tap(); App.WaitForElement("ShadowButton"); App.Tap("ShadowButton"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ShapesFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ShapesFeatureTests.cs index 6b386fa22735..09f4cec1f931 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ShapesFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ShapesFeatureTests.cs @@ -20,7 +20,7 @@ public void VerifyShapeScreenshot() #if WINDOWS VerifyScreenshot(cropTop: 100); #else - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #endif } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/SliderFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/SliderFeatureTests.cs index edaae9a1d4da..5ef4774b6539 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/SliderFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/SliderFeatureTests.cs @@ -269,7 +269,7 @@ public void Slider_SetEnabledStateToFalse_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -283,7 +283,7 @@ public void Slider_ChangeFlowDirection_RTL_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -297,7 +297,7 @@ public void Slider_SetVisibilityToFalse_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("Options"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -311,7 +311,7 @@ public void Slider_ChangeThumbColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -325,7 +325,7 @@ public void Slider_ChangeMinTrackColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -339,7 +339,7 @@ public void Slider_ChangeMaxTrackColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -353,7 +353,7 @@ public void Slider_ChangeBackgroundColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -367,7 +367,7 @@ public void Slider_ChangeThumbImageSource_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -383,7 +383,7 @@ public void Slider_SetMinimumAndChangeFlowDirection_RTL() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -399,7 +399,7 @@ public void Slider_SetMaximumAndChangeFlowDirection_RTL() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -415,7 +415,7 @@ public void Slider_SetValueAndMinTrackColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -431,7 +431,7 @@ public void Slider_SetValueAndMaxTrackColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -447,7 +447,7 @@ public void Slider_SetValueAndThumbImageSource_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -463,7 +463,7 @@ public void Slider_SetValueAndFlowDirection_RTL_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -478,7 +478,7 @@ public void Slider_SetThumbAndMaxTrackColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -493,7 +493,7 @@ public void Slider_SetThumbAndMinTrackColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -508,7 +508,7 @@ public void Slider_SetThumbAndBackgroundColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -523,7 +523,7 @@ public void Slider_SetThumbColorAndThumbImageSource_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -539,7 +539,7 @@ public void Slider_SetMinTrackColorAndValue_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -554,7 +554,7 @@ public void Slider_SetMinTrackAndThumbColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -569,7 +569,7 @@ public void Slider_SetMinTrackAndMaxTrackColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -584,7 +584,7 @@ public void Slider_SetMinTrackAndBackgroundColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -599,7 +599,7 @@ public void Slider_SetMinTrackColorTestFlowDirection_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -615,7 +615,7 @@ public void Slider_SetMaxTrackColorAndValue_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -630,7 +630,7 @@ public void Slider_SetMaxTrackAndThumbColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -645,7 +645,7 @@ public void Slider_SetMaxTrackAndMinTrackColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -660,7 +660,7 @@ public void Slider_SetMaxTrackAndBackgroundColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -675,7 +675,7 @@ public void Slider_SetMaxTrackColorTestFlowDirection_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -690,7 +690,7 @@ public void Slider_SetIsEnableAndThumbColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -705,7 +705,7 @@ public void Slider_SetIsEnableAndMinTrackColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -720,7 +720,7 @@ public void Slider_SetIsEnableAndMaxTrackColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -735,7 +735,7 @@ public void Slider_SetIsEnableAndBackgroundColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -750,7 +750,7 @@ public void Slider_SetIsVisibleAndThumbColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -765,7 +765,7 @@ public void Slider_SetIsVisibleAndMinTrackColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -780,7 +780,7 @@ public void Slider_SetIsVisibleAndMaxTrackColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -794,7 +794,7 @@ public void Slider_SetIsVisibleAndBackgroundColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -809,7 +809,7 @@ public void Slider_SetBackgroundColorAndThumbColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -824,7 +824,7 @@ public void Slider_SetBackgroundColorAndMinTrackColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -839,7 +839,7 @@ public void Slider_SetBackgroundColorAndMaxTrackColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -854,7 +854,7 @@ public void Slider_SetBackgroundColorAndIsEnable_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -870,7 +870,7 @@ public void Slider_SetThumbImageSourceAndThumbColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -886,7 +886,7 @@ public void Slider_FlowDirection_RTL_SetMinimumValue_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -902,7 +902,7 @@ public void Slider_FlowDirection_RTL_SetMaximumValue_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -918,7 +918,7 @@ public void Slider_FlowDirection_RTL_SetValue_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -933,7 +933,7 @@ public void Slider_SetFlowDirectionAndMinTrackColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -948,7 +948,7 @@ public void Slider_SetFlowDirectionAndMaxTrackColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SliderControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/StackLayoutFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/StackLayoutFeatureTests.cs index a59f3663fcaf..de1cb21d6882 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/StackLayoutFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/StackLayoutFeatureTests.cs @@ -60,7 +60,7 @@ public void HorizontalStackLayout_RTLFlowDirection() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -78,7 +78,7 @@ public void VerticalStackLayout_RTLFlowDirection() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -100,7 +100,7 @@ public void VerticalStackLayout_Spacing_With_RTL() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -119,7 +119,7 @@ public void HorizontalStackLayout_Spacing_With_RTL() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -139,7 +139,7 @@ public void HorizontalStackLayout_Spacing_With_Height() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -159,7 +159,7 @@ public void HorizontalStackLayout_Spacing_With_Width() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -178,7 +178,7 @@ public void HorizontalStackLayout_RTLFlowDirection_With_Height() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -197,7 +197,7 @@ public void HorizontalStackLayout_RTLFlowDirection_With_Width() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -220,7 +220,7 @@ public void VerticalStackLayout_Spacing_With_Width() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -243,7 +243,7 @@ public void VerticalStackLayout_Spacing_With_Height() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -265,7 +265,7 @@ public void VerticalStackLayout_RTLFlowDirection_With_Width() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -287,7 +287,7 @@ public void VerticalStackLayout_RTLFlowDirection_With_Height() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -313,7 +313,7 @@ public void VerticalStackLayout_RTLFlowDirection_With_HeightAndWidth() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -336,7 +336,7 @@ public void HorizontalStackLayout_RTLFlowDirection_With_HeightAndWidth() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -363,7 +363,7 @@ public void VerticalStackLayout_Spacing_With_HeightAndWidth() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -387,7 +387,7 @@ public void HorizontalStackLayout_Spacing_With_HeightAndWidth() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if ANDROID || IOS @@ -409,7 +409,7 @@ public void HorizontalStackLayout_Spacing_WithLandscape() #if ANDROID VerifyScreenshot(cropLeft: 125); #else - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #endif } @@ -434,7 +434,7 @@ public void VerticalStackLayout_Spacing_WithLandscape() #if ANDROID VerifyScreenshot(cropLeft: 125); #else - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #endif } #endif diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/StepperFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/StepperFeatureTests.cs index 6d4db6cb8942..4cfa46a715ca 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/StepperFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/StepperFeatureTests.cs @@ -178,7 +178,7 @@ public void Stepper_ChangeFlowDirection_RTL_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElement("Options"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif [Test] diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/SwipeViewFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/SwipeViewFeatureTests.cs index d1cee4241cde..4594a4dc7102 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/SwipeViewFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/SwipeViewFeatureTests.cs @@ -823,7 +823,7 @@ private void VerifySwipeViewScreenshot() #if WINDOWS VerifyScreenshot(cropTop: 100); #else - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #endif } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/SwitchFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/SwitchFeatureTests.cs index 57d1171f4080..7ca09fba7f05 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/SwitchFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/SwitchFeatureTests.cs @@ -21,7 +21,7 @@ public SwitchFeatureTests(TestDevice device) public void Switch_InitialState_VerifyVisualState() { App.WaitForElement("SwitchControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(2)] @@ -30,7 +30,7 @@ public void Switch_Click_VerifyVisualState() { App.WaitForElement("SwitchControl"); App.Tap("SwitchControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -45,7 +45,7 @@ public void Switch_SetFlowDirectionAndToggled_VerifyVisualState() App.Tap("Apply"); App.WaitForElement("SwitchControl"); App.Tap("SwitchControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -92,7 +92,7 @@ public void Switch_SetToggledAndOnColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SwitchControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -109,7 +109,7 @@ public void Switch_SetOnColorAndThumbColor_VerifyVisualState() App.Tap("Apply"); App.WaitForElement("SwitchControl"); App.Tap("SwitchControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWS // Issue Link - https://github.com/dotnet/maui/issues/30046, https://github.com/dotnet/maui/issues/29812 @@ -126,7 +126,7 @@ public void Switch_SetShadowOpacityAndToggled_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("SwitchControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -145,7 +145,7 @@ public void Switch_SetShadowAndOnColor_VerifyVisualState() App.Tap("Apply"); App.WaitForElement("SwitchControl"); App.Tap("SwitchControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -164,7 +164,7 @@ public void Switch_SetShadowAndThumbColor_VerifyVisualState() App.Tap("Apply"); App.WaitForElement("SwitchControl"); App.Tap("SwitchControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -182,6 +182,6 @@ public void Switch_SetThumbColorAndOnColor_VerifyVisualState() App.Tap("Apply"); App.WaitForElement("SwitchControl"); App.Tap("SwitchControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } } \ No newline at end of file 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 012c52c083d1..1034649da20c 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/TimePickerFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/TimePickerFeatureTests.cs @@ -26,11 +26,11 @@ public void TimePicker_InitialState_VerifyVisualState() App.WaitForElement("TimePickerControl"); App.Tap("TimePickerControl"); #if IOS - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); App.WaitForElement("Done"); App.Tap("Done"); #else - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #endif } #endif @@ -49,7 +49,7 @@ public void TimePicker_SetTimeAndCharacterSpacing_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("TimePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -66,7 +66,7 @@ public void TimePicker_SetTimeAndTextColor_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("TimePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -85,7 +85,7 @@ public void TimePicker_SetFontAttributesAndFontFamily_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("TimePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -105,7 +105,7 @@ public void TimePicker_SetFontAttributesAndFontSize_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("TimePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -125,7 +125,7 @@ public void TimePicker_SetFontFamilyAndFontSize_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("TimePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -141,7 +141,7 @@ public void TimePicker_SetTimeAndIsEnabled_VerifyVisualState() App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("TimePickerControl"); App.Tap("TimePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if TEST_FAILS_ON_WINDOWS // Issue Link - https://github.com/dotnet/maui/issues/29812 @@ -157,7 +157,7 @@ public void TimePicker_SetShadow_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("TimePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -177,7 +177,7 @@ public void TimePicker_SetFormat_t_AndTime_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("TimePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -197,7 +197,7 @@ public void TimePicker_SetFormatTAndTime_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("TimePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -219,7 +219,7 @@ public void TimePicker_SetFormat_T_WithFontAttributes_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("TimePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -241,7 +241,7 @@ public void TimePicker_SetFormat_T_WithFontFamily_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("TimePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -266,7 +266,7 @@ public void TimePicker_SetFormat_T_WithFontSize_VerifyVisualState() App.WaitForElementTillPageNavigationSettled("TimePickerControl"); App.WaitForElement("CultureFormatLabel"); App.Tap("CultureFormatLabel"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -299,7 +299,7 @@ public void TimePicker_ModifyOldTimeAndNewTime_VerifyVisualState() #endif Assert.That(App.WaitForElement("NewTimeSelectedLabel").GetText(), Is.EqualTo("06:00:00")); Assert.That(App.WaitForElement("OldTimeSelectedLabel").GetText(), Is.EqualTo("10:00:00")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -338,7 +338,7 @@ public void TimePicker_OldTimeAndNewTime_VerifyVisualState() #endif Assert.That(App.WaitForElement("NewTimeSelectedLabel").GetText(), Is.EqualTo("07:00:00")); Assert.That(App.WaitForElement("OldTimeSelectedLabel").GetText(), Is.EqualTo("06:00:00")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -355,7 +355,7 @@ public void TimePicker_SetFlowDirectionAndTime_VerifyVisualState() App.WaitForElement("Apply"); App.Tap("Apply"); App.WaitForElementTillPageNavigationSettled("TimePickerControl"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -384,7 +384,7 @@ public void TimePicker_SetFontAttributesAndFormat_VerifyVisualState() App.WaitForElementTillPageNavigationSettled("TimePickerControl"); App.WaitForElement("CultureFormatLabel"); App.Tap("CultureFormatLabel"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -413,7 +413,7 @@ public void TimePicker_SetFontFamilyAndFormat_VerifyVisualState() App.WaitForElementTillPageNavigationSettled("TimePickerControl"); App.WaitForElement("CultureFormatLabel"); App.Tap("CultureFormatLabel"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -438,7 +438,7 @@ public void TimePicker_SetFontSizeAndFormat_VerifyVisualState() App.WaitForElementTillPageNavigationSettled("TimePickerControl"); App.WaitForElement("CultureFormatLabel"); App.Tap("CultureFormatLabel"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -475,7 +475,7 @@ public void TimePicker_SetCulture_enUS_VerifyTimeFormat() App.WaitForElementTillPageNavigationSettled("TimePickerControl"); var cultureFormatText = App.WaitForElement("CultureFormatLabel").GetText(); Assert.That(cultureFormatText, Is.EqualTo("Culture: en-US, Time: 5:30 AM")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -499,7 +499,7 @@ public void TimePicker_SetCulture_arEG_VerifyTimeFormat() App.WaitForElementTillPageNavigationSettled("TimePickerControl"); var cultureFormatText = App.WaitForElement("CultureFormatLabel").GetText(); Assert.That(cultureFormatText, Is.EqualTo("Culture: ar-EG, Time: 11:30 ص")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -523,7 +523,7 @@ public void TimePicker_SetCulture_jaJP_VerifyTimeFormat() App.WaitForElementTillPageNavigationSettled("TimePickerControl"); var cultureFormatText = App.WaitForElement("CultureFormatLabel").GetText(); Assert.That(cultureFormatText, Is.EqualTo("Culture: ja-JP, Time: 17:30")); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ToolbarFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ToolbarFeatureTests.cs index c19867663df5..1e4bba7ff469 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ToolbarFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ToolbarFeatureTests.cs @@ -193,7 +193,7 @@ public void VerifySecondaryToolBar_IconAppearance() App.WaitForMoreButton(); App.TapMoreButton(); App.WaitForElement("Test Secondary (2)"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/TwoPaneViewFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/TwoPaneViewFeatureTests.cs index ba83da357be4..68fe357b6532 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/TwoPaneViewFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/TwoPaneViewFeatureTests.cs @@ -45,7 +45,7 @@ public void TwoPaneView_RTLFlowDirection() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(1)] @@ -58,7 +58,7 @@ public void TwoPaneView_WideMode() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(2)] @@ -137,7 +137,7 @@ public void TwoPaneView_TallMode() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(5)] @@ -156,7 +156,7 @@ public void TwoPaneView_Pane1Priority() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(6)] @@ -178,7 +178,7 @@ public void TwoPaneView_Pane2Priority() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(7)] @@ -197,7 +197,7 @@ public void TwoPaneView_Pane1SizeIncrease_WithTallMode() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(8)] @@ -216,7 +216,7 @@ public void TwoPaneView_Pane2SizeIncrease_WithTallMode() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif @@ -233,7 +233,7 @@ public void TwoPaneView_IsVisible() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(14)] @@ -249,7 +249,7 @@ public void TwoPaneView_ZIsShadowEnabled() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(13)] @@ -267,7 +267,7 @@ public void TwoPaneView_Pane1SizeIncrease() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(12)] @@ -285,7 +285,7 @@ public void TwoPaneView_Pane2SizeIncrease() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #if ANDROID || IOS @@ -362,7 +362,7 @@ public void TwoPaneView_TallMode() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(5)] @@ -380,7 +380,7 @@ public void TwoPaneView_WideMode() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(6)] @@ -403,7 +403,7 @@ public void TwoPaneView_Pane1SizeIncrease_WithWideMode() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(7)] @@ -426,7 +426,7 @@ public void TwoPaneView_Pane2SizeIncrease_WithWideMode() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(8)] @@ -447,7 +447,7 @@ public void TwoPaneView_ShadowWithWideMode() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(9)] @@ -468,7 +468,7 @@ public void TwoPaneView_RTLFlowDirection() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } @@ -485,7 +485,7 @@ public void TwoPaneView_Pane1Priority() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(11)] @@ -504,7 +504,7 @@ public void TwoPaneView_Pane2Priority() App.WaitForElement("Apply"); App.Tap("Apply"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/WebViewFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/WebViewFeatureTests.cs index 2e829ffdc917..d606f184fcd8 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/WebViewFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/WebViewFeatureTests.cs @@ -314,7 +314,7 @@ public void VerifyWebViewWithShadow() App.WaitForElement(Apply); App.Tap(Apply); App.WaitForElementTillPageNavigationSettled(Options, timeout: TimeSpan.FromSeconds(3)); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } #endif } \ No newline at end of file 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 05436bc4eb9d..5846abb7e7c7 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 @@ -17,7 +17,8 @@ public CarouselViewAdjustPeekAreaInsets(TestDevice device) [Category(UITestCategories.CarouselView)] public void ChangePeekAreaInsetsInOnSizeAllocatedTest() { - App.WaitForElement("CarouselId"); + // Use longer timeout for CarouselView which can be slow to render on CI + App.WaitForElement("CarouselId", timeout: TimeSpan.FromSeconds(30)); } } } \ 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 03b331cc6cf8..0127a3ff6501 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 @@ -26,25 +26,26 @@ public CarouselViewLoopNoFreeze(TestDevice device) [FailsOnWindowsWhenRunningOnXamarinUITest("https://github.com/dotnet/maui/issues/24482")] public void Issue12574Test() { - App.WaitForElement("0 item"); + // Use longer timeout for CarouselView items which can be slow to appear on CI + App.WaitForElement("0 item", timeout: TimeSpan.FromSeconds(30)); App.WaitForElement(_carouselAutomationId); App.WaitForElement(_btnSwipeAutomationId); App.Tap(_btnSwipeAutomationId); - App.WaitForElement("1 item"); + App.WaitForElement("1 item", timeout: TimeSpan.FromSeconds(10)); App.Tap(_btnSwipeAutomationId); - App.WaitForElement("2 item"); + App.WaitForElement("2 item", timeout: TimeSpan.FromSeconds(10)); App.WaitForElement(_btnRemoveAutomationId); App.Tap(_btnRemoveAutomationId); - App.WaitForElement("1 item"); + App.WaitForElement("1 item", timeout: TimeSpan.FromSeconds(10)); App.Tap(_btnSwipeAutomationId); - App.WaitForElement("0 item"); + App.WaitForElement("0 item", timeout: TimeSpan.FromSeconds(10)); } [Test] @@ -52,12 +53,13 @@ public void Issue12574Test() [FailsOnWindowsWhenRunningOnXamarinUITest("https://github.com/dotnet/maui/issues/24482")] public void RemoveItemsQuickly() { - App.WaitForElement("0 item"); + // Use longer timeout for CarouselView items which can be slow to appear on CI + App.WaitForElement("0 item", timeout: TimeSpan.FromSeconds(30)); App.Click(_btnRemoveAllAutomationId); // If we haven't crashed, then the other button should be here - App.WaitForElement(_btnRemoveAutomationId); + App.WaitForElement(_btnRemoveAutomationId, timeout: TimeSpan.FromSeconds(10)); } } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10563.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10563.cs index c96c36474357..e9e8840cc02a 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10563.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10563.cs @@ -25,25 +25,40 @@ public Issue10563(TestDevice testDevice) : base(testDevice) public void Issue10563OpenSwipeViewTest() { Exception? exception = null; + + // Test Left SwipeItems App.WaitForElement(OpenLeftId); App.Tap(OpenLeftId); - VerifyScreenshotOrSetException(ref exception, "Left_SwipeItems"); + // Wait for swipe animation to complete - the SwipeItem text becomes visible + App.WaitForElement("Issue 10563"); + VerifyScreenshotOrSetException(ref exception, "Left_SwipeItems", retryTimeout: TimeSpan.FromSeconds(2)); App.Tap(CloseId); + // Wait for close animation to complete - the SwipeItem text disappears + App.WaitForNoElement("Issue 10563"); + // Test Right SwipeItems App.WaitForElement(OpenRightId); App.Tap(OpenRightId); - VerifyScreenshotOrSetException(ref exception, "Right_SwipeItems"); + App.WaitForElement("Issue 10563"); + VerifyScreenshotOrSetException(ref exception, "Right_SwipeItems", retryTimeout: TimeSpan.FromSeconds(2)); App.Tap(CloseId); + App.WaitForNoElement("Issue 10563"); + // Test Top SwipeItems App.WaitForElement(OpenTopId); App.Tap(OpenTopId); - VerifyScreenshotOrSetException(ref exception, "Top_SwipeItems"); + App.WaitForElement("Issue 10563"); + VerifyScreenshotOrSetException(ref exception, "Top_SwipeItems", retryTimeout: TimeSpan.FromSeconds(2)); App.Tap(CloseId); + App.WaitForNoElement("Issue 10563"); + // Test Bottom SwipeItems App.WaitForElement(OpenBottomId); App.Tap(OpenBottomId); - VerifyScreenshotOrSetException(ref exception, "Bottom_SwipeItems"); + App.WaitForElement("Issue 10563"); + VerifyScreenshotOrSetException(ref exception, "Bottom_SwipeItems", retryTimeout: TimeSpan.FromSeconds(2)); App.Tap(CloseId); + App.WaitForNoElement("Issue 10563"); if (exception != null) { diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20535.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20535.cs index d0759481e2f9..426e24e4c27b 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20535.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20535.cs @@ -22,6 +22,6 @@ public void SwitchTrackColorTest() App.WaitForElement("Update OnColor"); // Wait for the Thumb animation to complete // 2. Verify the result. - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22306.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22306.cs index 358b4dc73c6d..a5e9bfeb3ea3 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22306.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22306.cs @@ -21,21 +21,23 @@ public void ButtonsLayoutResolveWhenParentSizeChanges() #endif WaitForAllElements(); var changeBoundsButton = App.WaitForElement("ChangeBoundsButton"); - VerifyScreenshot(TestContext.CurrentContext.Test.MethodName + "Original"); + // Use retryTimeout to allow layout to settle + VerifyScreenshot(TestContext.CurrentContext.Test.MethodName + "Original", tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); changeBoundsButton.Click(); WaitForAllElements(); - VerifyScreenshot(TestContext.CurrentContext.Test.MethodName + "SizeButtonsDownPortrait"); + VerifyScreenshot(TestContext.CurrentContext.Test.MethodName + "SizeButtonsDownPortrait", tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #if IOS || ANDROID App.SetOrientationLandscape(); WaitForAllElements(); + // Use retryTimeout to allow orientation change to settle #if ANDROID - VerifyScreenshot(TestContext.CurrentContext.Test.MethodName + "SizeButtonsDownLandscape", cropLeft: 125); + VerifyScreenshot(TestContext.CurrentContext.Test.MethodName + "SizeButtonsDownLandscape", cropLeft: 125, tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #else - VerifyScreenshot(TestContext.CurrentContext.Test.MethodName + "SizeButtonsDownLandscape"); + VerifyScreenshot(TestContext.CurrentContext.Test.MethodName + "SizeButtonsDownLandscape", tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); #endif changeBoundsButton.Click(); @@ -44,7 +46,7 @@ public void ButtonsLayoutResolveWhenParentSizeChanges() App.SetOrientationPortrait(); WaitForAllElements(); // Cannot use the original screenshot as the black bar on bottom is not as dark after rotation - VerifyScreenshot(TestContext.CurrentContext.Test.MethodName + "Original2"); + VerifyScreenshot(TestContext.CurrentContext.Test.MethodName + "Original2", tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } finally { diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24034.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24034.cs index 199e3a55bf6a..103241d5ac99 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24034.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24034.cs @@ -15,6 +15,7 @@ public void ShadowShouldUpdate() App.WaitForElement("button"); App.Click("button"); - VerifyScreenshot(); + // Use retryTimeout to allow shadow animation to complete + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24489_2.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24489_2.cs index 1d9a8991c5b0..307bc6527a60 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24489_2.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24489_2.cs @@ -79,7 +79,7 @@ public void NavBarResetsColorAfterSmallTitleBar() App.TapBackArrow("Issue24489_2"); App.WaitForElement("OpenPageThatOpensEmptyTitleBar").Tap(); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -90,7 +90,7 @@ public void NavBarResetsColorAfterLargeTitleBar() App.TapBackArrow("Issue24489_2"); App.WaitForElement("OpenPageThatOpensEmptyTitleBar").Tap(); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24489_Shell.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24489_Shell.cs index aae7b646d98b..873fa70eeb79 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24489_Shell.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24489_Shell.cs @@ -86,7 +86,7 @@ public void NavBarResetsColorAfterSmallTitleBarShell() App.TapBackArrow("Issue24489_2"); App.WaitForElement("OpenPageThatOpensEmptyTitleBar").Tap(); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test] @@ -97,7 +97,7 @@ public void NavBarResetsColorAfterLargeTitleBarShell() App.TapBackArrow("Issue24489_2"); App.WaitForElement("OpenPageThatOpensEmptyTitleBar").Tap(); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24996.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24996.cs index f00636ba97d8..6d013c9511f6 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24996.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24996.cs @@ -15,14 +15,15 @@ public Issue24996(TestDevice testDevice) : base(testDevice) [Test] [Category(UITestCategories.Layout)] - public async Task ChangingTranslationShouldNotCauseLayoutPassOnAncestors() + public void ChangingTranslationShouldNotCauseLayoutPassOnAncestors() { - var element = App.WaitForElement("Stats"); + App.WaitForElement("Stats"); // Tries to translate the element in different positions, on-screen and off-screen. for (int i = 0; i < 4; i++) { - element.Tap(); - await Task.Delay(150); + App.Tap("Stats"); + // Re-query element after tap to avoid stale reference and wait for UI to settle + var element = App.WaitForElement("Stats"); ClassicAssert.True(element.GetText()!.StartsWith("Lvl1[0/0]")); } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue26662.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue26662.cs index f440c18db6f2..461b3104d009 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue26662.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue26662.cs @@ -24,7 +24,7 @@ public void DynamicFontImageSourceColorShouldApplyOnTabIcon() { App.WaitForElement("Button"); App.Tap("Button"); - VerifyScreenshot(); + VerifyScreenshot(retryTimeout: TimeSpan.FromSeconds(2)); } } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27730.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27730.cs index faa5b1ee71f2..85db50887de7 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27730.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27730.cs @@ -19,7 +19,7 @@ public void ShadowShouldUpdateWhenClipping() App.WaitForElement("ApplyShadowBtn"); App.Tap("ApplyClipBtn"); App.Tap("ApplyShadowBtn"); - VerifyScreenshot(); + VerifyScreenshot(retryTimeout: TimeSpan.FromSeconds(2)); } } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29109.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29109.cs index 2040f7180f9b..3d1b0e4022f0 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29109.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29109.cs @@ -17,7 +17,8 @@ public Issue29109(TestDevice device) : base(device) { } public void FontImageSourceColorShouldApplyOnBottomTabIconOnAndroid() { App.WaitForElement("Button"); - VerifyScreenshot(); + // Use retryTimeout to allow tab rendering to complete + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } [Test, Order(2)] @@ -26,7 +27,8 @@ public void DynamicFontImageSourceColorShouldApplyOnBottomTabIconOnAndroid() { App.WaitForElement("Button"); App.Tap("Button"); - VerifyScreenshot(); + // Use retryTimeout to allow icon color change animation to complete + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29693.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29693.cs index aa3924bdf625..3f0c70b11c21 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29693.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29693.cs @@ -19,6 +19,6 @@ public void VerifySwitchDefaultColors() App.WaitForElement("button1"); App.Tap("button1"); App.Tap("button2"); - VerifyScreenshot(); + VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32394.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32394.cs index 5b7da752f4d5..1b098982e0df 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32394.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32394.cs @@ -20,7 +20,9 @@ public void Issue32394CurrentItemShouldnotChange() App.WaitForElement("Issue32394SetPositionButton"); App.Tap("Issue32394SetPositionButton"); App.SetOrientationLandscape(); - VerifyScreenshot(); + // Use retryTimeout to allow orientation change to complete + // Higher tolerance needed for CarouselView orientation changes due to rendering variance + VerifyScreenshot(tolerance: 1.5, retryTimeout: TimeSpan.FromSeconds(3)); } } #endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/UITest.cs b/src/Controls/tests/TestCases.Shared.Tests/UITest.cs index 44980598dc9d..c1a09b56cdc4 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/UITest.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/UITest.cs @@ -25,6 +25,29 @@ public abstract class UITest : UITestBase string _defaultiOSVersion = "18.5"; protected const int SetupMaxRetries = 1; + protected const int InstrumentationCrashMaxRetries = 1; + + /// + /// Detects if an exception indicates an Android UiAutomator2 instrumentation crash + /// or other infrastructure failure that requires session recreation. + /// + private static bool IsInstrumentationCrash(Exception e) + { + var message = e.ToString(); // Includes InnerException + return + message.Contains("instrumentation process is not running", StringComparison.OrdinalIgnoreCase) || + message.Contains("socket hang up", StringComparison.OrdinalIgnoreCase) || + message.Contains("Can't find service: package", StringComparison.OrdinalIgnoreCase) || + message.Contains("Could not proxy command to remote server", StringComparison.OrdinalIgnoreCase) || + message.Contains("ECONNRESET", StringComparison.OrdinalIgnoreCase) || + message.Contains("ECONNREFUSED", StringComparison.OrdinalIgnoreCase) || + message.Contains("Connection refused", StringComparison.OrdinalIgnoreCase) || + message.Contains("InvalidSessionIdException", StringComparison.OrdinalIgnoreCase) || + message.Contains("NoSuchDriverException", StringComparison.OrdinalIgnoreCase) || + message.Contains("session is either terminated or not started", StringComparison.OrdinalIgnoreCase) || + message.Contains("UiAutomator2 server", StringComparison.OrdinalIgnoreCase) || + message.Contains("device offline", StringComparison.OrdinalIgnoreCase); + } readonly VisualRegressionTester _visualRegressionTester; readonly IImageEditorFactory _imageEditorFactory; readonly VisualTestContext _visualTestContext; @@ -533,6 +556,7 @@ protected virtual void TryToResetTestState() protected override void FixtureSetup() { int retries = 0; + int instrumentationCrashRetries = 0; while (true) { try @@ -548,6 +572,26 @@ protected override void FixtureSetup() catch (Exception e) { TestContext.Error.WriteLine($">>>>> {DateTime.Now} The FixtureSetup threw an exception. Attempt {retries}/{SetupMaxRetries}.{Environment.NewLine}Exception details: {e}"); + + // Check for instrumentation/infrastructure crash that requires session recreation + if (IsInstrumentationCrash(e) && instrumentationCrashRetries++ < InstrumentationCrashMaxRetries) + { + TestContext.Error.WriteLine($">>>>> {DateTime.Now} Detected instrumentation crash, attempting session recreation (attempt {instrumentationCrashRetries}/{InstrumentationCrashMaxRetries})..."); + try + { + // Call base.Reset() which disposes and recreates the driver + // (NOT this.Reset() which just does App.ResetApp()) + base.Reset(); + TestContext.Error.WriteLine($">>>>> {DateTime.Now} Session recreation successful, retrying FixtureSetup..."); + continue; // Retry the whole FixtureSetup with fresh session + } + catch (Exception resetEx) + { + TestContext.Error.WriteLine($">>>>> {DateTime.Now} Session recreation failed: {resetEx.Message}"); + // Fall through to standard retry logic + } + } + if (retries++ < SetupMaxRetries) { App.Back(); @@ -574,10 +618,27 @@ public override void TestSetup() { App.SetOrientationPortrait(); } - catch + catch (Exception e) { - // The app might not be ready - // Probably reduce this value if this works + // Check for instrumentation crash that requires session recreation + if (IsInstrumentationCrash(e)) + { + TestContext.Error.WriteLine($">>>>> {DateTime.Now} Detected instrumentation crash in TestSetup, attempting session recreation..."); + try + { + base.Reset(); // Recreate the driver session + TestContext.Error.WriteLine($">>>>> {DateTime.Now} Session recreation successful in TestSetup"); + App.SetOrientationPortrait(); + return; + } + catch (Exception resetEx) + { + TestContext.Error.WriteLine($">>>>> {DateTime.Now} Session recreation failed in TestSetup: {resetEx.Message}"); + throw; + } + } + + // The app might not be ready - original retry logic Thread.Sleep(1000); App.SetOrientationPortrait(); } diff --git a/src/TestUtils/src/UITest.NUnit/UITestBase.cs b/src/TestUtils/src/UITest.NUnit/UITestBase.cs index 5206e2c7878d..e52a0cc4f82b 100644 --- a/src/TestUtils/src/UITest.NUnit/UITestBase.cs +++ b/src/TestUtils/src/UITest.NUnit/UITestBase.cs @@ -10,6 +10,12 @@ public abstract class UITestBase : UITestContextBase { protected virtual bool ResetAfterEachTest => false; + // Store paths of diagnostic files captured during OneTimeSetUp failure + // so they can be re-attached to individual test results in TearDown + // (NUnit doesn't attach files from OneTimeSetUp to individual test results in Azure DevOps) + private readonly List _fixtureSetupDiagnosticFiles = new(); + private bool _fixtureSetupFailed = false; + public UITestBase(TestDevice testDevice) : base(testDevice) { @@ -36,6 +42,21 @@ public virtual void TestTearDown() { RecordTestTeardown(); UITestBaseTearDown(); + + // If the fixture setup failed, re-attach diagnostic files to each individual test + // so they appear in Azure DevOps test results (NUnit doesn't do this automatically + // for files attached during OneTimeSetUp) + if (_fixtureSetupFailed) + { + foreach (var filePath in _fixtureSetupDiagnosticFiles) + { + if (File.Exists(filePath)) + { + AddTestAttachment(filePath, $"[FixtureSetup] {Path.GetFileName(filePath)}"); + } + } + } + if (ResetAfterEachTest) { Reset(); @@ -122,8 +143,9 @@ public void OneTimeSetup() } catch { - SaveDeviceDiagnosticInfo(); - SaveUIDiagnosticInfo(); + _fixtureSetupFailed = true; + SaveDeviceDiagnosticInfo(storeForReattachment: true); + SaveUIDiagnosticInfo(storeForReattachment: true); throw; } } @@ -146,7 +168,7 @@ public void OneTimeTearDown() FixtureOneTimeTearDown(); } - void SaveDeviceDiagnosticInfo([CallerMemberName] string? note = null) + void SaveDeviceDiagnosticInfo([CallerMemberName] string? note = null, bool storeForReattachment = false) { try { @@ -165,6 +187,12 @@ void SaveDeviceDiagnosticInfo([CallerMemberName] string? note = null) File.WriteAllLines(logsPath, entries); AddTestAttachment(logsPath, Path.GetFileName(logsPath)); + + // Store path for re-attachment to individual tests if this is from fixture setup + if (storeForReattachment) + { + _fixtureSetupDiagnosticFiles.Add(logsPath); + } } } } @@ -175,7 +203,7 @@ void SaveDeviceDiagnosticInfo([CallerMemberName] string? note = null) } } - protected bool SaveUIDiagnosticInfo([CallerMemberName] string? note = null) + protected bool SaveUIDiagnosticInfo([CallerMemberName] string? note = null, bool storeForReattachment = false) { if (App.AppState != ApplicationState.Running) return false; @@ -186,6 +214,12 @@ protected bool SaveUIDiagnosticInfo([CallerMemberName] string? note = null) _ = App.Screenshot(screenshotPath); AddTestAttachment(screenshotPath, Path.GetFileName(screenshotPath)); + + // Store path for re-attachment to individual tests if this is from fixture setup + if (storeForReattachment) + { + _fixtureSetupDiagnosticFiles.Add(screenshotPath); + } } var pageSourcePath = GetGeneratedFilePath("PageSource.txt", note); @@ -194,6 +228,12 @@ protected bool SaveUIDiagnosticInfo([CallerMemberName] string? note = null) File.WriteAllText(pageSourcePath, App.ElementTree); AddTestAttachment(pageSourcePath, Path.GetFileName(pageSourcePath)); + + // Store path for re-attachment to individual tests if this is from fixture setup + if (storeForReattachment) + { + _fixtureSetupDiagnosticFiles.Add(pageSourcePath); + } } return true;