Skip to content

Commit 25152b1

Browse files
committed
Added UI Test
1 parent ede1059 commit 25152b1

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
namespace Maui.Controls.Sample.Issues;
2+
3+
[Issue(IssueTracker.Github, 29798, "Tab becomes blank after specific navigation pattern", PlatformAffected.iOS)]
4+
public class Issue29798 : Shell
5+
{
6+
public Issue29798()
7+
{
8+
Routing.RegisterRoute(nameof(Issue29798Page), typeof(Issue29798Page));
9+
10+
Items.Add(new ShellContent()
11+
{
12+
Title = "Tab1",
13+
Content = new ContentPage()
14+
{
15+
Title = "Test",
16+
Content = new Button
17+
{
18+
Text = "Go to Page 2",
19+
AutomationId = "GotoPage2",
20+
Command = new Command(async () => await Current.GoToAsync(nameof(Issue29798Page)))
21+
}
22+
}
23+
});
24+
25+
Items[0].Items.Add(new ShellContent()
26+
{
27+
Content = new ContentPage()
28+
});
29+
}
30+
}
31+
32+
public class Issue29798Page : ContentPage
33+
{
34+
public Issue29798Page()
35+
{
36+
Title = "Page 2";
37+
Content = new StackLayout
38+
{
39+
Children =
40+
{
41+
new Label
42+
{
43+
AutomationId = "Page2Label",
44+
Text = "Welcome to Page 2"
45+
}
46+
}
47+
};
48+
}
49+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#if IOS
2+
using NUnit.Framework;
3+
using UITest.Appium;
4+
using UITest.Core;
5+
6+
namespace Microsoft.Maui.TestCases.Tests.Issues;
7+
8+
public class Issue29798 : _IssuesUITest
9+
{
10+
public Issue29798(TestDevice testDevice) : base(testDevice)
11+
{
12+
}
13+
14+
public override string Issue => "Tab becomes blank after specific navigation pattern";
15+
16+
[Test]
17+
[Category(UITestCategories.Shell)]
18+
public void TabShouldNotBeBlackAfterTabNavigation()
19+
{
20+
App.WaitForElement("GotoPage2");
21+
App.Tap("GotoPage2");
22+
App.WaitForElement("Page2Label");
23+
App.Tap("Tab1");
24+
App.WaitForElement("GotoPage2");
25+
App.Tap("GotoPage2");
26+
App.WaitForElement("Page2Label");
27+
App.Tap("Tab1");
28+
App.WaitForElement("GotoPage2");
29+
}
30+
}
31+
#endif

0 commit comments

Comments
 (0)