Skip to content

Commit 8eab1e5

Browse files
TamilarasanSF4853PureWeen
authored andcommitted
Revert PR #31653 : [Testing] Enable UITest Issue18193 on MacCatalyst (#33393)
This pull request updates UI test cases by reverting Shell navigation test changes that continue to fail in Mac CI. - ShellNavigationShouldWorkInMoreTab test case was previously failing in CI on the Mac platform but was passing locally. Therefore, this PR #31653 was created to resolve the issue. However, the ShellNavigationShouldWorkInMoreTab test still fails in CI on the Mac platform even after the changes. So, the changes from #31653 were reverted.
1 parent dc80e74 commit 8eab1e5

File tree

2 files changed

+34
-45
lines changed

2 files changed

+34
-45
lines changed

src/Controls/tests/TestCases.HostApp/Issues/Issue18193.cs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ public Issue18193()
1515
tabBar.Items.Add(CreateShellContent("Page 6", typeof(Issue18193Page6), nameof(Issue18193Page6)));
1616
//Added the TabBar Items ,this will show overflow menu in Windows
1717
//to access the extra pages, keeping the interface clean and easy to navigate.
18-
tabBar.Items.Add(CreateShellContent("Page 7", typeof(Issue18193Page7), nameof(Issue18193Page7)));
19-
tabBar.Items.Add(CreateShellContent("Page 8", typeof(Issue18193Page8), nameof(Issue18193Page8)));
20-
tabBar.Items.Add(CreateShellContent("Page 9", typeof(Issue18193Page9), nameof(Issue18193Page9)));
21-
tabBar.Items.Add(CreateShellContent("Page 10", typeof(Issue18193Page10), nameof(Issue18193Page10)));
22-
tabBar.Items.Add(CreateShellContent("Page 11", typeof(Issue18193Page11), nameof(Issue18193Page11)));
23-
tabBar.Items.Add(CreateShellContent("Page 12", typeof(Issue18193Page12), nameof(Issue18193Page12)));
24-
tabBar.Items.Add(CreateShellContent("Page 13", typeof(Issue18193Page13), nameof(Issue18193Page13)));
18+
tabBar.Items.Add(CreateShellContent("Page 7", typeof(Issue18193Page2), nameof(Issue18193Page7)));
19+
tabBar.Items.Add(CreateShellContent("Page 8", typeof(Issue18193Page3), nameof(Issue18193Page8)));
20+
tabBar.Items.Add(CreateShellContent("Page 9", typeof(Issue18193Page4), nameof(Issue18193Page9)));
21+
tabBar.Items.Add(CreateShellContent("Page 10", typeof(Issue18193Page5), nameof(Issue18193Page10)));
22+
tabBar.Items.Add(CreateShellContent("Page 11", typeof(Issue18193Page6), nameof(Issue18193Page11)));
23+
tabBar.Items.Add(CreateShellContent("Page 12", typeof(Issue18193Page2), nameof(Issue18193Page12)));
24+
tabBar.Items.Add(CreateShellContent("Page 13", typeof(Issue18193Page3), nameof(Issue18193Page13)));
2525
Items.Add(tabBar);
2626
Routing.RegisterRoute(nameof(Issue18193DetailPage), typeof(Issue18193DetailPage));
2727
}
@@ -38,9 +38,9 @@ class Issue18193MainPage : ContentPage
3838
{
3939
public Issue18193MainPage()
4040
{
41-
Button sixthPageButton = new Button() { AutomationId = "NavigationToPageSixthButton", Text = "Navigate to page 6" };
42-
sixthPageButton.Clicked += (s, e) => Issue18193.Current.GoToAsync("//" + nameof(Issue18193Page6));
43-
Content = sixthPageButton;
41+
var button = new Button() { AutomationId = "NavigationToPage6Button", Text = "Navigate to page 6" };
42+
button.Clicked += (s, e) => Issue18193.Current.GoToAsync("//" + nameof(Issue18193Page6));
43+
Content = button;
4444
}
4545
}
4646

@@ -49,9 +49,9 @@ class Issue18193DetailPage : ContentPage
4949
public Issue18193DetailPage()
5050
{
5151
Title = "Detail Page";
52-
Button backButton = new Button() { AutomationId = "NavigateBackButton", Text = "Navigate back" };
53-
backButton.Clicked += (s, e) => Issue18193.Current.GoToAsync("..");
54-
Content = backButton;
52+
var button = new Button() { AutomationId = "NavigateBackButton", Text = "Navigate back" };
53+
button.Clicked += (s, e) => Issue18193.Current.GoToAsync("..");
54+
Content = button;
5555
}
5656
}
5757

@@ -63,7 +63,7 @@ public Issue18193Page2()
6363
{
6464
Text = "Navigate to page 5",
6565
Command = new Command(async () => await Issue18193.Current.GoToAsync("//" + nameof(Issue18193Page5))),
66-
AutomationId = "NavigateToPageFiveButton"
66+
AutomationId = "NavigateToPage5Button"
6767
};
6868
}
6969
}
@@ -91,17 +91,17 @@ public class Issue18193Page6 : ContentPage
9191
{
9292
public Issue18193Page6()
9393
{
94-
Button detailPageButton = new Button() { AutomationId = "NavigateToDetailButton", Text = "Navigate to detail page" };
95-
detailPageButton.Clicked += (s, e) => Issue18193.Current.GoToAsync(nameof(Issue18193DetailPage));
94+
var button = new Button() { AutomationId = "NavigateToDetailButton", Text = "Navigate to detail page" };
95+
button.Clicked += (s, e) => Issue18193.Current.GoToAsync(nameof(Issue18193DetailPage));
9696

97-
Button secondPageButton = new Button() { AutomationId = "NavigateToPageTwoButton", Text = "Navigate to Page 2" };
98-
secondPageButton.Clicked += (s, e) => Issue18193.Current.GoToAsync("//" + nameof(Issue18193Page2));
97+
var button2 = new Button() { AutomationId = "NavigateToPage2Button", Text = "Navigate to Page 2" };
98+
button2.Clicked += (s, e) => Issue18193.Current.GoToAsync("//" + nameof(Issue18193Page2));
9999
Content = new StackLayout
100100
{
101101
Children =
102102
{
103-
detailPageButton,
104-
secondPageButton
103+
button,
104+
button2
105105
}
106106
};
107107
}
Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using NUnit.Framework;
1+
#if TEST_FAILS_ON_CATALYST //related issue: https://github.com/dotnet/maui/issues/27206
2+
using NUnit.Framework;
23
using UITest.Appium;
34
using UITest.Core;
45

@@ -16,31 +17,19 @@ public Issue18193(TestDevice testDevice) : base(testDevice)
1617
[Category(UITestCategories.Shell)]
1718
public void ShellNavigationShouldWorkInMoreTab()
1819
{
19-
App.WaitForElementTillPageNavigationSettled("NavigationToPageSixthButton");
20-
App.Tap("NavigationToPageSixthButton");
21-
App.WaitForElementTillPageNavigationSettled("NavigateToDetailButton");
22-
bool navigationSucceeded = false;
23-
for (int i = 0; i < 3 && !navigationSucceeded; i++)
24-
{
25-
try
26-
{
27-
App.Tap("NavigateToDetailButton");
28-
App.WaitForElementTillPageNavigationSettled("NavigateBackButton");
29-
navigationSucceeded = true;
30-
}
31-
catch (Exception)
32-
{
33-
TestContext.WriteLine($"Timeout waiting for NavigateBackButton after tapping NavigateToDetailButton");
34-
}
35-
}
36-
Assert.That(navigationSucceeded, Is.True, "Navigation to Detail Page did not succeed after multiple attempts");
37-
App.Tap("NavigateBackButton");
38-
App.WaitForElementTillPageNavigationSettled("NavigateToPageTwoButton");
39-
App.Tap("NavigateToPageTwoButton");
40-
App.WaitForElementTillPageNavigationSettled("NavigateToPageFiveButton");
41-
App.Tap("NavigateToPageFiveButton");
20+
App.WaitForElementTillPageNavigationSettled("Navigate to page 6");
21+
App.Tap("Navigate to page 6");
22+
App.WaitForElementTillPageNavigationSettled("Navigate to detail page");
23+
App.Tap("Navigate to detail page");
24+
App.WaitForElementTillPageNavigationSettled("Navigate back");
25+
App.Tap("Navigate back");
26+
App.WaitForElementTillPageNavigationSettled("Navigate to Page 2");
27+
App.Tap("Navigate to Page 2");
28+
App.WaitForElementTillPageNavigationSettled("Navigate to page 5");
29+
App.Tap("Navigate to page 5");
4230
App.WaitForElementTillPageNavigationSettled("More");
4331
App.Tap("More");
4432
}
4533
}
46-
}
34+
}
35+
#endif

0 commit comments

Comments
 (0)