-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Issue7311.cs
63 lines (52 loc) · 1.49 KB
/
Issue7311.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
using System;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
using Xamarin.UITest.iOS;
#endif
namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 7311, "[Bug] [Android] Error back hardware button with Picker", PlatformAffected.Android)]
public class Issue7311 : TestContentPage
{
const string FirstPickerItem = "Uno";
const string PickerId = "CaptainPickard";
readonly string[] _items = { FirstPickerItem, "Dos", "Tres" };
protected override void Init()
{
var picker = new Picker
{
ItemsSource = _items,
AutomationId = PickerId
};
Content = new StackLayout()
{
Children =
{
new Label()
{
Text = "Open Picker. Click hardware back button to close picker. Click hardware button a second time and it should navigate back to gallery"
},
picker
}
};
}
#if UITEST && __ANDROID__
[Test]
public void OpeningPickerPressingBackButtonTwiceShouldNotOpenPickerAgain()
{
RunningApp.WaitForElement(PickerId);
RunningApp.Tap(PickerId);
RunningApp.WaitForElement(FirstPickerItem);
RunningApp.Back();
RunningApp.WaitForNoElement(FirstPickerItem);
RunningApp.Back();
RunningApp.WaitForNoElement(FirstPickerItem, "Picker is again visible after second back button press", TimeSpan.FromSeconds(10));
RunningApp.Screenshot("Back at the previous page, not showing the picker again");
}
#endif
}
}