-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Issue2809.cs
59 lines (50 loc) · 1.26 KB
/
Issue2809.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
using System;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using NUnit.Framework;
using Xamarin.UITest;
using Xamarin.UITest.Android;
using Xamarin.Forms.Core.UITests;
#endif
namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.DisplayAlert)]
[NUnit.Framework.Category(UITestCategories.UwpIgnore)]
[NUnit.Framework.Category(Core.UITests.UITestCategories.Github5000)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 2809, "Secondary ToolbarItems cause app to hang during PushAsync", PlatformAffected.iOS)]
public class Issue2809 : TestContentPage
{
protected override void Init()
{
ToolbarItems.Add(new ToolbarItem("Item 1", string.Empty,
DummyAction, ToolbarItemOrder.Secondary));
ToolbarItems.Add(new ToolbarItem("Item 2", string.Empty,
DummyAction, ToolbarItemOrder.Secondary));
}
public void DummyAction()
{
}
#if UITEST
[Test]
public void TestPageDoesntCrash()
{
ShouldShowMenu();
RunningApp.Tap(c => c.Marked("Item 1"));
RunningApp.Screenshot("Didn't crash");
}
void ShouldShowMenu()
{
#if __ANDROID__
//show secondary menu
RunningApp.TapOverflowMenuButton();
#elif __WINDOWS__
RunningApp.Tap ("MoreButton");
#endif
}
#endif
}
}