-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Bugzilla39987.cs
84 lines (74 loc) · 1.83 KB
/
Bugzilla39987.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
83
84
using System;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Maps;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif
namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[NUnit.Framework.Category(Core.UITests.UITestCategories.Bugzilla)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 39987, "Bug 39987 - MapView not working correctly on iOS 9.3")]
public class Bugzilla39987 : TestTabbedPage // or TestMasterDetailPage, etc ...
{
const string TabTitle = "Test";
const string TestMap = "Map";
const string Ok = "Ok";
protected override void Init()
{
for (int i = 1; i <= 3; i++)
Children.Add(new CustomMapPage($"{TabTitle} {i}"));
}
protected override async void OnAppearing()
{
base.OnAppearing();
await DisplayAlert("Instructions", "Navigating for all tabs, if don't crash the test passed", Ok);
}
[Preserve(AllMembers = true)]
public class CustomMapView : View
{
public CustomMapView()
{
}
}
[Preserve(AllMembers = true)]
public class CustomMapPage : ContentPage
{
private CustomMapView _customMapView;
public CustomMapPage(string title)
{
var map = new Map
{
AutomationId = TestMap
};
Title = title;
Content = map;
}
public CustomMapPage(CustomMapView customMapView, string title)
{
Title = title;
_customMapView = customMapView;
_customMapView.HorizontalOptions = LayoutOptions.FillAndExpand;
_customMapView.VerticalOptions = LayoutOptions.FillAndExpand;
Content = _customMapView;
}
}
#if UITEST && __IOS__
[Test]
public void MapViewInTabbedPage()
{
RunningApp.WaitForElement(Ok);
RunningApp.Tap(Ok);
for (int i = 1; i <= 3; i++)
{
RunningApp.WaitForElement(TestMap);
RunningApp.Tap($"{TabTitle} {i}");
}
}
#endif
}
}