summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-GroupedListActionsUITests.cs
blob: 289b5389a23148af407de6bcbbb4da1d2d37c263 (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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
using NUnit.Framework;
using System.Threading;

namespace Xamarin.Forms.Core.UITests
{
	[TestFixture]
	[Category ("ListView")]
	internal class GroupedListActionsGalleryTests : BaseTestFixture
	{
		// TODO Group item actions, isolate specific indices (iOS is by 1, Android by two for cells)
		// TODO: Port to new conventions

		public GroupedListActionsGalleryTests ()
		{
			ShouldResetPerFixture = false;
		}

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

		[Test]
		[Description ("All of the grouped list actions are displayed")]
		public void GroupedListActionsGalleryAllElementsExist ()
		{
//			var actions = new [] {
//				"General",
//				"Change group name",
//				"Change group short name",
//				"Child item actions",
//				"Clear this group",
//				"Insert group item",
//				"Insert 2 group items",
//				"Remove next item",
//				"Dummy item RDI",
//				"Remove next 2 dummy items",
//				"Dummy item RmDI-1",
//				"Dummy item RmDI-2",
//				"Replace dummy item",
//				"Dummy item RpDI",
//				"Replace next two dummy items",
//				"Dummy item RpDI-1",
//				"Dummy item RpDI-2",
//				"Select next dummy item",
//				"Dummy item SI",
//				"Move dummy above this one",
//				"Dummy item MDI",
//				"Move last 2 items above this one",
//				"Dummy item M2DI-1",
//				"Dummy item M2DI-2",
//				"Group item actions",
//				"Clear all",
//				"Insert group",
//				"Insert 2 groups",
//				"Remove previous dummy group",
//				"Remove previous 2 dummy groups",
//				"Replace previous dummy group",
//				"Replace previous 2 dummy groups",
//				"Move next group above",
//				"Move next 2 groups above"
//			};

//			foreach (var action in actions) {
//				App.ScrollDownForElement (q => q.Marked (action), 40);
//			}

//			App.Screenshot ("All actions are preset");
		}

//		[Test]
//		[Description ("Change group name")]
//		public void GroupedListActionsGalleryChangeGroupName ()
//		{
//			App.ScrollDownForElement (q => q.Marked ("General"), 40);
//			App.Screenshot ("Before changing group name");
//			App.Tap (q => q.Marked ("Change group name"));
//			App.WaitForElement (q => q.Marked ("General (changed)"));
//			App.Screenshot ("After changing group name");
//		}

//		[Test]
//		[Description ("Child actions - clear group")]
//		public void GroupedListActionsGalleryChildClearGroup ()
//		{
//			App.ScrollDownForElement (q => q.Marked ("Clear this group"), 40);
//			App.Screenshot ("Before clearing group");
//			App.Tap (q => q.Marked ("Clear this group"));
//			App.WaitForNoElement (q => q.Marked ("Insert group item"));
//			App.WaitForNoElement (q => q.Marked ("Insert 2 group items"));
//			App.Screenshot ("After clearing the group");
//		}

//		[Test]
//		[Description ("Child actions - insert item(s)")]
//		public void GroupedListActionsGalleryChildInsertItems ()
//		{
//			App.ScrollDownForElement (q => q.Marked ("Insert group item"), 40);
//			App.Screenshot ("Before inserting item");

//			App.Tap (q => q.Marked ("Insert group item"));
//			App.ScrollUpForElement (q => q.Marked ("Inserted item S"), 2);
//			App.WaitForElement (q => q.Marked ("Inserted item S"));
//			App.Screenshot ("After inserting item");

//			App.ScrollDownForElement (q => q.Marked ("Insert 2 group items"), 2);
//			App.Tap (q => q.Marked ("Insert 2 group items"));
//			App.ScrollUpForElement (q => q.Marked ("Inserted item D 0"), 2);
//			App.WaitForElement (q => q.Marked ("Inserted item D 0"));
//			App.WaitForElement (q => q.Marked ("Inserted item D 1"));
//			App.Screenshot ("After inserting 2 items");
//		}
			
			
//		[Test]
//		[Description ("Child actions - remove item(s)")]
//		public void GroupedListActionsGalleryChildRemoveItems ()
//		{
//			App.ScrollDownForElement (q => q.Marked ("Remove next item"), 40);
//			App.Screenshot ("Before removing item");

//			App.Tap (q => q.Marked ("Remove next item"));
//			App.WaitForNoElement (q => q.Marked ("Dummy item RDI"));
//			App.Screenshot ("After removing item");

//			App.ScrollDownForElement (q => q.Marked ("Remove next 2 dummy items"), 40);
//			App.Tap (q => q.Marked ("Remove next 2 dummy items"));
//			App.WaitForNoElement (q => q.Marked ("Dummy item RmDI-1"));
//			App.WaitForNoElement (q => q.Marked ("Dummy item RmDI-2"));
//			App.Screenshot ("After removing 2 items");
//		}

//		[Test]
//		[Description ("Child actions - replace item(s)")]
//		public void GroupedListActionsGalleryChildReplaceItems ()
//		{
//			App.ScrollDownForElement (q => q.Marked ("Replace dummy item"), 40);
//			App.Screenshot ("Before replacing item");

//			App.Tap (q => q.Marked ("Replace dummy item"));
//			App.WaitForNoElement (q => q.Marked ("Dummy item RpDI"));
//			App.ScrollDownForElement (q => q.Marked ("Replaced item"), 2);
//			App.Screenshot ("After replacing item");

//			App.ScrollDownForElement (q => q.Marked ("Replace next two dummy items"), 40);
//			App.Tap (q => q.Marked ("Replace next two dummy items"));
//			App.WaitForNoElement (q => q.Marked ("Dummy item RpDI-1"));
//			App.WaitForNoElement (q => q.Marked ("Dummy item RpDI-2"));
//			App.WaitForElement (q => q.Marked ("Replaced items 0"));
//			App.WaitForElement (q => q.Marked ("Replaced items 1"));
//			App.Screenshot ("After replacing 2 items");
//		}

//		[Test]
//		[Category ("ManualReview")]
//		[Description ("Child actions - select item(s)")]
//		public void GroupedListActionsGalleryChildSelectItems ()
//		{
//			App.ScrollDownForElement (q => q.Marked ("Select next dummy item"), 40);
//			App.Screenshot ("Before selecting item");
//			App.Tap (q => q.Marked ("Select next dummy item"));
//			App.Screenshot ("After selecting item");
//		}

//		[Test]
//		[Category ("ManualReview")]
//		[Description ("Child actions - move item(s)")]
//		public void GroupedListActionsGalleryChildMoveItems ()
//		{
//			App.ScrollDownForElement (q => q.Marked ("Move dummy above this one"), 40);
//			App.Screenshot ("Before moving item");

//			App.Tap (q => q.Marked ("Move dummy above this one"));
//			App.Screenshot ("Dummy item MDI should now be above 'Move dummy above this one'");

//			App.Tap (q => q.Marked ("Move last 2 items above this one"));
//			App.Screenshot ("Dummy item M2DI-1 and M2DI-2 should now be above 'Move last 2 items above this one'");

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

//		[Test]
//		[Description ("Child item action test - landscape")]
//		public void GroupedListActionsGalleryAllElementsExistLandscape ()
//		{
//			App.SetOrientationLandscape ();
//			App.Screenshot ("Rotated to Landscape");
//			GroupedListActionsGalleryAllElementsExist ();
//			App.SetOrientationPortrait ();
//			App.Screenshot ("Rotated to portrait");
//		}

//		[Test]
//		[Description ("Change group name - landscape")]
//		public void GroupedListActionsGalleryChangeGroupNameLandscape ()
//		{
//			App.SetOrientationLandscape ();
//			App.Screenshot ("Rotated to Landscape");
//			GroupedListActionsGalleryChangeGroupName ();
//			App.SetOrientationPortrait ();
//			App.Screenshot ("Rotated to portrait");
//		}

//		[Test]
//		[Description ("Child actions - clear group - landscape")]
//		public void GroupedListActionsGalleryChildClearGroupLandscape ()
//		{
//			App.SetOrientationLandscape ();
//			App.Screenshot ("Rotated to Landscape");
//			GroupedListActionsGalleryChildClearGroup ();
//			App.SetOrientationPortrait ();
//			App.Screenshot ("Rotated to portrait");
//		}

//		[Test]
//		[Description ("Child actions - insert item(s) - landscape")]
//		public void GroupedListActionsGalleryChildInsertItemsLandscape ()
//		{
//			App.SetOrientationLandscape ();
//			App.Screenshot ("Rotated to Landscape");
//			GroupedListActionsGalleryChildInsertItems ();
//			App.SetOrientationPortrait ();
//			App.Screenshot ("Rotated to portrait");
//		}


//		[Test]
//		[Description ("Child actions - remove item(s) - landscape")]
//		public void GroupedListActionsGalleryChildRemoveItemsLandscape ()
//		{
//			App.SetOrientationLandscape ();
//			App.Screenshot ("Rotated to Landscape");
//			GroupedListActionsGalleryChildRemoveItems ();
//			App.SetOrientationPortrait ();
//			App.Screenshot ("Rotated to portrait");
//		}

//		[Test]
//		[Description ("Child actions - replace item(s) - landscape")]
//		public void GroupedListActionsGalleryChildReplaceItemsLandscape ()
//		{
//			App.SetOrientationLandscape ();
//			App.Screenshot ("Rotated to Landscape");
//			GroupedListActionsGalleryChildReplaceItems ();
//			App.SetOrientationPortrait ();
//			App.Screenshot ("Rotated to portrait");
//		}

//		[Test]
//		[Category ("ManualReview")]
//		[Description ("Child actions - select item(s) - landscape")]
//		public void GroupedListActionsGalleryChildSelectItemsLandscape ()
//		{
//			App.SetOrientationLandscape ();
//			App.Screenshot ("Rotated to Landscape");
//			GroupedListActionsGalleryChildSelectItems ();
//			App.SetOrientationPortrait ();
//			App.Screenshot ("Rotated to portrait");
//		}

//		[Test]
//		[Category ("ManualReview")]
//		[Description ("Child actions - move item(s) - landscape")]
//		public void GroupedListActionsGalleryChildMoveItemsLandscape ()
//		{
//			App.SetOrientationLandscape ();
//			App.Screenshot ("Rotated to Landscape");
//			GroupedListActionsGalleryChildMoveItems ();
//			App.SetOrientationPortrait ();
//			App.Screenshot ("Rotated to portrait");
//		}

	}
}