-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Issue7290.cs
76 lines (67 loc) · 1.7 KB
/
Issue7290.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
using Xamarin.Forms.Core.UITests;
#endif
namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 7290, "[Android] DisplayActionSheet or DisplayAlert in OnAppearing does not work on Shell",
PlatformAffected.Android)]
#if UITEST
[NUnit.Framework.Category(UITestCategories.Shell)]
#endif
public class Issue7290 : TestShell
{
protected override void Init()
{
ContentPage displayAlertPage = new ContentPage()
{
Content = new StackLayout()
{
Children =
{
new Label{ Text = "If you did not see an alert this test has failed."},
}
},
Title = "Display Alert"
};
displayAlertPage.Appearing += async (_, __) =>
{
await displayAlertPage.DisplayAlert("Title", "Close Alert", "Cancel");
this.CurrentItem = Items[1];
};
ContentPage actionSheetPage = new ContentPage()
{
Content = new StackLayout()
{
Children =
{
new Label{ Text = "If you did not see an Alert then an Action Sheet this test has failed"},
}
},
Title = "Display Action Sheet"
};
actionSheetPage.Appearing += async (_, __) =>
{
await actionSheetPage.DisplayActionSheet("Title", "Cancel", "Close Action Sheet", "Button");
};
AddContentPage(displayAlertPage);
AddContentPage(actionSheetPage);
}
#if UITEST
[Test]
public void DisplayActionSheetAndDisplayAlertFromOnAppearing()
{
RunningApp.Tap("Cancel");
RunningApp.Tap("Close Action Sheet");
}
#endif
}
}