-
Notifications
You must be signed in to change notification settings - Fork 13
/
steptest.feature
887 lines (813 loc) · 52.3 KB
/
steptest.feature
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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
Feature: Test of the steps provided by Iridium
@test
Scenario: Open App
Given I display a starting marker
# Load the page from the appUrlOverride value
And I open the application
# Load the page from the URL
And I open the page "https://mcasperson.github.io/iridium/examples/test.html"
Then I verify that there were no HTTP errors
And I set the default wait time between steps to "0.2" seconds
And I set the default wait for elements to be available to "3" seconds
And I set the alias mappings
| Button ID | buttonId |
| Button ID Output | Button By ID Clicked |
| Button Class | buttonClass |
| Button Class Output | Button By Class Clicked |
| Button Name | buttonName |
| Button Name Output | Button By Name Clicked |
| Button Value | buttonValue |
| Button Value Output | Button By Value Clicked |
| Button Text | Button By Text |
| Button Text Output | Button By Text Clicked |
| Non-Existant Field | thisDoesntExist |
| Link Contents | Test Link |
| Text Area 1 | textArea |
| Text Area 2 | textArea2 |
| Text Box css | body > div:nth-child(3) > input[type="text"]:nth-child(4) |
| Text Box xpath | /html/body/div[2]/input[4] |
| Test Value 1 | 100 |
| Test Value 2 | 200.15 |
| Test Value 3 | 100 |
| Test Value 4 | $1,234.50 |
| Test Value 6 | Test Value |
| Test Value 7 | Another Value |
| Test Value 8 | A test value |
| Test Value 9 | A test value |
| Test Value 10 | 123.45 |
| Event Button | eventButton |
| MouseDown Text | Button mousedown |
| Date Offset | 2 weeks |
| Non Existant Element | thisdoesnotexist |
| NoUISlider | #nouislider > div |
| CaseChange | abcdefg |
| DropDownListIndex | 2 |
| ArithmeticTest | 1 |
| Trunk SVG | //*[@id="CNR"]/*[name()="path"][1] |
And I dump the alias map to the console
And I dump the value of the alias "Non Existant Element" to the console
And I verify that the alias "this alias does not exist" is empty
# Make sure this sequence of configurations works as expected
And I set autoaliasing to "true"
And I disable autoaliasing
And I enable autoaliasing
@test
Scenario: Test finding text in page
And I wait "30" seconds for the page to contain the text "Some text with styles"
And I scroll to the bottom of the page
# IE reports hidden and invisible text
And I verify that the page contains the regex "Some text with (blah)?hidden elements"
# The whitspace before the invisible element could be a space, or a space and line break
And I verify that the page contains the regex "Some text with\s+(blah)?invisible elements"
And I verify that the page contains the text "Some text with supertext"
And I verify that the page contains the text "Some text with subtext"
And I verify that the page contains the text "Some text with UTF characters like Є and ϼ"
# The whitespace between table cells can be tabs, spaces or newlines depending on the browser
And I verify that the page contains the regex "Some(\s)+text(\s)+in(\s)+a(\s)+table"
@test @iefail
Scenario: Click SVG Image in Object
And I scroll to the bottom of the page
# Note that the selector to the element in the SVG must be an XPath.
# The selector to the <object> element can be any of the standard selectors (xpath, css path, id etc).
And I click the "//*[@id='CNR']/*[name()='path'][1]" element in the object element "/html/body/object"
Then I verify that the page contains the text "SVG Clicked!"
@test
Scenario: Test cookie steps
And I dump the value of the cookie called "whatever"
And I delete cookies called "whatever"
And I delete cookies called "whatever" with the path "/somecontext"
And I delete all cookies
@test
Scenario: Test window resizing
And I maximise the window
And I set the window size to "1024x768"
@test
Scenario: Test scrolling
And I scroll to the bottom of the page
And I scroll to the top of the page
@test
Scenario: Test Autoaliasing
This is actually the default, but test the step anyway
Given I enable autoaliasing
And I enable HAR logging
And I set the default keystroke delay to "0" milliseconds
And I "mousedown" on the hidden element found by "Event Button"
And I "mousedown" on the hidden "Event Button" button
Then I verify that the page contains the text "MouseDown Text"
@test
Scenario: Arithmetic
And I modify the alias "ArithmeticTest" by setting it to "2" if the value it holds is smaller
Then I verify that the alias "ArithmeticTest" is equal to "2"
And I modify the alias "ArithmeticTest" by setting it to "1" if the value it holds is larger
Then I verify that the alias "ArithmeticTest" is equal to "1"
And I modify the alias "ArithmeticTest" by multiplying "10" with it
Then I verify that the alias "ArithmeticTest" is equal to "10"
And I modify the alias "ArithmeticTest" by dividing "2" into it
Then I verify that the alias "ArithmeticTest" is equal to "5"
And I modify the alias "ArithmeticTest" by adding "2000" to it
Then I verify that the alias "ArithmeticTest" is equal to "2005"
And I modify the alias "ArithmeticTest" by subtracting "1005" from it
Then I verify that the alias "ArithmeticTest" is equal to "1000"
And I modify the alias "ArithmeticTest" by multiplying "ArithmeticTest" with it
Then I verify that the alias "ArithmeticTest" is equal to "1000000"
And I modify the alias "ArithmeticTest" by dividing "ArithmeticTest" into it
Then I verify that the alias "ArithmeticTest" is equal to "1"
And I modify the alias "ArithmeticTest" by adding "ArithmeticTest" to it
Then I verify that the alias "ArithmeticTest" is equal to "2"
And I modify the alias "ArithmeticTest" by subtracting "ArithmeticTest" from it
Then I verify that the alias "ArithmeticTest" is equal to "0"
@test
Scenario: Test waiting for non-existent text
And I wait "1" seconds for the page to contain the text "This text will never exist", ignoring timeouts
And I wait "1" seconds for the page to contain the regex "This regex will never exist", ignoring timeouts
@fail-with-one-window
Scenario: Fail when closing the only window
And I close the current window
@test
Scenario: Test Javascript alias parameters
The current alias map is made available to JavaScript as a list of arguments, with the
alias name being followed by the alias value. Here we scan the list of arguments looking
for a known alias key, and return the value. We then verify that the returned value
matches the original alias.
And I run the following JavaScript and save the result to alias "JavaScript Return Value"
"""
if (arguments[0].length % 2 !== 0) {
return "arguments[0] should always be an even number";
}
for (var i = 0; i < arguments[0].length; i += 2) {
if (arguments[0][i] === 'CaseChange') {
return arguments[0][i + 1];
}
}
return "Failed to find alias mapping";
"""
Then I verify that the alias "JavaScript Return Value" is equal to alias "CaseChange"
And I run the following JavaScript
"""
console.log('testing javascript');
"""
@test
Scenario: Issue 88 Test: https://github.com/AutoGeneral/IridiumApplicationTesting/issues/88
And I select option number alias "DropDownListIndex" from the drop down list found by "selectList"
And I select option number alias "DropDownListIndex" from the "selectList" drop down list
And I save the content of the first selected option from the drop down list found by "selectList" to the alias "Drop Down List Text"
Then I verify that the alias "Drop Down List Text" is equal to "Option 2"
@test
Scenario: Issue 87: https://github.com/AutoGeneral/IridiumApplicationTesting/issues/87
And I focus on the element found by "doesnotexist" if it exists
And I focus on the "doesnotexist" text box if it exists
@test
Scenario: Test changing alias case
And I modify the alias "CaseChange" by converting it to upper case
Then I verify that the alias "CaseChange" is equal to "ABCDEFG"
And I modify the alias "CaseChange" by converting it to lower case
Then I verify that the alias "CaseChange" is equal to "abcdefg"
@test
Scenario: test advanced UI interaction
# This is what it takes to "click" on a jQuery UI slider. We need to send
# Both the mousedown and mouseup events.
And I "mousedown" "50%" horizontally and "50%" vertically within the area of the element found by "slider"
And I "mousedown" "50%" horizontally and "50%" vertically within the area of the "slider" slider
And I "mouseup" "50%" horizontally and "50%" vertically within the area of the element found by "slider"
And I "mouseup" "50%" horizontally and "50%" vertically within the area of the "slider" slider
And I run the following JavaScript and save the result to alias "Slider Value"
"""
return $( "#slider" ).slider( "value" );
"""
Then I verify that the alias "Slider Value" is larger than "0"
# This is how we would interact with a jQuery UI slider using JavaScript
And I run the following JavaScript and save the result to alias "Slider Value"
"""
$("#slider").slider('value', 10);
return $( "#slider" ).slider( "value" );
"""
Then I verify that the alias "Slider Value" is larger than "0"
# This is how we interact with a noUiSlider (https://refreshless.com/nouislider/)
# Note that the element we are interacting with here (found by the NoUISlider alias)
# is an element that was created by the noUiSlider library. It is not imediately
# obvious which elements should be recieving the events in this case.
And I "mousedown" "5%" horizontally and "50%" vertically within the area of the element found by "NoUISlider"
And I "mousedown" "5%" horizontally and "50%" vertically within the area of the "NoUISlider" slider
And I run the following JavaScript and save the result to alias "NoUISlider Value"
"""
return document.getElementById('nouislider').noUiSlider.get()[0];
"""
Then I verify that the alias "NoUISlider Value" is larger than "0"
@test
Scenario: Click elements with random IDs
And I click the element with the attribute of "data-number" with a random number between "1" and "5"
Then I verify that the page contains the text "Button with random attribute clicked"
And I click the element with the attribute of "data-attrname" equal to "button"
Then I verify that the page contains the text "Button with named attr clicked"
@test
Scenario: Modify element attributes
And I modify the element found by "eventButton" by setting the attribute "data-test" to "New Value"
And I modify the "eventButton" button by setting the attribute "data-test" to "New Value"
And I modify the element found by "this does not exist" by setting the attribute "data-test" to "New Value" if it exists
And I modify the "this does not exist" radio button by setting the attribute "data-test" to "New Value" if it exists
And I save the attribute content of "data-test" from the element found by "eventButton" to the alias "Data Test Attr"
And I verify that the alias "Data Test Attr" is equal to "New Value"
And I save the attribute content of "data-test" from the element with the ID of "eventButton" to the alias "Data Test Attr"
And I verify that the alias "Data Test Attr" is equal to "New Value"
# https://github.com/AutoGeneral/IridiumApplicationTesting/issues/32
@test
Scenario: Immediate wait
And I wait "0" seconds for the element found by "eventButton" to be displayed
And I wait "0" seconds for the "eventButton" button to be displayed
# This scenario is expected to run
@tag1 @tag2
Scenario: Tag test
And I "mouseup" on the hidden element found by "eventButton"
And I "mouseup" on the hidden "eventButton" button
# This scenario is expected to run
@tag3
Scenario: Tag Test 2
Then I verify that the page contains the text "Button mouseup"
# This scenario is not expected to run
@tag4 @tag5
Scenario: Tag Test 3
And I "mousedown" on the hidden element found by "eventButton"
And I "mousedown" on the hidden "eventButton" button
# This scenario is expected to run, and the app should show Button mouseup
# from Scenario: Tag Test 2
@test @tag4
Scenario: tag Test 4
Then I verify that the page contains the text "Button mouseup"
@test
Scenario: Test missing elements
And I wait "1" seconds for the element with the ID of "thisdoesntexist" to not be present
And I wait "1" seconds for the element with the xpath of "/html/body/div[100]/input[1000000]" to not be displayed
And I wait "1" seconds for the element with the class of "thisdoesntexist" to not be displayed
And I wait "1" seconds for the element with the css selector of "thisdoesntexist" to not be displayed
And I wait "1" seconds for the element found by "thisdoesntexist" to not be present
And I wait "1" seconds for the "thisdoesntexist" button to not be present
And I wait "1" seconds for the element found by "thisdoesntexist" to not be displayed
And I wait "1" seconds for the "thisdoesntexist" checkbox to not be displayed
And I verify that the element found by "will not exist" is not displayed within "1" second
And I verify that the "will not exist" drop down list is not displayed within "1" second
@test
Scenario: Modify aliased values
Then I verify that the alias "Test Value 8" is equal to alias "Test Value 9"
Then I verify that the alias "Test Value 10" is larger than or equal to "12.345"
Then I verify that the alias "Test Value 10" is smaller than or equal to "12345"
And I modify the alias "Test Value 4" by removing all characters that match the regex "[^0-9.]"
Then I verify that the alias "Test Value 4" is equal to "1234.50"
And I modify the alias "Test Value 4" by replacing all characters that match the regex "1" with "2"
Then I verify that the alias "Test Value 4" is equal to "2234.50"
And I modify the alias "Test Value 4" by replacing the first characters that match the regex "2" with "1"
Then I verify that the alias "Test Value 4" is equal to "1234.50"
And I modify the alias "Test Value 4" by prepending it with "9"
Then I verify that the alias "Test Value 4" is equal to "91234.50"
And I modify the alias "Test Value 4" by appending it with "0"
Then I verify that the alias "Test Value 4" is equal to "91234.500"
And I modify the alias "Test Value 4" by replacing all characters that match the regex "(\d+)\.(\d+)" with "$2.$1"
Then I verify that the alias "Test Value 4" is equal to "500.91234"
And I copy the alias "Test Value 4" to the alias "Test Value 5"
And I verify that the alias "Test Value 5" is equal to "500.91234"
And I modify the alias "Test Value 4" by appending it with " "
And I modify the alias "Test Value 4" by appending it with alias "Test Value 7"
Then I verify that the alias "Test Value 4" is equal to "500.91234 Another Value"
And I modify the alias "Test Value 4" by prepending it with " "
And I modify the alias "Test Value 4" by prepending it with alias "Test Value 6"
Then I verify that the alias "Test Value 4" is equal to "Test Value 500.91234 Another Value"
And I save the current date with the format "dd MMM yyyy" to the alias "Todays Date"
And I verify that the alias "Todays Date" matches the regex "\d{2} \w{3} \d{4}"
And I save the current date offset by "1 day" with the format "dd MMM yyyy" to the alias "Tomorrows Date"
Then I verify that the alias "Tomorrows Date" matches the regex "\d{2} \w{3} \d{4}"
And I save the current date offset by "-1 day" with the format "dd MMM yyyy" to the alias "Yesterdays Date"
Then I verify that the alias "Yesterdays Date" matches the regex "\d{2} \w{3} \d{4}"
And I save the current date offset by "2 years" with the format "dd MMM yyyy" to the alias "Two Years From Now"
Then I verify that the alias "Two Years From Now" matches the regex "\d{2} \w{3} \d{4}"
Then I verify that the alias "Tomorrows Date" is not equal to "Yesterdays Date"
And I modify the alias "Tomorrows Date" by prepending it with " "
And I modify the alias "Tomorrows Date" by trimming it
Then I verify that the alias "Tomorrows Date" matches the regex "^\d{2} \w{3} \d{4}$"
Then I verify that the alias "Tomorrows Date" is "11" characters long
And I save the current date offset by "Date Offset" with the format "dd MMM yyyy" to the alias "Two Weeks From Now"
Then I verify that the alias "Two Weeks From Now" matches the regex "^\d{2} \w{3} \d{4}$"
@test
Scenario: Test class verification
Then I verify the element with the ID of "verifyDivClass" should have a class of "divClass"
Then I verify the element with the ID of "thisdoesntexist" should have a class of "divClass" if it exists
@test
Scenario: test element verification steps
Then I verify the element found by "output" is present within "2" seconds
Then I verify the "output" div is present within "2" seconds
Then I verify the element found by alias "Non Existant Element" is not present within "1" second
Then I verify the element with the ID of "output" is present
Then I verify the element with the ID alias of "Non Existant Element" is not present within "1" second
Then I verify the element with the ID of "output" is displayed
Then I verify the element with the ID alias of "Non Existant Element" is not displayed within "1" second
Then I verify the element with the css selector of "#output" is present
Then I verify the element with the css selector alias of "Non Existant Element" is not present within "1" second
Then I verify the element with the xpath of "//*[@id='output']" is present
Then I verify the element with the xpath alias of "Non Existant Element" is not present within "1" second
Then I verify the element with the name of "buttonName" is present
Then I verify the element with the name alias of "Non Existant Element" is not present within "1" second
Then I verify the element with the class of "buttonClass" is present
Then I verify the element with the class alias of "Non Existant Element" is not present within "1" second
Then I verify that a link with the text content of "this does not exist" is not present
Then I verify the element with the attribute of "id" equal to "output" is displayed
Then I verify the element with the attribute of "id" equal to "this does not exist" is not displayed
Then I verify the element with the attribute of "id" equal to "this does not exist" is not displayed within "1" second
Then I verify the element with the attribute of "id" equal to "output" is present
Then I verify the element with the attribute of "id" equal to "this does not exist" is not present
Then I verify the element with the attribute of "id" equal to "this does not exist" is not present within "1" second
@test
Scenario: Manual Mouse Events
And I "mousedown" on the hidden element found by "eventButton"
Then I verify that the page contains the text "Button mousedown"
Then I verify the element found by "output" is displayed
Then I verify that the page does not contain the text "This text does not exist"
Then I verify that the page does not contain the regex "(This)\s\w+does not exist"
And I "mouseup" on the hidden element found by "eventButton"
Then I verify that the page contains the regex "(Button)\s(mouseup)"
And I "mouseover" on the hidden element found by "eventButton"
Then I wait "30" seconds for the page to contain the text "Button mouseover"
And I "mouseout" on the hidden element found by "eventButton"
Then I wait "30" seconds for the page to contain the text "Button mouseout"
And I "mousemove" on the hidden element found by "eventButton"
Then I wait "30" seconds for the page to contain the regex "Button mousemove"
And I "mouseenter" on the hidden element found by "eventButton"
Then I verify that the page contains the text "Button mouseenter"
And I "mouseleave" on the hidden element found by "eventButton"
Then I verify that the page contains the text "Button mouseleave"
And I "mousedown" on the hidden "eventButton" button
Then I verify that the page contains the text "Button mousedown"
Then I verify the "output" div is displayed
Then I verify that the page does not contain the text "This text does not exist"
Then I verify that the page does not contain the regex "(This)\s\w+does not exist"
And I "mouseup" on the hidden "eventButton" button
Then I verify that the page contains the regex "(Button)\s(mouseup)"
And I "mouseover" on the hidden "eventButton" button
Then I wait "30" seconds for the page to contain the text "Button mouseover"
And I "mouseout" on the hidden "eventButton" button
Then I wait "30" seconds for the page to contain the text "Button mouseout"
And I "mousemove" on the hidden "eventButton" button
Then I wait "30" seconds for the page to contain the regex "Button mousemove"
And I "mouseenter" on the hidden "eventButton" button
Then I verify that the page contains the text "Button mouseenter"
And I "mouseleave" on the hidden "eventButton" button
Then I verify that the page contains the text "Button mouseleave"
@test
Scenario: Manual Key Events
And I "keydown" on the hidden element found by "eventButton"
Then I verify that the page contains the text "Button keydown"
And I "keyup" on the hidden element found by "eventButton"
Then I verify that the page contains the text "Button keyup"
And I "keypress" on the hidden element found by "eventButton"
Then I verify that the page contains the text "Button keypress"
And I dispatch a "keydown" event on the hidden element with the ID of "eventButton"
Then I verify that the page contains the text "Button keydown"
And I dispatch a "keyup" event on the hidden element with the ID of "eventButton"
Then I verify that the page contains the text "Button keyup"
And I dispatch a "keypress" event on the hidden element with the ID of "eventButton"
Then I verify that the page contains the text "Button keypress"
And I "keydown" on the hidden "eventButton" button
Then I verify that the page contains the text "Button keydown"
And I "keyup" on the hidden "eventButton" button
Then I verify that the page contains the text "Button keyup"
And I "keypress" on the hidden "eventButton" button
Then I verify that the page contains the text "Button keypress"
@test
Scenario: Work with DropDown Lists
And I select "Option 2" from the drop down list found by "selectList"
And I save the content of the first selected option from the drop down list found by "selectList" to the alias "Drop Down List Text"
Then I verify that the alias "Drop Down List Text" is equal to "Option 2"
And I select "Option 2" from the drop down list with the ID of "selectList"
And I save the content of the first selected option from the drop down list found by "selectList" to the alias "Drop Down List Text"
Then I verify that the alias "Drop Down List Text" is equal to "Option 2"
And I save the content of the first selected option from the drop down list with the ID of "selectList" to the alias "Drop Down List Text"
Then I verify that the alias "Drop Down List Text" is equal to "Option 2"
And I save the value of the first selected option from the drop down list found by "selectList" to the alias "Drop Down List Value"
Then I verify that the alias "Drop Down List Value" is equal to "Option2"
And I save the value of the first selected option from the drop down list with the ID of "selectList" to the alias "Drop Down List Value"
Then I verify that the alias "Drop Down List Value" is equal to "Option2"
# This step adds "if it exists" because the Firefox Marionette driver has a bug
# that will cause this step to fail.
And I select option number "3" from the drop down list found by "selectList" if it exists
And I select option number "100" from the drop down list found by "this does not exist" if it exists
And I select option number "3" from the drop down list with the ID of "selectList" if it exists
And I select "Option 2" from the "selectList" drop down list
And I save the content of the first selected option from the "selectList" drop down list to the alias "Drop Down List Text"
Then I verify that the alias "Drop Down List Text" is equal to "Option 2"
And I select "Option 2" from the drop down list with the ID of "selectList"
And I save the content of the first selected option from the "selectList" drop down list to the alias "Drop Down List Text"
Then I verify that the alias "Drop Down List Text" is equal to "Option 2"
And I save the value of the first selected option from the "selectList" drop down list to the alias "Drop Down List Value"
Then I verify that the alias "Drop Down List Value" is equal to "Option2"
# This step adds "if it exists" because the Firefox Marionette driver has a bug
# that will cause this step to fail.
And I select option number "3" from the "selectList" drop down list if it exists
And I select option number "100" from the "this does not exist" drop down list if it exists
@test
Scenario: Focus on Elements
And I focus on the element found by "this does not exist" if it exists
And I focus on the "this does not exist" text area if it exists
And I focus on the element with the ID of "his does not exist" if it exists
And I focus on the element found by "textArea"
And I focus on the "textArea" text area
And I press CTRL-A on the active element
And I press CMD-A on the active element
And I press the Delete on the active element "10" times
And I press the down arrow key on the active element
And I press the up arrow key on the active element
And I press the left arrow key on the active element
And I press the right arrow key on the active element
Then I verify that the page contains the text "Focused on textarea"
And I focus on the element with the ID of "textArea2"
Then I verify that the page contains the text "Focused on textarea2"
And I focus on the element found by alias "Text Area 1"
Then I verify that the page contains the text "Focused on textarea"
And I focus on the element with the ID alias of "Text Area 2"
Then I verify that the page contains the text "Focused on textarea2"
And I populate the element found by "textArea" with "Some Text"
And I select all the text in the active element ignoring errors
And I press the backspace key on the active element "3" times ignoring errors
And I press the enter key on the active element ignoring errors
And I populate the element found by "textArea" with "New Line"
And I press the tab key on the active element ignoring errors
And I focus on the alias "Text Area 1" text area
Then I verify that the page contains the text "Focused on textarea"
And I populate the "textArea" text area with "Some Text"
And I select all the text in the active element ignoring errors
And I populate the "textArea" text area with "New Line"
And I press the tab key on the active element ignoring errors
@test
Scenario: Test Clicking Elements
And I verify that the element found by "buttonId" is clickable
And I verify that the element with the ID of "buttonId" is clickable within "10" seconds
And I click the element found by "buttonId"
Then I verify that the page contains the text "Button By ID Clicked"
And I click the element found by "buttonClass"
Then I verify that the page contains the text "Button By Class Clicked"
And I click the element found by "buttonName"
Then I verify that the page contains the text "Button By Name Clicked"
And I click the element found by "buttonValue"
Then I verify that the page contains the text "Button By Value Clicked"
And I click the element found by "Button By Text"
Then I verify that the page contains the text "Button By Text Clicked"
And I click the element with the ID of "buttonId"
Then I verify that the page contains the text "Button By ID Clicked"
And I click the element with the class of "buttonClass"
Then I verify that the page contains the text "Button By Class Clicked"
And I click the element with the name of "buttonName"
Then I verify that the page contains the text "Button By Name Clicked"
And I verify that the "buttonId" button is clickable
And I verify that the element with the ID of "buttonId" is clickable within "10" seconds
And I click the "buttonId" button
Then I verify that the page contains the text "Button By ID Clicked"
And I click the "buttonClass" button
Then I verify that the page contains the text "Button By Class Clicked"
And I click the "buttonName" button
Then I verify that the page contains the text "Button By Name Clicked"
And I click the "buttonValue" button
Then I verify that the page contains the text "Button By Value Clicked"
And I click the "Button By Text" button
Then I verify that the page contains the text "Button By Text Clicked"
@test
Scenario: Test Clicking Elements multiple times
And I save the current date with the format "MM" to the alias "This Month"
And I save the current date offset by "2 month" with the format "MM" to the alias "Next Month"
And I modify the alias "Next Month" by subtracting alias "This Month" from it
And I copy the alias "Next Month" to the alias "Click Repeat"
And I modify the alias "Click Repeat" by setting it to "2" if the value it holds is smaller
And I click the element found by "buttonId" "Click Repeat" times
Then I verify that the page contains the text "Button By ID Clicked"
And I click the element found by "buttonClass" "Click Repeat" times
Then I verify that the page contains the text "Button By Class Clicked"
And I click the element found by "buttonName" "Click Repeat" times
Then I verify that the page contains the text "Button By Name Clicked"
And I click the element found by "buttonValue" "Click Repeat" times
Then I verify that the page contains the text "Button By Value Clicked"
And I click the element found by "Button By Text" "Click Repeat" times
Then I verify that the page contains the text "Button By Text Clicked"
And I click the element with the ID of "buttonId" "Click Repeat" times
Then I verify that the page contains the text "Button By ID Clicked"
And I click the element with the class of "buttonClass" "Click Repeat" times
Then I verify that the page contains the text "Button By Class Clicked"
And I click the element with the name of "buttonName" "Click Repeat" times
Then I verify that the page contains the text "Button By Name Clicked"
And I click the "buttonId" button "Click Repeat" times
Then I verify that the page contains the text "Button By ID Clicked"
And I click the "buttonClass" button "Click Repeat" times
Then I verify that the page contains the text "Button By Class Clicked"
And I click the "buttonName" button "Click Repeat" times
Then I verify that the page contains the text "Button By Name Clicked"
And I click the "buttonValue" button "Click Repeat" times
Then I verify that the page contains the text "Button By Value Clicked"
And I click the "Button By Text" button "Click Repeat" times
Then I verify that the page contains the text "Button By Text Clicked"
@test
Scenario: Test Clicking Elements With Aliases
And I click the element found by alias "Button ID"
Then I verify that the page contains the text alias "Button ID Output"
And I click the element found by alias "Button Class"
Then I verify that the page contains the text alias "Button Class Output"
And I click the element found by alias "Button Name"
Then I verify that the page contains the text alias "Button Name Output"
And I click the element found by alias "Button Value"
Then I verify that the page contains the text alias "Button Value Output"
And I click the element found by alias "Button Text"
Then I verify that the page contains the text alias "Button Text Output"
And I click the element with the ID alias of "Button ID"
Then I verify that the page contains the text alias "Button ID Output"
And I click the element with the class alias of "Button Class"
Then I verify that the page contains the text alias "Button Class Output"
And I click the element with the name alias of "Button Name"
Then I verify that the page contains the text alias "Button Name Output"
And I click the alias "Button ID" button
Then I verify that the page contains the text alias "Button ID Output"
And I click the alias "Button Class" button
Then I verify that the page contains the text alias "Button Class Output"
And I click the alias "Button Name" button
Then I verify that the page contains the text alias "Button Name Output"
And I click the alias "Button Value" button
Then I verify that the page contains the text alias "Button Value Output"
And I click the alias "Button Text" button
Then I verify that the page contains the text alias "Button Text Output"
@test
Scenario: Test Clicking Hidden Elements
And I click the hidden element found by "buttonId"
Then I verify that the page contains the text "Button By ID Clicked"
And I click the hidden element found by "buttonClass"
Then I verify that the page contains the text "Button By Class Clicked"
And I click the hidden element found by "buttonName"
Then I verify that the page contains the text "Button By Name Clicked"
And I click the hidden element found by "buttonValue"
Then I verify that the page contains the text "Button By Value Clicked"
And I click the hidden element found by "Button By Text"
Then I verify that the page contains the text "Button By Text Clicked"
And I click the hidden element with the ID of "buttonId"
Then I verify that the page contains the text "Button By ID Clicked"
And I click the hidden element with the class of "buttonClass"
Then I verify that the page contains the text "Button By Class Clicked"
And I click the hidden element with the name of "buttonName"
Then I verify that the page contains the text "Button By Name Clicked"
And I click the hidden "buttonId" button
Then I verify that the page contains the text "Button By ID Clicked"
And I click the hidden "buttonClass" button
Then I verify that the page contains the text "Button By Class Clicked"
And I click the hidden "buttonName" button
Then I verify that the page contains the text "Button By Name Clicked"
And I click the hidden "buttonValue" button
Then I verify that the page contains the text "Button By Value Clicked"
And I click the hidden "Button By Text" button
@test
Scenario: Test Clicking Hidden Elements With Aliases
And I click the hidden element found by alias "Button ID"
Then I verify that the page contains the text alias "Button ID Output"
And I click the hidden element found by alias "Button Class"
Then I verify that the page contains the text alias "Button Class Output"
And I click the hidden element found by alias "Button Name"
Then I verify that the page contains the text alias "Button Name Output"
And I click the hidden element found by alias "Button Value"
Then I verify that the page contains the text alias "Button Value Output"
And I click the hidden element found by alias "Button Text"
Then I verify that the page contains the text alias "Button Text Output"
And I click the hidden element with the ID alias of "Button ID"
Then I verify that the page contains the text alias "Button ID Output"
And I click the hidden element with the class alias of "Button Class"
Then I verify that the page contains the text alias "Button Class Output"
And I click the hidden element with the name alias of "Button Name"
Then I verify that the page contains the text alias "Button Name Output"
And I click the hidden alias "Button ID" button
Then I verify that the page contains the text alias "Button ID Output"
And I click the hidden alias "Button Class" button
Then I verify that the page contains the text alias "Button Class Output"
And I click the hidden alias "Button Name" button
Then I verify that the page contains the text alias "Button Name Output"
And I click the hidden alias "Button Value" button
Then I verify that the page contains the text alias "Button Value Output"
And I click the hidden alias "Button Text" button
@test
Scenario: Test verification steps
And I verify that the element found by "textClass" should have a class of "textClass"
And I verify that the "textClass" text box should have a class of "textClass"
@test
Scenario: Test Populating Inputs 1
And I populate the element found by "textId" with "Text Box Found By ID"
And I clear the element with the ID of "textId"
And I populate the "textId" text box with "Text Box Found By ID"
And I clear the element with the ID of "textId"
And I populate the element found by "textClass" with "Text Box Found By Class" with a keystroke delay of "100" milliseconds
And I clear the element with the class of "textClass"
And I populate the "textClass" text box with "Text Box Found By Class" with a keystroke delay of "100" milliseconds
And I clear the element with the class of "textClass"
And I populate the element found by "textName" with "Text Box Found By Name" with a keystroke delay of "50" milliseconds
And I clear the element with the name of "textName"
And I populate the element found by "textName" with "Text Box Found By Name" with a keystroke delay of "50" milliseconds
And I clear the element with the name of "textName"
And I populate the "textValue" text box with "Text Box Found By Value" with a keystroke delay of "25" milliseconds
And I clear the "textName" text box
And I clear the hidden "textId" text box
@test
Scenario: Test Populating Inputs 2
And I populate the element found by "textId" with a random number between "1" and "10"
And I clear the hidden element found by "textId"
And I populate the hidden element found by "textId" with "Hidden Text Box Found By ID"
And I clear the "textId" text box
And I populate the "textId" text box with a random number between "1" and "10"
And I clear the hidden element found by "textId"
And I clear the element found by "textClass"
And I clear the element found by "textName"
And I clear the element with the xpath alias of "Text Box xpath"
And I populate the element with the ID of "textId" with "Text Box Found By ID"
And I populate the element with the class of "textClass" with "Text Box Found By Class" with a keystroke delay of "100" milliseconds
And I populate the element with the name of "textName" with "Text Box Found By Name" with a keystroke delay of "50" milliseconds
And I populate the element with the css selector alias of "Text Box css" with "Text Box Found By CSS Selector" with a keystroke delay of "25" milliseconds
And I populate the element with the xpath alias of "Text Box xpath" with " And Then With An XPath" with a keystroke delay of "25" milliseconds
And I clear the element with the ID of "textId"
And I populate the element with the ID of "textId" with a random number between "1" and "10"
And I clear the element with the ID of "textId"
And I populate the element with the ID of "textId" with a random number between "1" and "10"
And I clear the element with the ID of "textId"
And I populate the hidden element with the ID of "textId" with "Text Box Found By ID"
And I clear the element with the ID of "textId"
And I populate the element with the attribute of "name" equal to "textName" with "Text Box Found By Name"
And I clear the element with the ID of "textId"
@test
Scenario: Test Populating Inputs 3
And I populate the element with the ID of "formText" with "Text Box Found By ID" and submit
Then I verify that the page contains the text "Form submitted"
And I populate the element found by "formText" with "Text Box Found By ID" and submit
And I populate the "formText" text box with "Text Box Found By ID" and submit
Then I verify that the page contains the text "Form submitted"
And I clear the element with the ID of "textId"
And I clear the element with the class of "textClass"
And I clear the element with the name of "textName"
@test
Scenario: Populate Inputs That Are Missing
And I populate the element found by "thisDoesntExist" with "Whatever" if it exists
And I populate the "thisDoesntExist" text box with "Whatever" if it exists
And I populate the element found by alias "Non-Existant Field" with "Whatever" if it exists
And I populate the alias "Non-Existant Field" text box with "Whatever" if it exists
And I populate the element with the ID of "thisDoesntExist" with "Whatver" if it exists
And I populate the element with the ID alias of "Non-Existant Field" with "Whatver" if it exists
@test
Scenario: Clicking missing elements
And I click the element found by "thisDoesntExist" if it exists
And I click the "thisDoesntExist" button if it exists
And I click the element found by alias "Non-Existant Field" if it exists
And I click the alias "Non-Existant Field" button if it exists
And I click the element with the ID of "thisDoesntExist" if it exists
And I click the element with the class of "thisDoesntExist" if it exists
And I click the element with the name of "thisDoesntExist" if it exists
And I click the element with the ID alias of "Non-Existant Field" if it exists
And I click the element with the class alias of "Non-Existant Field" if it exists
And I click the element with the name alias of "Non-Existant Field" if it exists
And I click the hidden element found by "thisDoesntExist" if it exists
And I click the hidden "thisDoesntExist" button if it exists
And I click the hidden element found by alias "Non-Existant Field" if it exists
And I click the hidden alias "Non-Existant Field" button if it exists
And I click the hidden element with the ID of "thisDoesntExist" if it exists
And I click the hidden element with the class of "thisDoesntExist" if it exists
And I click the hidden element with the name of "thisDoesntExist" if it exists
And I click the hidden element with the ID alias of "Non-Existant Field" if it exists
And I click the hidden element with the class alias of "Non-Existant Field" if it exists
And I click the hidden element with the name alias of "Non-Existant Field" if it exists
Scenario: Verify Element Has Class
Then I verify that the element found by "verifyDivClass" should have a class of "divClass"
Then I verify that the "verifyDivClass" div should have a class of "divClass"
And I verify that the element with the ID of "verifyDivClass" should have a class of "divClass"
And I verify that the element found by "#verifyDivClass" should have a class of "divClass"
And I verify that the "#verifyDivClass" div should have a class of "divClass"
And I verify that the element with the css selector of "#verifyDivClass" should have a class of "divClass"
And I verify that the element found by "divClass" should have a class of "divClass"
And I verify that the "divClass" div should have a class of "divClass"
And I verify that the element with the class of "divClass" should have a class of "divClass"
And I verify that the element found by "//*[@id='verifyDivClass']" should have a class of "divClass"
And I verify that the "//*[@id='verifyDivClass']" div should have a class of "divClass"
And I verify that the element with the xpath of "//*[@id='verifyDivClass']" should have a class of "divClass"
And I verify that the element found by "A div with a class" should have a class of "divClass"
And I verify that the "A div with a class" div should have a class of "divClass"
@test
Scenario: Verify Page
And I verify that the browser title should be "Iridium Test Page"
@test
Scenario: Save Values as Aliases and Verify Them
And I save the text content of the element found by "verifyString" to the alias "Example String"
And I save the text content of the "verifyString" text box to the alias "Example String"
And I save the text content of the element found by "verifyNumber" to the alias "Example Number"
And I save the text content of the "verifyNumber" text box to the alias "Example Number"
And I save the text content of the element with the ID of "verifyNumber" to the alias "Example Number"
And I save the attribute content of "data-verify" from the element found by "verifyNumber" to the alias "Example Number Attr"
And I save the attribute content of "data-verify" from the "verifyNumber" text box to the alias "Example Number Attr"
And I save the attribute content of "data-verify" from the element found by "verifyString" to the alias "Example String Attr"
And I save the attribute content of "data-verify" from the "verifyString" text box to the alias "Example String Attr"
And I save the value of the element found by "optionValue" to the alias "Option Value"
Then I verify that the alias "Example Number" is a number
And I save the value of the element with the ID of "optionValue" to the alias "Option Value"
Then I verify that the alias "Example Number" is a number
And I verify that the alias "Example String" is not a number
And I verify that the alias "Example Number" is not empty
And I verify that the alias "Example String" is not empty
And I verify that the alias "Example Number" matches the regex "\d+"
And I verify that the alias "Example String" matches the regex "[a-zA-Z]+"
And I verify that the alias "Example Number" does not match the regex "[a-zA-Z]+"
And I verify that the alias "Example String" does not match the regex "\d+"
And I verify that the alias "Example Number" is equal to "12345678"
And I verify that the alias "Example String" is equal to "abcdefg"
And I verify that the alias "Example Number" is not equal to "This is not a number"
And I verify that the alias "Example String" is not equal to "This is not the string you are looking for"
And I verify that the alias "Example Number Attr" is equal to "number"
And I verify that the alias "Example String Attr" is equal to "string"
And I verify that the alias "Option Value" is not empty
And I verify that the alias "Test Value 1" is smaller than the alias "Test Value 2"
And I verify that the alias "Test Value 1" is smaller than or equal to the alias "Test Value 3"
And I verify that the alias "Test Value 2" is larger than the alias "Test Value 3"
And I verify that the alias "Test Value 1" is larger than or equal to the alias "Test Value 3"
@test
Scenario: Save Values from Hidden Elements
And I save the text content of the hidden element found by "verifyString" to the alias "Example String"
And I save the text content of the hidden "verifyString" text box to the alias "Example String"
And I save the text content of the hidden element with the ID of "verifyString" to the alias "Example String"
And I verify that the alias "Example String" matches the regex "[a-zA-Z]+"
@test
Scenario: Click Links
And I wait "30" seconds for a link with the text content of alias "Link Contents" to be present
And I wait "2" seconds for a link with the text content of "This link does not exist" to not be present
And I click the link with the text content of "Test Link"
# Firefox will often fail trying to click this link twice in a row for some reason with the error:
# org.openqa.selenium.StaleElementReferenceException: The element reference of <a> stale: either the
# element is no longer attached to the DOM or the page has been refreshed
# So we sleep for a bit before clicking again
And I sleep for "1" second
And I click the hidden link with the text content alias of "Link Contents"
@test
Scenario: Navigate
# Note that Safari doesn't support this kind of navigation
And I go back ignoring errors
And I go forward ignoring errors
And I go to the hash location "whatever"
And I go back ignoring errors
And I refresh the page ignoring errors
@test
Scenario: Wait steps
And I wait "30" seconds for the element found by "verifyDivClass" to be displayed
And I wait "30" seconds for the "verifyDivClass" div to be displayed
And I wait "1" seconds for the element found by "thisDoesntExist" to be displayed ignoring timeouts
And I wait "1" seconds for the "thisDoesntExist" div to be displayed ignoring timeouts
And I wait "2" seconds for the element with the attribute of "id" equal to "verifyDivClass" to be displayed
And I wait "2" seconds for the element with the attribute of "id" equal to "verifyDivClass" to be present
And I wait "30" seconds for the element with the attribute of "id" equal to "this does not exist" to not be displayed
And I wait "30" seconds for the element with the attribute of "id" equal to "this does not exist" to not be present
And I wait "30" seconds for the element with the ID of "verifyDivClass" to be displayed
And I wait "1" seconds for the element with the ID alias of "Non-Existant Field" to be displayed ignoring timeouts
And I sleep for "1" second
And I wait "30" seconds for the element found by alias "Button ID" to be present
And I wait "30" seconds for the alias "Button ID" button to be present
And I wait "30" seconds for the element with the ID alias of "Button ID" to be present
And I wait "30" seconds for the element found by alias "Button ID" to be clickable
And I wait "30" seconds for the alias "Button ID" button to be clickable
And I wait "30" seconds for the element with the ID of "Button ID" to be clickable
And I wait "1" seconds for the element found by alias "Non-Existant Field" to be present ignoring timeouts
And I wait "1" seconds for the alias "Non-Existant Field" div to be present ignoring timeouts
And I wait "1" seconds for the element found by alias "Non-Existant Field" to be clickable ignoring timeouts
And I wait "1" seconds for the alias "Non-Existant Field" div to be clickable ignoring timeouts
@test
Scenario: Save HAR file
And I dump the HAR file to "test.har"
And I save the current date with the format "ddMMyyyyHHmmssSSS" to the alias "Har File Name"
And I modify the alias "Har File Name" by prepending it with "test"
And I modify the alias "Har File Name" by appending it with ".har"
Then I dump the HAR file to "Har File Name"
@test
Scenario: Test step skipping
And I skip all remaining steps
# This is skipped, so there is no failure
And I fail the scenario
@test
Scenario: Scroll Test
And I scroll to the bottom of the page
And I scroll to the top of the page
@test
Scenario: Modify HTTP request headers
And I set header "X-Forwarded-For" with value "127.0.0.1"
And I remove header "User-Agent"
@test
Scenario: Test alert handling
And I click the element found by "alertButton"
And I wait "30" seconds for an alert to be displayed
And I click "OK" on the alert
And I click the "alertButton" button
And I wait "30" seconds for an alert to be displayed
And I click "OK" on the alert
And I click the element found by "confirmButton"
And I wait "30" seconds for an alert to be displayed
And I click "Cancel" on the alert
And I click the "confirmButton" button
And I wait "30" seconds for an alert to be displayed
And I click "Cancel" on the alert
# Timeouts should be ignored if there is no alert
And I wait "2" seconds for an alert to be displayed, ignoring timeouts
And I click "OK" on the alert if it exists
And I click "Cancel" on the alert if it exists
@test @linktest
Scenario: Issue 90 Test: https://github.com/AutoGeneral/IridiumApplicationTesting/issues/90
And I open the link with the text content of "Test Link" in a new window
And I sleep for "5" seconds
# Remote tests must allow popups e.g. browserstack.ie.enablePopups = true
# https://www.browserstack.com/automate/capabilities
And I switch to the new window ignoring errors
And I close the current window ignoring errors