summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-MapUITests.cs
blob: f2d55f3e6ee733ab2932fe0ee4ef4e1af45a4995 (plain)
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
using NUnit.Framework;
using Xamarin.UITest;
using System.Diagnostics;
using System.Threading;
using Xamarin.UITest.Queries;

namespace Xamarin.Forms.Core.UITests
{
	[TestFixture]
	[Category ("Map")]
	internal class MapGalleryTests : BaseTestFixture
	{
		// TODO - Figure out how to implement the map stuff for Android, ie query pins etc
		// TODO: Port to new conventions

		public MapGalleryTests ()
		{
			ShouldResetPerFixture = false;
		}

		protected override void NavigateToGallery ()
		{
			App.NavigateToGallery (GalleryQueries.MapGalleryLegacy);
		}

		[Test]
		[Description ("Gallery element are present")]
		public void MapGalleryAllElementsPresent ()
		{
		//	CustomScrollDownToBottomForAllElements ();
		//	App.Screenshot ("All elements exist");
		}

		//[Test]
		//[Description ("Change MapMapType")]
		//public void MapGalleryMapType ()
		//{
		//	AppRect screenBounds = App.MainScreenBounds ();
		//	App.DragFromToForElement (5, q => q.Button ("Map Type"), screenBounds.Width - 15, screenBounds.Height - 100, screenBounds.Width - 15, 15);
		//	App.Tap (q => q.Button ("Map Type"));
		//	App.Screenshot ("Selected Map Type");
		//	App.Tap (q => q.Button ("Satellite"));
		//	App.Screenshot ("Satellite MapType selected");
		//	App.DragFromToForElement (5, PlatformQueries.SearchBars, screenBounds.Width - 15, 75, screenBounds.Width - 15, screenBounds.Height - 100);
		//}


//		[Test]
//		public void PinDetails ()
//		{
//			App.Tap (q => q.Raw(PlatformStrings.MapPin + " index:0"));
//			App.WaitForElement (q => q.Marked ("Sistine Chapel"));
//			App.WaitForElement (q => q.Marked ("Piazza della Rotunda, 00186 Rome, Province of Rome, Italy"));
//
//			App.Screenshot ("First pin");
//
//			App.Tap (q => q.Raw(PlatformStrings.MapPin + " index:1"));
//			App.WaitForElement (q => q.Marked ("Pantheon"));
//			App.WaitForElement (q => q.Marked ("Piazza del Colosseo, 00186 Rome, Province of Rome, Italy"));
//
//			App.Screenshot ("Second pin");
//
//			App.Tap (q => q.Raw(PlatformStrings.MapPin + " index:2"));
//			App.WaitForElement (q => q.Marked ("Colosseum"));
//			App.WaitForElement (q => q.Marked ("Piazza del Colosseo, 00184 Rome, Province of Rome, Italy"));
//
//			App.Screenshot ("Third pin");
//		}


		//void CustomScrollDownToBottomForAllElements ()
		//{
		//	AppRect screenBounds = App.MainScreenBounds ();

		//	App.DragFromToForElement (5, PlatformQueries.SearchBars, screenBounds.Width - 15, screenBounds.Height - 100, screenBounds.Width - 15, 15);
		//	App.DragFromToForElement (5, PlatformQueries.Map, screenBounds.Width - 15, screenBounds.Height - 100, screenBounds.Width - 15, 15);

		//	App.DragFromToForElement (5, q => q.Button ("Map Type"), screenBounds.Width - 15, screenBounds.Height - 100, screenBounds.Width - 15, 15);
		//	App.DragFromToForElement (5, q => q.Button ("Zoom In"), screenBounds.Width - 15, screenBounds.Height - 100, screenBounds.Width - 15, 15);
		//	App.DragFromToForElement (5, q => q.Button ("Zoom Out"), 15, screenBounds.Height - 100, 15, 15);
		//	App.DragFromToForElement (5, q => q.Button ("Address From Position"), screenBounds.Width - 15, screenBounds.Height - 100, screenBounds.Width - 15, 15);
		//}

/*******************************************************/
/**************** Landscape tests **********************/
/*******************************************************/

		//[Test]
		//[Description ("Gallery element are present - Landscape")]
		//public void MapGalleryAllElementsPresentLandscape ()
		//{
		//	App.SetOrientationLandscape ();
		//	App.Screenshot ("Rotated to Landscape");
		//	MapGalleryAllElementsPresent ();
		//	App.SetOrientationPortrait ();
		//	App.Screenshot ("Rotated to Portrait");
		//}

		//[Test]
		//[Description ("Change MapMapType - Landscape")]
		//public void MapGalleryMapTypeLandscape ()
		//{
		//	App.SetOrientationLandscape ();
		//	App.Screenshot ("Rotated to Landscape");
		//	MapGalleryMapType ();
		//	App.SetOrientationPortrait ();
		//	App.Screenshot ("Rotated to Portrait");
		//}
	}
}