summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-InputIntentUITests.cs
blob: 8a0bb96505a3456d8ad6d285e3b3aca291057ef4 (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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
using System;
using System.Collections.Generic;
using System.Threading;
using NUnit.Framework;
using Xamarin.UITest;
using Xamarin.UITest.Queries;

namespace Xamarin.Forms.Core.UITests
{
	[TestFixture]
	[Category ("Entry")]
	internal class InputIntentGalleryTests : BaseTestFixture
	{
		// TODO: Detect keyboard types, fix scroll coordinates
		// TODO: Port to new conventions

		public InputIntentGalleryTests ()
		{
			ShouldResetPerFixture = false;
		}

		protected override void NavigateToGallery ()
		{
			App.NavigateToGallery (GalleryQueries.InputIntentGalleryLegacy);
		}
		
		[Test]
		[Description ("All entries are shown")]
		public void InputIntentGalleryAllElementsExist ()
		{
//			var inputs = new [] {
//				"Default",
//				"Email Input",
//				"Text Input",
//				"Url Input",
//				"Numeric Input",
//				"Telephone Input", 
//				"Chat Input",
//				"Custom Entry"
//			};

//			foreach (var input in inputs)
//				App.ScrollDownForElement (PlatformQueries.EntryWithPlaceholder (input), 5);

//			App.Screenshot ("All Entries exist");
		}

//		[Test]
//		[Description ("Tap each entry and dismiss keyboard by tapping outside of keyboard")]
//		public void InputIntentGalleryTapEachEntry ()
//		{
//			AppRect screenSize = App.MainScreenBounds ();
//			var numberOfEntries = App.Query (PlatformQueries.Entrys).Length;
//			App.Screenshot ("Tap each entry");

//			var inputs = new List<string> () {
//				"Default",
//				"Email Input",
//				"Text Input",
//				"Url Input",
//				"Numeric Input",
//				"Telephone Input", 
//				"Chat Input",
//				"Custom Entry"
//			};

//			foreach (var input in inputs) {
//				App.ScrollDownForElement (PlatformQueries.EntryWithPlaceholder (input), 5);
//				App.Tap (PlatformQueries.EntryWithPlaceholder (input));
//				App.Screenshot ("Input Tapped: " + input);
//				App.TapCoordinates (5, screenSize.Height / 3);
//				App.Screenshot ("Clicked main screen, keyboard should be dismissed");
//			}
				
//			App.ScrollUpForElement (q => q.Marked ("Custom Focused"), 5);

//			App.Screenshot ("Label should now say 'Custom Focused'");
//		}

//		[Test]
//		[Description ("Enter text in each entry")]
//		public void InputIntentGalleryEnterTextInEachEnry ()
//		{

//			AppRect screenSize = App.MainScreenBounds ();

//			var inputs = new Dictionary<string, string> () {
//				{ "Default", "abc Quick weee!" },
//				{ "Email Input", "s@test.com" },
//				{ "Text Input", "Hi, I am text!" },
//				{ "Url Input", "https://www.xamarin.com/" },
//				{ "Numeric Input", "12345678910" }, 
//				{ "Telephone Input", "0000001234" }, 
//				{ "Chat Input", "Sorry, I wasn\'t paying attention." }, 
//				{ "Custom Entry", "I should be custom" }
//			};

//			App.Screenshot ("Enter text in each input");

//			foreach (var input in inputs) {
//				App.ScrollDownForElement (PlatformQueries.EntryWithPlaceholder (input.Key), 5);
//				App.Tap (PlatformQueries.EntryWithPlaceholder (input.Key));
//				App.EnterText (PlatformQueries.EntryWithPlaceholder (input.Key), input.Value);
//				App.Screenshot ("Text entered");
//				App.TapCoordinates (5, screenSize.Height / 3);
//				App.Screenshot ("Clicked main screen, keyboard should be dismissed");
//			}
				
//		}

//		[Test]
//		[Description ("Open keyboard and navigate back without dismissing")]
//		public void InputIntentGalleryNavigateBackWithoutDismissingKeyboard ()
//		{
//			// Should catch any regression of Issue #638, #928
//			var inputs = new List<string> () {
//				"Default",
//				"Email Input",
//				"Text Input",
//				"Url Input",
//				"Numeric Input",
//				"Telephone Input", 
//				"Chat Input",
//				"Custom Entry"
//			};

//			foreach (string input in inputs) {
//				App.ScrollDownForElement (PlatformQueries.EntryWithPlaceholder (input), 5);
//				App.Tap (PlatformQueries.EntryWithPlaceholder (input));
//				App.Screenshot ("Input Tapped");

//				App.Tap (PlatformQueries.Back);
//				App.Screenshot ("Back at Control Gallery");
//				App.ScrollDownForElement (q => q.Button ("InputIntent"), 2);
//				App.Tap (q => q.Button ("InputIntent"));
//			}
//		}

//		[Test]
//		[Description ("All entries are shown - landscape")]
//		public void InputIntentGalleryAllElementsExistLandscape ()
//		{
//			App.SetOrientationLandscape ();
//			App.Screenshot ("Rotated to Landscape");
//			InputIntentGalleryAllElementsExist ();
//			App.SetOrientationPortrait ();
//			App.Screenshot ("Rotated to portrait");
//		}

//		[Test]
//		[Description ("Tap each entry and dismiss keyboard by tapping outside of keyboard - landscape")]
//		public void InputIntentGalleryTapEachEntryLandscape ()
//		{
//			App.SetOrientationLandscape ();
//			App.Screenshot ("Rotated to Landscape");
//			InputIntentGalleryTapEachEntry ();
//			App.SetOrientationPortrait ();
//			App.Screenshot ("Rotated to portrait");
//		}

//		[Test]
//		[Description ("Enter text in each entry")]
//		public void InputIntentGalleryEnterTextInEachEnryLandscape ()
//		{
//			App.SetOrientationLandscape ();
//			App.Screenshot ("Rotated to Landscape");
//			InputIntentGalleryEnterTextInEachEnry ();
//			App.SetOrientationPortrait ();
//			App.Screenshot ("Rotated to portrait");
//		}

//		[Test]
//		[Description ("Open keyboard and navigate back without dismissing")]
//		public void InputIntentGalleryNavigateBackWithoutDismissingKeyboardLandscape ()
//		{
//			App.SetOrientationLandscape ();
//			App.Screenshot ("Rotated to Landscape");
//			InputIntentGalleryNavigateBackWithoutDismissingKeyboard ();
//			App.SetOrientationPortrait ();
//			App.Screenshot ("Rotated to portrait");
//		}

	}
}