Skip to content

Commit 2de0152

Browse files
committed
Updated test file namespace
1 parent 83f41bf commit 2de0152

File tree

2 files changed

+61
-65
lines changed

2 files changed

+61
-65
lines changed
Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,61 @@
11
using System.Collections.ObjectModel;
22

3-
namespace Maui.Controls.Sample.Issues
3+
namespace Maui.Controls.Sample.Issues;
4+
5+
[Issue(IssueTracker.Github, 28098, "Returning back from navigation to MainPage would result in a blank screen", PlatformAffected.iOS)]
6+
public partial class Issue28098 : ContentPage
47
{
5-
[Issue(IssueTracker.Github, 28098, "Returning back from navigation to MainPage would result in a blank screen", PlatformAffected.iOS)]
6-
public partial class Issue28098 : ContentPage
8+
public Issue28098()
9+
{
10+
InitializeComponent();
11+
}
12+
13+
protected override void OnAppearing()
714
{
8-
public Issue28098()
9-
{
10-
InitializeComponent();
11-
}
12-
13-
protected override void OnAppearing()
14-
{
15-
base.OnAppearing();
16-
_viewModel.OnAppearing();
17-
}
18-
private async void Button_Clicked(object sender, EventArgs e)
19-
{
20-
await Navigation.PushModalAsync(new ActionPage());
21-
}
15+
base.OnAppearing();
16+
_viewModel.OnAppearing();
2217
}
18+
private async void Button_Clicked(object sender, EventArgs e)
19+
{
20+
await Navigation.PushModalAsync(new ActionPage());
21+
}
22+
}
2323

24-
public class ActionPage : ContentPage
24+
public class ActionPage : ContentPage
25+
{
26+
public ActionPage()
2527
{
26-
public ActionPage()
27-
{
28-
var button = new Button { Text = "GoBack", AutomationId = "BackButton" };
29-
button.Clicked += async (s, e) => await Navigation.PopModalAsync();
30-
Content = button;
31-
}
28+
var button = new Button { Text = "GoBack", AutomationId = "BackButton" };
29+
button.Clicked += async (s, e) => await Navigation.PopModalAsync();
30+
Content = button;
3231
}
32+
}
33+
34+
public class MainPageViewModel
35+
{
36+
public Command LoadItemsCommand { get; }
37+
public ObservableCollection<Item> Items { get; }
3338

34-
public class MainPageViewModel
39+
public void OnAppearing()
3540
{
36-
public Command LoadItemsCommand { get; }
37-
public ObservableCollection<Item> Items { get; }
38-
39-
public void OnAppearing()
40-
{
41-
LoadItemsCommand.Execute(null);
42-
}
43-
44-
void ExecuteLoadItemsCommand()
45-
{
46-
Items.Clear();
47-
Items.Add(new Item() { Name = "Item1" });
48-
Items.Add(new Item() { Name = "Item2" });
49-
}
50-
public MainPageViewModel()
51-
{
52-
Items = new ObservableCollection<Item>();
53-
54-
LoadItemsCommand = new Command(() => ExecuteLoadItemsCommand());
55-
}
41+
LoadItemsCommand.Execute(null);
5642
}
5743

58-
public class Item
44+
void ExecuteLoadItemsCommand()
45+
{
46+
Items.Clear();
47+
Items.Add(new Item() { Name = "Item1" });
48+
Items.Add(new Item() { Name = "Item2" });
49+
}
50+
public MainPageViewModel()
5951
{
60-
public string Name { get; set; }
52+
Items = new ObservableCollection<Item>();
53+
54+
LoadItemsCommand = new Command(() => ExecuteLoadItemsCommand());
6155
}
6256
}
57+
58+
public class Item
59+
{
60+
public string Name { get; set; }
61+
}

src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28098.cs

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,22 @@
22
using UITest.Appium;
33
using UITest.Core;
44

5-
namespace Microsoft.Maui.TestCases.Tests.Issues
5+
namespace Microsoft.Maui.TestCases.Tests.Issues;
6+
public class Issue28098 : _IssuesUITest
67
{
7-
public class Issue28098 : _IssuesUITest
8+
public override string Issue => "Returning back from navigation to MainPage would result in a blank screen";
9+
public Issue28098(TestDevice device) : base(device)
810
{
9-
public override string Issue => "Returning back from navigation to MainPage would result in a blank screen";
10-
public Issue28098(TestDevice device) : base(device)
11-
{
12-
}
11+
}
1312

14-
[Test]
15-
[Category(UITestCategories.CarouselView)]
16-
[Category(UITestCategories.CollectionView)]
17-
public void BlankScreenOnNavigationBack()
18-
{
19-
App.WaitForElement("Button");
20-
App.Tap("Button");
21-
App.WaitForElement("BackButton");
22-
App.Tap("BackButton");
23-
VerifyScreenshot();
24-
}
13+
[Test]
14+
[Category(UITestCategories.Picker)]
15+
public void BlankScreenOnNavigationBack()
16+
{
17+
App.WaitForElement("Button");
18+
App.Tap("Button");
19+
App.WaitForElement("BackButton");
20+
App.Tap("BackButton");
21+
VerifyScreenshot();
2522
}
26-
}
23+
}

0 commit comments

Comments
 (0)