-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Issue11247.cs
82 lines (72 loc) · 1.69 KB
/
Issue11247.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
77
78
79
80
81
82
using Xamarin.Forms.Internals;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Shapes;
using System.Collections.Generic;
using System;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
using Xamarin.Forms.Core.UITests;
#endif
namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.Shell)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 11247,
"[Bug] Shell FlyoutIsPresented not working if set in \"navigating\" handler",
PlatformAffected.iOS)]
public class Issue11247 : TestShell
{
protected override void Init()
{
var page = AddFlyoutItem("FlyoutItem 1");
AddFlyoutItem("FlyoutItem 2");
Items.Add(new MenuItem()
{
Text = "Click Me To Close Flyout",
AutomationId = "CloseFlyout",
Command = new Command(() =>
{
FlyoutIsPresented = false;
})
});
page.Content = new StackLayout()
{
Children =
{
new Label()
{
Text = "If the flyout wasn't open when this test started the test has failed"
},
new Label()
{
Text = "Now, Open the Flyout and Click on FlyoutItem 2. Nothing should happen and flyout should remain open"
}
}
};
}
protected override void OnNavigating(ShellNavigatingEventArgs args)
{
base.OnNavigating(args);
if (args.CanCancel)
{
args.Cancel();
}
FlyoutIsPresented = true;
}
#if UITEST && __SHELL__
[Test]
public void SettingFlyoutIsPresentedInNavigatingKeepsFlyoutOpen()
{
RunningApp.Tap("CloseFlyout");
ShowFlyout();
RunningApp.Tap("FlyoutItem 1");
RunningApp.Tap("FlyoutItem 2");
RunningApp.WaitForElement("FlyoutItem 1");
RunningApp.WaitForElement("FlyoutItem 2");
}
#endif
}
}