From 8a3a34fc5119b78d29319734153298cc90f6ee22 Mon Sep 17 00:00:00 2001 From: NafeelaNazhir Date: Wed, 18 Dec 2024 18:23:48 +0530 Subject: [PATCH 01/11] Migrated Issue Bugzilla36955 and Issue2818 --- .../Issues/Bugzilla/Bugzilla36955.cs | 8 +- .../Issues/XFIssue/Issue2818.cs | 2 +- .../Tests/Issues/Bugzilla/Bugzilla36955.cs | 40 +++++---- .../Tests/Issues/XFIssue/Issue2818.cs | 89 +++++++++---------- 4 files changed, 72 insertions(+), 67 deletions(-) diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla36955.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla36955.cs index 79434d2908a0..a16702823f4c 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla36955.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla36955.cs @@ -12,10 +12,14 @@ protected override void Init() var sc = new SwitchCell { - Text = "Toggle switch; nothing should crash" + Text = "Toggle switch; nothing should crash", + AutomationId = "Switch" }; - var button = new Button(); + var button = new Button + { + AutomationId = "Button" + }; button.SetBinding(Button.TextProperty, new Binding("On", source: sc)); var vc = new ViewCell diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue2818.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue2818.cs index dd8d47da2f59..5a425450dc59 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue2818.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue2818.cs @@ -12,7 +12,7 @@ protected override void Init() { Title = "Flyout", BackgroundColor = Colors.SkyBlue, - IconImageSource = "menuIcon", + IconImageSource = "menu_icon", Content = new StackLayout() { Children = diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs index 3eb7f122248b..bbc4894a3afa 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs @@ -1,4 +1,5 @@ -using NUnit.Framework; +#if TEST_FAILS_ON_CATALYST +using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -12,17 +13,26 @@ public Bugzilla36955(TestDevice testDevice) : base(testDevice) public override string Issue => "[iOS] ViewCellRenderer.UpdateIsEnabled referencing null object"; - // TODO from Xamarin.UITest Migration, seems to be ignored already - // Also uses some specific XamUITest APIs that we need to find counterparts for - // [Ignore("Test failing due to unrelated issue, disable for moment")] - // [Category(UITestCategories.TableView)] - // [Test] - // public void Bugzilla36955Test() - // { - // AppResult[] buttonFalse = App.Query(q => q.Button().Text("False")); - // Assert.AreEqual(buttonFalse.Length == 1, true); - // App.Tap(q => q.Class("Switch")); - // AppResult[] buttonTrue = App.Query(q => q.Button().Text("True")); - // Assert.AreEqual(buttonTrue.Length == 1, true); - // } -} \ No newline at end of file + [Category(UITestCategories.TableView)] + [Test] + public void Bugzilla36955Test() + { + App.WaitForElement("Button"); + Assert.That(App.FindElement("Button").GetText(), Is.EqualTo("False")); + TapCoordinates(); + Assert.That(App.FindElement("Button").GetText(), Is.EqualTo("True")); + } + void TapCoordinates() + { +#if WINDOWS + App.TapCoordinates(1340,160); +#elif ANDROID + App.TapCoordinates(1000, 100); +#elif IOS + App.TapCoordinates(1002,100) +#endif + } +} +#endif + + diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs index 6cab47dcf9bd..3c087483dd47 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs @@ -1,4 +1,5 @@ -using NUnit.Framework; +#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS +using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -13,58 +14,48 @@ public Issue2818(TestDevice testDevice) : base(testDevice) public override string Issue => "Right-to-Left FlyoutPage in Xamarin.Forms Hamburger icon issue"; - // [Test] - // public void RootViewMovesAndContentIsVisible() - // { - // var idiom = App.WaitForElement("Idiom"); - - // // This behavior is currently broken on a phone device Issue 7270 - // if (idiom[0].ReadText() != "Tablet") - // return; - - // App.Tap("OpenRootView"); - // App.Tap("CloseRootView"); - // App.SetOrientationLandscape(); - // App.Tap("OpenRootView"); - // var positionStart = App.WaitForElement("CloseRootView"); - // App.Tap("ShowLeftToRight"); - - // var results = App.QueryUntilPresent(() => - // { - // var secondPosition = App.Query("CloseRootView"); - - // if (secondPosition.Length == 0) - // return null; + [Test] // "While in landscape orientation and with the flow direction set to RightToLeft in IOS, the Flyout items are not displayed." + public void RootViewMovesAndContentIsVisible() + { + var idiom = App.WaitForElement("Idiom"); + App.Tap("OpenRootView"); + App.Tap("CloseRootView"); + App.SetOrientationLandscape(); + App.Tap("OpenRootView"); + var positionStart = App.WaitForElement("CloseRootView").GetRect().X; + App.Tap("CloseRootView"); + App.WaitForElement("ShowLeftToRight"); + App.Tap("ShowLeftToRight"); + App.WaitForElement("OpenRootView"); + App.Tap("OpenRootView"); + var secondPosition = App.WaitForElement("CloseRootView").GetRect().X; + Assert.That(positionStart, Is.Not.EqualTo(secondPosition)); + } - // if (secondPosition[0].Rect.X < positionStart[0].Rect.X) - // return secondPosition; - // return null; - // }); + //[Test] It is only enabled for IOS , While in landscape orientation and with the flow direction set to RightToLeft in IOS, the Flyout items are not displayed." + public void RootViewSizeDoesntChangeAfterBackground() + { + var idiom = App.WaitForElement("Idiom"); + App.SetOrientationLandscape(); + App.Tap("OpenRootView"); + App.WaitForElement("CloseRootView"); + App.Tap("CloseRootView"); + App.WaitForElementTillPageNavigationSettled("ShowLeftToRight"); + App.Tap("ShowLeftToRight"); + App.WaitForElement("OpenRootView"); + App.Tap("OpenRootView"); + var windowSize = App.WaitForElement("RootLayout"); + App.BackgroundApp(); + var newWindowSize = App.WaitForElement("RootLayout"); + Assert.That(newWindowSize.GetRect().Width, Is.EqualTo(windowSize.GetRect().Width)); + Assert.That(newWindowSize.GetRect().Height, Is.EqualTo(windowSize.GetRect().Height)); - // Assert.IsNotNull(results, "Flyout View Did not change flow direction correctly"); - // Assert.AreEqual(1, results.Length, "Flyout View Did not change flow direction correctly"); - // } + } + +} +#endif - // #if __IOS__ - // [Test] - // public void RootViewSizeDoesntChangeAfterBackground() - // { - // var idiom = App.WaitForElement("Idiom"); - // // This behavior is currently broken on a phone device Issue 7270 - // if (idiom[0].ReadText() != "Tablet") - // return; - // App.SetOrientationLandscape(); - // App.Tap("CloseRootView"); - // App.Tap("ShowLeftToRight"); - // var windowSize = App.WaitForElement("RootLayout")[0]; - // App.SendAppToBackground(TimeSpan.FromSeconds(5)); - // var newWindowSize = App.WaitForElement("RootLayout")[0]; - // Assert.AreEqual(newWindowSize.Rect.Width, windowSize.Rect.Width); - // Assert.AreEqual(newWindowSize.Rect.Height, windowSize.Rect.Height); - // } - // #endif -} \ No newline at end of file From 69a32ce0256e8e042124c920d966133f0895e0bd Mon Sep 17 00:00:00 2001 From: NafeelaNazhir Date: Wed, 18 Dec 2024 18:27:55 +0530 Subject: [PATCH 02/11] modified test case --- .../TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs index 3c087483dd47..912d2407d73e 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs @@ -19,6 +19,7 @@ public void RootViewMovesAndContentIsVisible() { var idiom = App.WaitForElement("Idiom"); App.Tap("OpenRootView"); + App.WaitForElement("CloseRootView"); App.Tap("CloseRootView"); App.SetOrientationLandscape(); App.Tap("OpenRootView"); From cc6a6785e58fbd16c7ebf3fb651916f732aa53e2 Mon Sep 17 00:00:00 2001 From: NafeelaNazhir Date: Thu, 19 Dec 2024 11:13:20 +0530 Subject: [PATCH 03/11] Modified Bugzilla36955 --- .../tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla36955.cs | 3 +-- .../Tests/Issues/Bugzilla/Bugzilla36955.cs | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla36955.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla36955.cs index a16702823f4c..a3f5cee21cf3 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla36955.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla36955.cs @@ -12,8 +12,7 @@ protected override void Init() var sc = new SwitchCell { - Text = "Toggle switch; nothing should crash", - AutomationId = "Switch" + Text = "Toggle switch; nothing should crash" }; var button = new Button diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs index bbc4894a3afa..1805c4cea94b 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs @@ -1,4 +1,4 @@ -#if TEST_FAILS_ON_CATALYST +#if TEST_FAILS_ON_CATALYST // Tap Coordinates not working on Catalyst using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -29,7 +29,7 @@ void TapCoordinates() #elif ANDROID App.TapCoordinates(1000, 100); #elif IOS - App.TapCoordinates(1002,100) + App.TapCoordinates(1002,100); #endif } } From 96b253557b7528b07fb2b5c8631e1dc20c93d077 Mon Sep 17 00:00:00 2001 From: NafeelaNazhir Date: Thu, 19 Dec 2024 19:45:40 +0530 Subject: [PATCH 04/11] Migrated Issue5132 --- .../Tests/Issues/XFIssue/Issue5132.cs | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5132.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5132.cs index 5421559598bb..9fe081383a9d 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5132.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5132.cs @@ -1,4 +1,5 @@ -using NUnit.Framework; +#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWS // AutomationId not working on Android and Icon not override on Windows More Information: https://github.com/dotnet/maui/issues/1625 +using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -9,17 +10,18 @@ public class Issue5132 : _IssuesUITest public Issue5132(TestDevice testDevice) : base(testDevice) { } - + const string _idIconElement = "shellIcon"; public override string Issue => "Unable to specify automation properties on the hamburger/flyout icon"; - //#if !(ANDROID || IOS) - // [Ignore("Shell test is only supported on Android and iOS")] - //#endif - // [Test] - // [Category(UITestCategories.Shell)] - // public void ShellFlyoutAndHamburgerAutomationProperties() - // { - // App.WaitForElement(q => q.Marked(_idIconElement)); - // TapInFlyout(_titleElement, _idIconElement); - // } -} \ No newline at end of file + + [Test] + [Category(UITestCategories.Shell)] + public void ShellFlyoutAndHamburgerAutomationProperties() + { + App.WaitForElement(_idIconElement); + App.Tap(_idIconElement); + App.WaitForElement("Connect"); + + } +} +#endif \ No newline at end of file From 8313070a85293e4e31b5363271b249df7bd953ab Mon Sep 17 00:00:00 2001 From: Anandhan Rajagopal <97146406+anandhan-rajagopal@users.noreply.github.com> Date: Thu, 19 Dec 2024 20:16:40 +0530 Subject: [PATCH 05/11] enabled more tests --- .../Issues/Bugzilla/Bugzilla40092.cs | 11 +++++-- .../Issues/Bugzilla/Bugzilla41415.cs | 29 ++++++++++++++++++- .../Tests/Issues/Bugzilla/Bugzilla36955.cs | 18 ++++++------ .../Tests/Issues/Bugzilla/Bugzilla40092.cs | 22 +++++--------- .../Tests/Issues/XFIssue/Issue2818.cs | 11 +++++-- 5 files changed, 60 insertions(+), 31 deletions(-) diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40092.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40092.cs index 8aa49054e87b..22546f964ec0 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40092.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40092.cs @@ -1,3 +1,4 @@ +using Microsoft.Maui.Layouts; namespace Maui.Controls.Sample.Issues; @@ -30,15 +31,19 @@ protected override void Init() Color = Colors.Black, AutomationId = Black }; + + mainLayout.Children.Add(view); + AbsoluteLayout.SetLayoutBounds(view, new Rect(0, 0, 1, 1)); + AbsoluteLayout.SetLayoutFlags(view, AbsoluteLayoutFlags.All); - mainLayout.Add(view); Content = thePage; } - protected override async void OnAppearing() + protected override void OnAppearing() { base.OnAppearing(); - await DisplayAlert("Instruction", "If you see just the black color, the test pass. (Ignore the navigation bar)", Ok); + // As we going to use verifyscreenshot , so here just remove the displayalert. + //await DisplayAlert("Instruction", "If you see just the black color, the test pass. (Ignore the navigation bar)", Ok); } } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41415.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41415.cs index 158dbbe61410..7e2af7f84101 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41415.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41415.cs @@ -82,7 +82,34 @@ public Bugzilla41415() _x = 100; }; - Content = new StackLayout { Children = { button, labelx, labely, labelz, labela, scrollView } }; + Grid.SetRow(button, 0); + Grid.SetRow(labelx, 1); + Grid.SetRow(labely, 2); + Grid.SetRow(labelz, 3); + Grid.SetRow(labela, 4); + Grid.SetRow(scrollView, 5); + + Content = new Grid + { + RowDefinitions = new RowDefinitionCollection + { + new RowDefinition { Height = GridLength.Auto }, + new RowDefinition { Height = GridLength.Auto }, + new RowDefinition { Height = GridLength.Auto }, + new RowDefinition { Height = GridLength.Auto }, + new RowDefinition { Height = GridLength.Auto }, + new RowDefinition { Height = GridLength.Star }, + }, + Children = + { + button, + labelx, + labely, + labelz, + labela, + scrollView, + } + }; } } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs index bbc4894a3afa..c0b6de7901be 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs @@ -1,5 +1,4 @@ -#if TEST_FAILS_ON_CATALYST -using NUnit.Framework; +using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -19,20 +18,21 @@ public void Bugzilla36955Test() { App.WaitForElement("Button"); Assert.That(App.FindElement("Button").GetText(), Is.EqualTo("False")); - TapCoordinates(); + + ToggleSwitch(); Assert.That(App.FindElement("Button").GetText(), Is.EqualTo("True")); } - void TapCoordinates() + void ToggleSwitch() { + //Unable to access the switch element directly when it placed inside the TableView, so using TapCoordinates to tap on the switch #if WINDOWS App.TapCoordinates(1340,160); #elif ANDROID App.TapCoordinates(1000, 100); #elif IOS - App.TapCoordinates(1002,100) + App.Tap(AppiumQuery.ByXPath("//XCUIElementTypeSwitch[@name='Toggle switch; nothing should crash']")); +#elif MACCATALYST + App.ClickCoordinates(774,140); #endif } -} -#endif - - +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40092.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40092.cs index 35bfe3b34550..73b1e83ffa70 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40092.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40092.cs @@ -12,20 +12,12 @@ public Bugzilla40092(TestDevice testDevice) : base(testDevice) public override string Issue => "Ensure android devices with fractional scale factors (3.5) don't have a white line around the border"; - // TODO: From Xamarin.UITest migration. - // Does some advanced commands to determine layouts, need to find the equivalent on Appium - // [Test] - // [Category(UITestCategories.BoxView)] - // public void AllScreenIsBlack() - // { - // App.WaitForElement(Ok); - // App.Tap(Ok); - // var box = App.WaitForElement(Black)[0]; - // var layout = App.WaitForElement(White)[0]; - // var assert = box.Rect.Height == layout.Rect.Height && - // box.Rect.Width == layout.Rect.Width; - - // Assert.IsTrue(assert); - // } + [Test] + [Category(UITestCategories.BoxView)] + public void AllScreenIsBlack() + { + App.WaitForElement("black"); + VerifyScreenshot(); + } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs index 912d2407d73e..d9a179ce8f02 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs @@ -33,8 +33,9 @@ public void RootViewMovesAndContentIsVisible() Assert.That(positionStart, Is.Not.EqualTo(secondPosition)); } - - //[Test] It is only enabled for IOS , While in landscape orientation and with the flow direction set to RightToLeft in IOS, the Flyout items are not displayed." + // Equivalent method for SendAppToBackground is not found in appium. + // In iOS While in landscape orientation and with the flow direction set to RightToLeft in IOS, the Flyout items are not displayed." + //[Test] public void RootViewSizeDoesntChangeAfterBackground() { var idiom = App.WaitForElement("Idiom"); @@ -51,8 +52,12 @@ public void RootViewSizeDoesntChangeAfterBackground() var newWindowSize = App.WaitForElement("RootLayout"); Assert.That(newWindowSize.GetRect().Width, Is.EqualTo(windowSize.GetRect().Width)); Assert.That(newWindowSize.GetRect().Height, Is.EqualTo(windowSize.GetRect().Height)); + } - + [TearDown] + public void TearDown() + { + App.SetOrientationPortrait(); } } From b29ef4586fc239eb3482ff50f82c7a52a69815a7 Mon Sep 17 00:00:00 2001 From: Anandhan Rajagopal <97146406+anandhan-rajagopal@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:32:43 +0530 Subject: [PATCH 06/11] Updated enabled tests --- .../Issues/Bugzilla/Bugzilla40092.cs | 5 +- .../Issues/Bugzilla/Bugzilla41415.cs | 5 +- .../Issues/XFIssue/Issue5132.cs | 83 +++++++++---------- .../Tests/Issues/Bugzilla/Bugzilla36955.cs | 4 +- .../Tests/Issues/Bugzilla/Bugzilla40092.cs | 12 +++ .../Tests/Issues/Bugzilla/Bugzilla41415.cs | 25 +++--- .../Tests/Issues/XFIssue/Issue2818.cs | 10 ++- .../Tests/Issues/XFIssue/Issue5132.cs | 9 +- 8 files changed, 80 insertions(+), 73 deletions(-) diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40092.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40092.cs index 22546f964ec0..a5d4b8d70e50 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40092.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla40092.cs @@ -40,10 +40,9 @@ protected override void Init() } - protected override void OnAppearing() + protected override async void OnAppearing() { base.OnAppearing(); - // As we going to use verifyscreenshot , so here just remove the displayalert. - //await DisplayAlert("Instruction", "If you see just the black color, the test pass. (Ignore the navigation bar)", Ok); + await DisplayAlert("Instruction", "If you see just the black color, the test pass. (Ignore the navigation bar)", Ok); } } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41415.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41415.cs index 7e2af7f84101..e0d98eb30e9f 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41415.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41415.cs @@ -14,8 +14,9 @@ public Bugzilla41415() var grid = new Grid { BackgroundColor = Colors.Yellow, - WidthRequest = 1000, - HeightRequest = 1000, + // To make this test works for desktop apps, we need to set a big size for the grid + WidthRequest = 3000, + HeightRequest = 3000, Children = { new BoxView diff --git a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue5132.cs b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue5132.cs index cb090c34551b..6b96f07e49de 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue5132.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue5132.cs @@ -10,17 +10,16 @@ protected override void Init() Title = "Shell"; FlyoutIcon = new FontImageSource { - Glyph = "\uf2fb", - FontFamily = DefaultFontFamily(), + Glyph = "\uf224", + FontFamily = "Ion", Size = 20, AutomationId = _idIconElement }; -#pragma warning disable CS0618 // Type or member is obsolete - FlyoutIcon.SetValue(AutomationProperties.HelpTextProperty, "This as Shell FlyoutIcon"); -#pragma warning restore CS0618 // Type or member is obsolete -#pragma warning disable CS0618 // Type or member is obsolete - FlyoutIcon.SetValue(AutomationProperties.NameProperty, "Shell Icon"); -#pragma warning restore CS0618 // Type or member is obsolete + + FlyoutIcon.SetValue(SemanticProperties.HintProperty, "This as Shell FlyoutIcon"); + + FlyoutIcon.SetValue(SemanticProperties.DescriptionProperty, "Shell Icon"); + Items.Add(new FlyoutItem { Title = _titleElement, @@ -34,39 +33,39 @@ protected override void Init() }); } - static string DefaultFontFamily() - { - var fontFamily = ""; -#pragma warning disable CS0618 // Type or member is obsolete -#pragma warning disable CS0618 // Type or member is obsolete -#pragma warning disable CS0618 // Type or member is obsolete -#pragma warning disable CS0618 // Type or member is obsolete -#pragma warning disable CS0612 // Type or member is obsolete -#pragma warning disable CS0612 // Type or member is obsolete -#pragma warning disable CS0612 // Type or member is obsolete -#pragma warning disable CS0612 // Type or member is obsolete - switch (Device.RuntimePlatform) - { - case Device.iOS: - fontFamily = "Ionicons"; - break; - case Device.WinUI: - fontFamily = "Assets/Fonts/ionicons.ttf#ionicons"; - break; - case Device.Android: - default: - fontFamily = "fonts/ionicons.ttf#"; - break; - } -#pragma warning restore CS0612 // Type or member is obsolete -#pragma warning restore CS0612 // Type or member is obsolete -#pragma warning restore CS0612 // Type or member is obsolete -#pragma warning restore CS0612 // Type or member is obsolete -#pragma warning restore CS0618 // Type or member is obsolete -#pragma warning restore CS0618 // Type or member is obsolete -#pragma warning restore CS0618 // Type or member is obsolete -#pragma warning restore CS0618 // Type or member is obsolete +// static string DefaultFontFamily() +// { +// var fontFamily = ""; +// #pragma warning disable CS0618 // Type or member is obsolete +// #pragma warning disable CS0618 // Type or member is obsolete +// #pragma warning disable CS0618 // Type or member is obsolete +// #pragma warning disable CS0618 // Type or member is obsolete +// #pragma warning disable CS0612 // Type or member is obsolete +// #pragma warning disable CS0612 // Type or member is obsolete +// #pragma warning disable CS0612 // Type or member is obsolete +// #pragma warning disable CS0612 // Type or member is obsolete +// switch (Device.RuntimePlatform) +// { +// case Device.iOS: +// fontFamily = "Ionicons"; +// break; +// case Device.WinUI: +// fontFamily = "Assets/Fonts/ionicons.ttf#ionicons"; +// break; +// case Device.Android: +// default: +// fontFamily = "fonts/ionicons.ttf#"; +// break; +// } +// #pragma warning restore CS0612 // Type or member is obsolete +// #pragma warning restore CS0612 // Type or member is obsolete +// #pragma warning restore CS0612 // Type or member is obsolete +// #pragma warning restore CS0612 // Type or member is obsolete +// #pragma warning restore CS0618 // Type or member is obsolete +// #pragma warning restore CS0618 // Type or member is obsolete +// #pragma warning restore CS0618 // Type or member is obsolete +// #pragma warning restore CS0618 // Type or member is obsolete - return fontFamily; - } +// return fontFamily; +// } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs index 7959a24cc938..1f46f0ce2aee 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -32,7 +32,7 @@ void ToggleSwitch() #elif IOS App.Tap(AppiumQuery.ByXPath("//XCUIElementTypeSwitch[@name='Toggle switch; nothing should crash']")); #elif MACCATALYST - App.ClickCoordinates(774,140); + App.ClickCoordinates(1051,198); #endif } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40092.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40092.cs index 73b1e83ffa70..781cac3f818c 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40092.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla40092.cs @@ -6,6 +6,13 @@ namespace Microsoft.Maui.TestCases.Tests.Issues; public class Bugzilla40092 : _IssuesUITest { + +#if MACCATALYST + const string Ok = "action-button--999"; +#else + const string Ok = "Ok"; +#endif + public Bugzilla40092(TestDevice testDevice) : base(testDevice) { } @@ -17,7 +24,12 @@ public Bugzilla40092(TestDevice testDevice) : base(testDevice) [Category(UITestCategories.BoxView)] public void AllScreenIsBlack() { +#if !ANDROID // Display alert not shown in android also this is not a needed one for ensuring this case, so ignored the below steps on Android. + App.WaitForElement(Ok); + App.Tap(Ok); +#else App.WaitForElement("black"); +#endif VerifyScreenshot(); } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41415.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41415.cs index 731e2bf3d61d..de05b96bfcce 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41415.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41415.cs @@ -1,4 +1,4 @@ -#if !IOS +#if TEST_FAILS_ON_ANDROID // ScrollY and ScrollX values are resetted on Android, Issue: using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -18,25 +18,20 @@ public Bugzilla41415UITests(TestDevice device) public override string Issue => "ScrollX and ScrollY values are not consistent with iOS"; - // Bugzilla41415 (src\Compatibility\ControlGallery\src\Issues.Shared\Bugzilla41415.cs) [Test] - [FailsOnIOSWhenRunningOnXamarinUITest("This test is failing, likely due to product issue")] - [FailsOnMacWhenRunningOnXamarinUITest("This test is failing, likely due to product issue")] public void Bugzilla41415Test() { - // This test is failing, likely due to product issue - App.WaitForElement(ButtonId); App.Tap(ButtonId); - App.WaitForNoElement("x: 100"); - App.WaitForNoElement("y: 100"); - App.WaitForNoElement("z: True", timeout: TimeSpan.FromSeconds(25)); - App.WaitForNoElement("a: True"); - App.Tap(ButtonId); - App.WaitForNoElement("x: 200"); - App.WaitForNoElement("y: 100"); - App.WaitForNoElement("z: True", timeout: TimeSpan.FromSeconds(25)); - App.WaitForNoElement("a: False"); + App.WaitForElementTillPageNavigationSettled("x: 100"); + App.WaitForElementTillPageNavigationSettled("y: 100"); + App.WaitForElement("z: True", timeout: TimeSpan.FromSeconds(25)); + App.WaitForElement("a: True"); + App.Tap(ButtonId); + App.WaitForElementTillPageNavigationSettled("y: 100"); + App.WaitForElement("z: True", timeout: TimeSpan.FromSeconds(25)); + App.WaitForElement("a: False"); + App.WaitForElementTillPageNavigationSettled("x: 200"); } } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs index d9a179ce8f02..7bcb31a78987 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2818.cs @@ -1,4 +1,6 @@ -#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS +#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS +// Orientation not supported in Catalyst and Windows +// On iOS FlyoutPage RTL is not working as expected, Issue: https://github.com/dotnet/maui/issues/26726 using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -33,9 +35,7 @@ public void RootViewMovesAndContentIsVisible() Assert.That(positionStart, Is.Not.EqualTo(secondPosition)); } - // Equivalent method for SendAppToBackground is not found in appium. - // In iOS While in landscape orientation and with the flow direction set to RightToLeft in IOS, the Flyout items are not displayed." - //[Test] + [Test] public void RootViewSizeDoesntChangeAfterBackground() { var idiom = App.WaitForElement("Idiom"); @@ -49,6 +49,8 @@ public void RootViewSizeDoesntChangeAfterBackground() App.Tap("OpenRootView"); var windowSize = App.WaitForElement("RootLayout"); App.BackgroundApp(); + App.WaitForNoElement("RootLayout"); + App.ForegroundApp(); var newWindowSize = App.WaitForElement("RootLayout"); Assert.That(newWindowSize.GetRect().Width, Is.EqualTo(windowSize.GetRect().Width)); Assert.That(newWindowSize.GetRect().Height, Is.EqualTo(windowSize.GetRect().Height)); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5132.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5132.cs index 9fe081383a9d..66acd5d24cb3 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5132.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5132.cs @@ -1,4 +1,4 @@ -#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWS // AutomationId not working on Android and Icon not override on Windows More Information: https://github.com/dotnet/maui/issues/1625 +//#if TEST_FAILS_ON_WINDOWS // Can't able to override the automation id property for Android, as it always with default value, Also in Windows we can't override the icon. More Information: https://github.com/dotnet/maui/issues/1625 using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -18,10 +18,9 @@ public Issue5132(TestDevice testDevice) : base(testDevice) [Category(UITestCategories.Shell)] public void ShellFlyoutAndHamburgerAutomationProperties() { - App.WaitForElement(_idIconElement); - App.Tap(_idIconElement); + App.WaitForElement(AppiumQuery.ByAccessibilityId(_idIconElement)); + App.Tap(AppiumQuery.ByAccessibilityId(_idIconElement)); App.WaitForElement("Connect"); } -} -#endif \ No newline at end of file +} \ No newline at end of file From 4f51707f720a18c9be178a63384660a2bf93bdb6 Mon Sep 17 00:00:00 2001 From: Anandhan Rajagopal <97146406+anandhan-rajagopal@users.noreply.github.com> Date: Fri, 20 Dec 2024 18:06:52 +0530 Subject: [PATCH 07/11] Updated Issue link --- .../Tests/Issues/Bugzilla/Bugzilla41415.cs | 2 +- .../TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5132.cs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41415.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41415.cs index de05b96bfcce..7fe583857937 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41415.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41415.cs @@ -1,4 +1,4 @@ -#if TEST_FAILS_ON_ANDROID // ScrollY and ScrollX values are resetted on Android, Issue: +#if TEST_FAILS_ON_ANDROID // ScrollY and ScrollX values are resetted on Android, Issue: https://github.com/dotnet/maui/issues/26747 using NUnit.Framework; using UITest.Appium; using UITest.Core; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5132.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5132.cs index 66acd5d24cb3..48d3fa92f1d6 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5132.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue5132.cs @@ -1,4 +1,4 @@ -//#if TEST_FAILS_ON_WINDOWS // Can't able to override the automation id property for Android, as it always with default value, Also in Windows we can't override the icon. More Information: https://github.com/dotnet/maui/issues/1625 +#if TEST_FAILS_ON_WINDOWS // Can't able to override the automation id property windows, as it always with default value. using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -23,4 +23,5 @@ public void ShellFlyoutAndHamburgerAutomationProperties() App.WaitForElement("Connect"); } -} \ No newline at end of file +} +#endif \ No newline at end of file From 60a72578c97465eda4f562116e249e054498fb6e Mon Sep 17 00:00:00 2001 From: Anandhan Rajagopal Date: Fri, 20 Dec 2024 20:48:23 +0530 Subject: [PATCH 08/11] Updated boxview height --- .../tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41415.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41415.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41415.cs index e0d98eb30e9f..143433087036 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41415.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla41415.cs @@ -21,8 +21,8 @@ public Bugzilla41415() { new BoxView { - WidthRequest = 200, - HeightRequest = 200, + WidthRequest = 2200, + HeightRequest = 2200, BackgroundColor = Colors.Red, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center From 6d068b41f9eca94d87280b1cad8e70c9e725635e Mon Sep 17 00:00:00 2001 From: Anandhan Rajagopal <97146406+anandhan-rajagopal@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:18:57 +0530 Subject: [PATCH 09/11] Added iOS and Android Images --- .../snapshots/android/AllScreenIsBlack.png | Bin 0 -> 3147 bytes .../snapshots/ios/AllScreenIsBlack.png | Bin 0 -> 875 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/Controls/tests/TestCases.Android.Tests/snapshots/android/AllScreenIsBlack.png create mode 100644 src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/AllScreenIsBlack.png diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/AllScreenIsBlack.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/AllScreenIsBlack.png new file mode 100644 index 0000000000000000000000000000000000000000..be765fbad36cf5d476d7c20d81c9847c4272759e GIT binary patch literal 3147 zcmeAS@N?(olHy`uVBq!ia0y~yV6k9eU^~vl3>0~!YWEXJDI|LY`7$t6sWC7#v@kII z0tz*}U|=XUU|@Kaz`$TNgMmT3V9u^U8=wSdfKQ04w4pnY`Tzg_)MoB1Ad4}{+uemJ zjk_iV$YC$>^mS!_!6PD|&3|oSEFS{{x3s5=V@SoVw-*c<84P$1ESNQ?Ub}YsdL{=Z z;{#_OFIFyT>AN6k<>dZ?Lw4aPXEY2()4^z77%dM*%f!)oVYE6NZ4!(&i-vL2Fk)fs zs@WY+pXvZx&Z;G@5hW>!C8<`)MX5lF!N|bKMAy(r*T^8m(9Fuj*vimU+rYrez#!M9 zaUzO_-29Zxv`X9>WF#$hff_X6Hk4%MrWThZ<`&@A4X;9rUBwPQe_b`DIQ$3d>o`OHukBi#H}YQ8GaT$j`c&op0O1}z|) zgMo=rh=Cc%Vgy2l_DlvAFq?q^m=1t|X#o>Vge7GGGmOm%Od$*m4|j0=15&Cbt`Q|E zi6yC4$wjF^iowXh$VAuBNY}_9#L&#j*uu)tSlhtB%D~{hf7E>x4Y~O#nQ4`{HLMeQ zlnm6M0k@$fGdH!kBr&%Dx1OKuhxY*Wh=BB@R%E7GxdI9Qw6x;X5(Z-n9fgbEWKRR- zrQz}cnH8xy5iUTJ^NKU`^B4>bjZAbD47XHl##9!GP-bLeY^I~&9QPL#rVO60elF{r G5}E+`C8nzY literal 0 HcmV?d00001 From d8cad8bfa758a858471a5470581ddee965acef4c Mon Sep 17 00:00:00 2001 From: Anandhan Rajagopal <97146406+anandhan-rajagopal@users.noreply.github.com> Date: Sat, 21 Dec 2024 20:36:57 +0530 Subject: [PATCH 10/11] Added windows and mac images and resolved CI failures --- .../snapshots/mac/AllScreenIsBlack.png | Bin 0 -> 41469 bytes .../Tests/Issues/Bugzilla/Bugzilla36955.cs | 13 +++++-------- .../Tests/Issues/Bugzilla/Bugzilla41415.cs | 8 +++++--- .../snapshots/windows/AllScreenIsBlack.png | Bin 0 -> 3894 bytes 4 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/AllScreenIsBlack.png create mode 100644 src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/AllScreenIsBlack.png diff --git a/src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/AllScreenIsBlack.png b/src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/AllScreenIsBlack.png new file mode 100644 index 0000000000000000000000000000000000000000..cbb8b7d946f339727fc5ca8d408bd4404c402496 GIT binary patch literal 41469 zcmeI4c{r49`^WD=j9rN$WNA^zE+S!gLPDaD&|(|PnrMnavP-hnXzWR{v?xMERI)_Y zhLWs9`&G_Mj>#J$p`@!3Y$~s6yBM;CcMB#y=uZyxwMU$Nc+!&T~taySta zt{+7Wxge(o`+AV+v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^0DL6;?w@ETD?(6*!ig5VDCR=exdF)P&KkffSm&?5Bc2^22 zQgpBs?1b4uC_B00`y3?e`+t02}~kZQBlH$ZM0aRjCMo1K^M) z018iX!S~nb3g7@ZYu_5s&sh~#0Gt&9pcA-ivCZ0X1Hb`r){YyX!A_xw18@Kwas)tw zeeE!^iV}bW;DFhO6#}45x@vG(`)U9<01oIOuMhyuuC+z$s*(-B0dQ7YJ^u&;bOP6g z)KvimzyWZ`5&)gRRbgfApbFpsIBVY;&Rsb9l0nqFsp@16z4x9u7`^&SWihRl~K36BP}p(BVu-9sq}g0&V~}a3&-VfI~t7Hvk+s6OsqO zA)$a901li9$phe!P{0iU2hN1#0dPnt;0AyLXF~D-I3yHs1HgeZA$b5C5(>Bh;J}%X zJOB;}1>68|;7mv!0EdJEZU8uNCL|AlLqY*J{-59=_iEBRo(@YNS>ARE($dgX&sMYa F{SWv0$6Wvb literal 0 HcmV?d00001 diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs index 1f46f0ce2aee..5e3888f86d66 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla36955.cs @@ -1,4 +1,5 @@ -using NUnit.Framework; +#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS //Unable to access the switch element directly when it placed inside the TableView, Also Hardcoded TapCoordinates don't work reliably in CI environments for desktop platforms. +using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -24,15 +25,11 @@ public void Bugzilla36955Test() } void ToggleSwitch() { - //Unable to access the switch element directly when it placed inside the TableView, so using TapCoordinates to tap on the switch -#if WINDOWS - App.TapCoordinates(1340,160); -#elif ANDROID +#if ANDROID App.TapCoordinates(1000, 100); #elif IOS App.Tap(AppiumQuery.ByXPath("//XCUIElementTypeSwitch[@name='Toggle switch; nothing should crash']")); -#elif MACCATALYST - App.ClickCoordinates(1051,198); #endif } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41415.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41415.cs index 7fe583857937..dc46fc030bca 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41415.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41415.cs @@ -23,13 +23,15 @@ public void Bugzilla41415Test() { App.WaitForElement(ButtonId); App.Tap(ButtonId); + App.WaitForElement(ButtonId); App.WaitForElementTillPageNavigationSettled("x: 100"); App.WaitForElementTillPageNavigationSettled("y: 100"); - App.WaitForElement("z: True", timeout: TimeSpan.FromSeconds(25)); + App.WaitForElement("z: True"); App.WaitForElement("a: True"); - App.Tap(ButtonId); + App.Tap(ButtonId); + App.WaitForElement(ButtonId); App.WaitForElementTillPageNavigationSettled("y: 100"); - App.WaitForElement("z: True", timeout: TimeSpan.FromSeconds(25)); + App.WaitForElement("z: True"); App.WaitForElement("a: False"); App.WaitForElementTillPageNavigationSettled("x: 200"); } diff --git a/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/AllScreenIsBlack.png b/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/AllScreenIsBlack.png new file mode 100644 index 0000000000000000000000000000000000000000..adc8ea09832d836572f778fb7d284e0583b4af17 GIT binary patch literal 3894 zcmbVP3s6&68ouhz>Z*lNyN`2Xf|whig(9LOuMmZVXCNdz0=A3^2>~IGd&|;l3ZrhV zP2H}m(x`PrsPE~@>Wb@wl|>y(y9AWk*>yz4vI=P}t)i(SNGjcqyU0y;$o=yl>oh~6XR1l*V3PaiFQG)0q9IeOj8)LvR zMgbt!h#3^)SQCyd!Eu06EM1MIWmsB{;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W1d1uw6jBxh^G8%E8FtM@|r;R1d^PGCM~b8VmL=T{j%zq z1McAa^u#H33t@+U@Rrdxo?p##H9Dc2)Ewct0XHtD-UpyKS-=GBrViSN{V@1h3HDN; zu8yJZKHb6ed&nm219sZ)y*^X;qB`B|j$AW29nIj6-kn$ZHy=d1&F|W6_l}175hU&5 zUZl(@k$2$jL94hP#2>X@xT6gMlZPdE>&!{VpZd%u!xiqlm>7|vbp0Bpvtd(7>|GxR^7nk>( z869dzd!p(WU(=l#zWL_*p05I4Yq)u6{ZwPWh`hJF3ydJiCr2IyEG;=A|f^-LP(CN$1Si@#bqV-$ro7c@^4^4h&MuInbq{` Z$|5U0`I Date: Sun, 22 Dec 2024 08:23:50 +0530 Subject: [PATCH 11/11] Update Bugzilla41415.cs --- .../Tests/Issues/Bugzilla/Bugzilla41415.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41415.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41415.cs index dc46fc030bca..a2db9dfedb0b 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41415.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla41415.cs @@ -1,4 +1,6 @@ -#if TEST_FAILS_ON_ANDROID // ScrollY and ScrollX values are resetted on Android, Issue: https://github.com/dotnet/maui/issues/26747 +#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWS +// On Android ScrollY and ScrollX values are resetted, Issue: https://github.com/dotnet/maui/issues/26747 +// On Windows tests are failing in CI, but not locally. Need to investigate more. using NUnit.Framework; using UITest.Appium; using UITest.Core;