Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue18193.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ public Issue18193()
tabBar.Items.Add(CreateShellContent("Page 6", typeof(Issue18193Page6), nameof(Issue18193Page6)));
//Added the TabBar Items ,this will show overflow menu in Windows
//to access the extra pages, keeping the interface clean and easy to navigate.
tabBar.Items.Add(CreateShellContent("Page 7", typeof(Issue18193Page2), nameof(Issue18193Page7)));
tabBar.Items.Add(CreateShellContent("Page 8", typeof(Issue18193Page3), nameof(Issue18193Page8)));
tabBar.Items.Add(CreateShellContent("Page 9", typeof(Issue18193Page4), nameof(Issue18193Page9)));
tabBar.Items.Add(CreateShellContent("Page 10", typeof(Issue18193Page5), nameof(Issue18193Page10)));
tabBar.Items.Add(CreateShellContent("Page 11", typeof(Issue18193Page6), nameof(Issue18193Page11)));
tabBar.Items.Add(CreateShellContent("Page 12", typeof(Issue18193Page2), nameof(Issue18193Page12)));
tabBar.Items.Add(CreateShellContent("Page 13", typeof(Issue18193Page3), nameof(Issue18193Page13)));
tabBar.Items.Add(CreateShellContent("Page 7", typeof(Issue18193Page7), nameof(Issue18193Page7)));
tabBar.Items.Add(CreateShellContent("Page 8", typeof(Issue18193Page8), nameof(Issue18193Page8)));
tabBar.Items.Add(CreateShellContent("Page 9", typeof(Issue18193Page9), nameof(Issue18193Page9)));
tabBar.Items.Add(CreateShellContent("Page 10", typeof(Issue18193Page10), nameof(Issue18193Page10)));
tabBar.Items.Add(CreateShellContent("Page 11", typeof(Issue18193Page11), nameof(Issue18193Page11)));
tabBar.Items.Add(CreateShellContent("Page 12", typeof(Issue18193Page12), nameof(Issue18193Page12)));
tabBar.Items.Add(CreateShellContent("Page 13", typeof(Issue18193Page13), nameof(Issue18193Page13)));
Items.Add(tabBar);
Routing.RegisterRoute(nameof(Issue18193DetailPage), typeof(Issue18193DetailPage));
}
Expand All @@ -38,9 +38,9 @@ class Issue18193MainPage : ContentPage
{
public Issue18193MainPage()
{
var button = new Button() { AutomationId = "NavigationToPage6Button", Text = "Navigate to page 6" };
button.Clicked += (s, e) => Issue18193.Current.GoToAsync("//" + nameof(Issue18193Page6));
Content = button;
Button sixthPageButton = new Button() { AutomationId = "NavigationToPageSixthButton", Text = "Navigate to page 6" };
sixthPageButton.Clicked += (s, e) => Issue18193.Current.GoToAsync("//" + nameof(Issue18193Page6));
Content = sixthPageButton;
}
}

Expand All @@ -49,9 +49,9 @@ class Issue18193DetailPage : ContentPage
public Issue18193DetailPage()
{
Title = "Detail Page";
var button = new Button() { AutomationId = "NavigateBackButton", Text = "Navigate back" };
button.Clicked += (s, e) => Issue18193.Current.GoToAsync("..");
Content = button;
Button backButton = new Button() { AutomationId = "NavigateBackButton", Text = "Navigate back" };
backButton.Clicked += (s, e) => Issue18193.Current.GoToAsync("..");
Content = backButton;
}
}

Expand All @@ -63,7 +63,7 @@ public Issue18193Page2()
{
Text = "Navigate to page 5",
Command = new Command(async () => await Issue18193.Current.GoToAsync("//" + nameof(Issue18193Page5))),
AutomationId = "NavigateToPage5Button"
AutomationId = "NavigateToPageFiveButton"
};
}
}
Expand Down Expand Up @@ -91,17 +91,17 @@ public class Issue18193Page6 : ContentPage
{
public Issue18193Page6()
{
var button = new Button() { AutomationId = "NavigateToDetailButton", Text = "Navigate to detail page" };
button.Clicked += (s, e) => Issue18193.Current.GoToAsync(nameof(Issue18193DetailPage));
Button detailPageButton = new Button() { AutomationId = "NavigateToDetailButton", Text = "Navigate to detail page" };
detailPageButton.Clicked += (s, e) => Issue18193.Current.GoToAsync(nameof(Issue18193DetailPage));

var button2 = new Button() { AutomationId = "NavigateToPage2Button", Text = "Navigate to Page 2" };
button2.Clicked += (s, e) => Issue18193.Current.GoToAsync("//" + nameof(Issue18193Page2));
Button secondPageButton = new Button() { AutomationId = "NavigateToPageTwoButton", Text = "Navigate to Page 2" };
secondPageButton.Clicked += (s, e) => Issue18193.Current.GoToAsync("//" + nameof(Issue18193Page2));
Content = new StackLayout
{
Children =
{
button,
button2
detailPageButton,
secondPageButton
}
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if TEST_FAILS_ON_CATALYST //related issue: https://github.com/dotnet/maui/issues/27206
using NUnit.Framework;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -17,19 +16,31 @@ public Issue18193(TestDevice testDevice) : base(testDevice)
[Category(UITestCategories.Shell)]
public void ShellNavigationShouldWorkInMoreTab()
{
App.WaitForElementTillPageNavigationSettled("Navigate to page 6");
App.Tap("Navigate to page 6");
App.WaitForElementTillPageNavigationSettled("Navigate to detail page");
App.Tap("Navigate to detail page");
App.WaitForElementTillPageNavigationSettled("Navigate back");
App.Tap("Navigate back");
App.WaitForElementTillPageNavigationSettled("Navigate to Page 2");
App.Tap("Navigate to Page 2");
App.WaitForElementTillPageNavigationSettled("Navigate to page 5");
App.Tap("Navigate to page 5");
App.WaitForElementTillPageNavigationSettled("NavigationToPageSixthButton");
App.Tap("NavigationToPageSixthButton");
App.WaitForElementTillPageNavigationSettled("NavigateToDetailButton");
bool navigationSucceeded = false;
for (int i = 0; i < 3 && !navigationSucceeded; i++)
{
try
{
App.Tap("NavigateToDetailButton");
App.WaitForElementTillPageNavigationSettled("NavigateBackButton");
navigationSucceeded = true;
}
catch (Exception)
{
TestContext.WriteLine($"Timeout waiting for NavigateBackButton after tapping NavigateToDetailButton");
}
}
Assert.That(navigationSucceeded, Is.True, "Navigation to Detail Page did not succeed after multiple attempts");
App.Tap("NavigateBackButton");
App.WaitForElementTillPageNavigationSettled("NavigateToPageTwoButton");
App.Tap("NavigateToPageTwoButton");
App.WaitForElementTillPageNavigationSettled("NavigateToPageFiveButton");
App.Tap("NavigateToPageFiveButton");
App.WaitForElementTillPageNavigationSettled("More");
App.Tap("More");
}
}
}
#endif
}
Loading