-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Issue2837.cs
42 lines (37 loc) · 1.08 KB
/
Issue2837.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif
namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[NUnit.Framework.Category(Core.UITests.UITestCategories.Github5000)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 2837, " Exception thrown during NavigationPage.Navigation.PopAsync", PlatformAffected.Android)]
public class Issue2837 : TestNavigationPage // or TestMasterDetailPage, etc ...
{
string _labelText = "worked";
protected override async void Init()
{
// Initialize ui here instead of ctor
await PushAsync(new ContentPage() { Title = "MainPage" });
}
protected override async void OnAppearing()
{
var nav = (NavigationPage)this;
nav.Navigation.InsertPageBefore(new ContentPage() { Title = "SecondPage ", Content = new Label { Text = _labelText } }, nav.CurrentPage);
await nav.Navigation.PopAsync(false);
base.OnAppearing();
}
#if UITEST
[Test]
public void Issue2837Test()
{
RunningApp.WaitForElement(q => q.Text(_labelText));
}
#endif
}
}