@@ -52,6 +52,7 @@ module.exports.tests = function () {
52
52
describe ( '#waitInUrl, #waitUrlEquals' , ( ) => {
53
53
it ( 'should wait part of the URL to match the expected' , async ( ) => {
54
54
if ( isHelper ( 'Nightmare' ) ) return ;
55
+
55
56
try {
56
57
await I . amOnPage ( '/info' ) ;
57
58
await I . waitInUrl ( '/info' ) ;
@@ -63,6 +64,7 @@ module.exports.tests = function () {
63
64
64
65
it ( 'should wait for the entire URL to match the expected' , async ( ) => {
65
66
if ( isHelper ( 'Nightmare' ) ) return ;
67
+
66
68
try {
67
69
await I . amOnPage ( '/info' ) ;
68
70
await I . waitUrlEquals ( '/info' ) ;
@@ -306,6 +308,8 @@ module.exports.tests = function () {
306
308
// testcafe always says "xpath is not defined"
307
309
// const el = Selector(context).find(elementByXPath(Locator.checkable.byText(xpathLocator.literal(field))).with({ boundTestRun: this.t })).with({ boundTestRun: this.t });
308
310
it . skip ( 'should check option by context' , async ( ) => {
311
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
312
+
309
313
await I . amOnPage ( '/form/example1' ) ;
310
314
await I . checkOption ( 'Remember me next time' , '.rememberMe' ) ;
311
315
await I . click ( 'Login' ) ;
@@ -358,8 +362,8 @@ module.exports.tests = function () {
358
362
} ) ;
359
363
360
364
// Could not get multiselect to work with testcafe
361
- it ( 'should select multiple options' , async ( ) => {
362
- if ( isHelper ( 'TestCafe' ) ) return ;
365
+ it ( 'should select multiple options' , async function ( ) {
366
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
363
367
364
368
await I . amOnPage ( '/form/select_multiple' ) ;
365
369
await I . selectOption ( 'What do you like the most?' , [ 'Play Video Games' , 'Have Sex' ] ) ;
@@ -384,16 +388,18 @@ module.exports.tests = function () {
384
388
} ) ;
385
389
386
390
387
- it ( 'should return value from sync script in iframe' , async ( ) => {
388
- if ( isHelper ( 'TestCafe' ) || isHelper ( 'Nightmare' ) ) return ; // TODO Not yet implemented
391
+ it ( 'should return value from sync script in iframe' , async function ( ) {
392
+ if ( isHelper ( 'Nightmare' ) ) return ; // TODO Not yet implemented
393
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ; // TODO Not yet implemented
394
+
389
395
await I . amOnPage ( '/iframe' ) ;
390
396
await I . switchTo ( 'iframe' ) ;
391
397
const val = await I . executeScript ( ( ) => document . getElementsByTagName ( 'h1' ) [ 0 ] . innerText ) ;
392
398
assert . equal ( val , 'Information' ) ;
393
399
} ) ;
394
400
395
- it ( 'should execute async script' , async ( ) => {
396
- if ( isHelper ( 'TestCafe' ) ) return ; // TODO Not yet implemented
401
+ it ( 'should execute async script' , async function ( ) {
402
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ; // TODO Not yet implemented
397
403
398
404
await I . amOnPage ( '/' ) ;
399
405
const val = await I . executeAsyncScript ( ( val , done ) => {
@@ -572,8 +578,8 @@ module.exports.tests = function () {
572
578
assert . equal ( vals [ 2 ] , 'Third' ) ;
573
579
} ) ;
574
580
575
- it ( 'should grab html from page' , async ( ) => {
576
- if ( isHelper ( 'TestCafe' ) ) return ;
581
+ it ( 'should grab html from page' , async function ( ) {
582
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
577
583
578
584
await I . amOnPage ( '/info' ) ;
579
585
const val = await I . grabHTMLFrom ( '#grab-multiple' ) ;
@@ -605,7 +611,6 @@ module.exports.tests = function () {
605
611
} ) ;
606
612
607
613
it ( 'should grab attribute from element' , async ( ) => {
608
- if ( isHelper ( 'TestCafe' ) ) return ;
609
614
await I . amOnPage ( '/search' ) ;
610
615
const val = await I . grabAttributeFrom ( {
611
616
css : 'form' ,
@@ -614,8 +619,6 @@ module.exports.tests = function () {
614
619
} ) ;
615
620
616
621
it ( 'should grab custom attribute from element' , async ( ) => {
617
- if ( isHelper ( 'TestCafe' ) ) return ;
618
-
619
622
await I . amOnPage ( '/form/example4' ) ;
620
623
const val = await I . grabAttributeFrom ( {
621
624
css : '.navbar-toggle' ,
@@ -625,8 +628,8 @@ module.exports.tests = function () {
625
628
} ) ;
626
629
627
630
describe ( 'page title : #seeTitle, #dontSeeTitle, #grabTitle' , ( ) => {
628
- it ( 'should check page title' , async ( ) => {
629
- if ( isHelper ( 'TestCafe' ) ) return ;
631
+ it ( 'should check page title' , async function ( ) {
632
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
630
633
631
634
await I . amOnPage ( '/' ) ;
632
635
await I . seeInTitle ( 'TestEd Beta 2.0' ) ;
@@ -635,8 +638,8 @@ module.exports.tests = function () {
635
638
await I . dontSeeInTitle ( 'TestEd Beta 2.0' ) ;
636
639
} ) ;
637
640
638
- it ( 'should grab page title' , async ( ) => {
639
- if ( isHelper ( 'TestCafe' ) ) return ;
641
+ it ( 'should grab page title' , async function ( ) {
642
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
640
643
641
644
await I . amOnPage ( '/' ) ;
642
645
const val = await I . grabTitle ( ) ;
@@ -657,6 +660,7 @@ module.exports.tests = function () {
657
660
658
661
it ( 'should upload file located by label' , async ( ) => {
659
662
if ( isHelper ( 'Nightmare' ) ) return ;
663
+
660
664
await I . amOnPage ( '/form/file' ) ;
661
665
await I . attachFile ( 'Avatar' , 'app/avatar.jpg' ) ;
662
666
await I . click ( 'Submit' ) ;
@@ -672,17 +676,13 @@ module.exports.tests = function () {
672
676
} ) ;
673
677
674
678
it ( 'should create a screenshot file in output dir' , async ( ) => {
675
- if ( isHelper ( 'TestCafe' ) ) return ;
676
-
677
679
const sec = ( new Date ( ) ) . getUTCMilliseconds ( ) ;
678
680
await I . amOnPage ( '/' ) ;
679
681
await I . saveScreenshot ( `screenshot_${ sec } .png` ) ;
680
682
assert . ok ( fileExists ( path . join ( global . output_dir , `screenshot_${ sec } .png` ) ) , null , 'file does not exists' ) ;
681
683
} ) ;
682
684
683
685
it ( 'should create a full page screenshot file in output dir' , async ( ) => {
684
- if ( isHelper ( 'TestCafe' ) ) return ;
685
-
686
686
const sec = ( new Date ( ) ) . getUTCMilliseconds ( ) ;
687
687
await I . amOnPage ( '/' ) ;
688
688
await I . saveScreenshot ( `screenshot_full_${ + sec } .png` , true ) ;
@@ -750,8 +750,8 @@ module.exports.tests = function () {
750
750
await I . see ( 'Dynamic text' ) ;
751
751
} ) ;
752
752
753
- it ( 'should fail if no context' , async ( ) => {
754
- if ( isHelper ( 'TestCafe' ) ) return ;
753
+ it ( 'should fail if no context' , async function ( ) {
754
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
755
755
756
756
let failed = false ;
757
757
await I . amOnPage ( '/dynamic' ) ;
@@ -764,8 +764,8 @@ module.exports.tests = function () {
764
764
assert . ok ( failed ) ;
765
765
} ) ;
766
766
767
- it ( 'should fail if text doesn\'t contain' , async ( ) => {
768
- if ( isHelper ( 'TestCafe' ) ) return ;
767
+ it ( 'should fail if text doesn\'t contain' , async function ( ) {
768
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
769
769
770
770
let failed = false ;
771
771
await I . amOnPage ( '/dynamic' ) ;
@@ -777,8 +777,8 @@ module.exports.tests = function () {
777
777
assert . ok ( failed ) ;
778
778
} ) ;
779
779
780
- it ( 'should fail if text is not in element' , async ( ) => {
781
- if ( isHelper ( 'TestCafe' ) ) return ;
780
+ it ( 'should fail if text is not in element' , async function ( ) {
781
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
782
782
783
783
let failed = false ;
784
784
await I . amOnPage ( '/dynamic' ) ;
@@ -791,8 +791,6 @@ module.exports.tests = function () {
791
791
} ) ;
792
792
793
793
it ( 'should wait for text after timeout' , async ( ) => {
794
- if ( isHelper ( 'TestCafe' ) ) return ;
795
-
796
794
await I . amOnPage ( '/timeout' ) ;
797
795
await I . dontSee ( 'Timeout text' ) ;
798
796
await I . waitForText ( 'Timeout text' , 31 , '#text' ) ;
@@ -910,8 +908,8 @@ module.exports.tests = function () {
910
908
} ) ;
911
909
912
910
describe ( '#waitForDetached' , ( ) => {
913
- it ( 'should throw an error if the element still exists in DOM' , async ( ) => {
914
- if ( isHelper ( 'TestCafe' ) ) return ;
911
+ it ( 'should throw an error if the element still exists in DOM' , async function ( ) {
912
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
915
913
916
914
await I . amOnPage ( '/form/wait_detached' ) ;
917
915
await I . see ( 'Step One Button' ) ;
@@ -925,8 +923,8 @@ module.exports.tests = function () {
925
923
}
926
924
} ) ;
927
925
928
- it ( 'should throw an error if the element still exists in DOM by XPath' , async ( ) => {
929
- if ( isHelper ( 'TestCafe' ) ) return ;
926
+ it ( 'should throw an error if the element still exists in DOM by XPath' , async function ( ) {
927
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
930
928
931
929
await I . amOnPage ( '/form/wait_detached' ) ;
932
930
await I . see ( 'Step One Button' ) ;
@@ -940,8 +938,8 @@ module.exports.tests = function () {
940
938
}
941
939
} ) ;
942
940
943
- it ( 'should wait for element to be removed from DOM' , async ( ) => {
944
- if ( isHelper ( 'TestCafe' ) ) return ;
941
+ it ( 'should wait for element to be removed from DOM' , async function ( ) {
942
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
945
943
946
944
await I . amOnPage ( '/form/wait_detached' ) ;
947
945
await I . see ( 'Step Two Button' ) ;
@@ -950,8 +948,8 @@ module.exports.tests = function () {
950
948
await I . dontSeeElementInDOM ( '#step_2' ) ;
951
949
} ) ;
952
950
953
- it ( 'should wait for element to be removed from DOM by XPath' , async ( ) => {
954
- if ( isHelper ( 'TestCafe' ) ) return ;
951
+ it ( 'should wait for element to be removed from DOM by XPath' , async function ( ) {
952
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
955
953
956
954
await I . amOnPage ( '/form/wait_detached' ) ;
957
955
await I . seeElement ( '//div[@id="step_2"]' ) ;
@@ -1010,8 +1008,6 @@ module.exports.tests = function () {
1010
1008
} ) ;
1011
1009
1012
1010
it ( 'should execute within block 2' , async ( ) => {
1013
- if ( isHelper ( 'TestCafe' ) ) return ;
1014
-
1015
1011
await I . amOnPage ( '/form/example4' ) ;
1016
1012
await I . fillField ( 'Hasło' , '12345' ) ;
1017
1013
await I . _withinBegin ( { xpath : '//div[@class="form-group"][2]' } ) ;
@@ -1025,8 +1021,8 @@ module.exports.tests = function () {
1025
1021
assert . equal ( input , '12345' ) ;
1026
1022
} ) ;
1027
1023
1028
- it ( 'within should respect context in see' , async ( ) => {
1029
- if ( isHelper ( 'TestCafe' ) ) return ;
1024
+ it ( 'within should respect context in see' , async function ( ) {
1025
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
1030
1026
1031
1027
await I . amOnPage ( '/form/example4' ) ;
1032
1028
await I . see ( 'Rejestracja' , 'fieldset' ) ;
@@ -1047,6 +1043,7 @@ module.exports.tests = function () {
1047
1043
1048
1044
it ( 'within should respect context in see when using nested frames' , async function ( ) {
1049
1045
if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
1046
+
1050
1047
await I . amOnPage ( '/iframe_nested' ) ;
1051
1048
await I . _withinBegin ( {
1052
1049
frame : [ '#wrapperId' , '[name=content]' ] ,
@@ -1073,9 +1070,9 @@ module.exports.tests = function () {
1073
1070
} ) ;
1074
1071
1075
1072
describe ( 'scroll: #scrollTo, #scrollPageToTop, #scrollPageToBottom' , ( ) => {
1076
- it ( 'should scroll inside an iframe' , async ( ) => {
1073
+ it ( 'should scroll inside an iframe' , async function ( ) {
1077
1074
if ( isHelper ( 'Nightmare' ) ) return ;
1078
- if ( isHelper ( 'TestCafe' ) ) return ;
1075
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
1079
1076
1080
1077
await I . amOnPage ( '/iframe' ) ;
1081
1078
await I . resizeWindow ( 500 , 700 ) ;
@@ -1135,9 +1132,9 @@ module.exports.tests = function () {
1135
1132
} ) ;
1136
1133
1137
1134
describe ( '#grabCssPropertyFrom' , ( ) => {
1138
- it ( 'should grab css property for given element' , async ( ) => {
1135
+ it ( 'should grab css property for given element' , async function ( ) {
1139
1136
if ( isHelper ( 'Nightmare' ) ) return ;
1140
- if ( isHelper ( 'TestCafe' ) ) return ;
1137
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
1141
1138
1142
1139
await I . amOnPage ( '/form/doubleclick' ) ;
1143
1140
const css = await I . grabCssPropertyFrom ( '#block' , 'height' ) ;
@@ -1155,9 +1152,9 @@ module.exports.tests = function () {
1155
1152
} ) ;
1156
1153
1157
1154
describe ( '#seeAttributesOnElements' , ( ) => {
1158
- it ( 'should check attributes values for given element' , async ( ) => {
1155
+ it ( 'should check attributes values for given element' , async function ( ) {
1159
1156
if ( isHelper ( 'Nightmare' ) ) return ;
1160
- if ( isHelper ( 'TestCafe' ) ) return ;
1157
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
1161
1158
1162
1159
try {
1163
1160
await I . amOnPage ( '/info' ) ;
@@ -1177,9 +1174,9 @@ module.exports.tests = function () {
1177
1174
}
1178
1175
} ) ;
1179
1176
1180
- it ( 'should check attributes values for several elements' , async ( ) => {
1177
+ it ( 'should check attributes values for several elements' , async function ( ) {
1181
1178
if ( isHelper ( 'Nightmare' ) ) return ;
1182
- if ( isHelper ( 'TestCafe' ) ) return ;
1179
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
1183
1180
1184
1181
try {
1185
1182
await I . amOnPage ( '/' ) ;
@@ -1202,9 +1199,9 @@ module.exports.tests = function () {
1202
1199
} ) ;
1203
1200
1204
1201
describe ( '#seeCssPropertiesOnElements' , ( ) => {
1205
- it ( 'should check css property for given element' , async ( ) => {
1202
+ it ( 'should check css property for given element' , async function ( ) {
1206
1203
if ( isHelper ( 'Nightmare' ) ) return ;
1207
- if ( isHelper ( 'TestCafe' ) ) return ;
1204
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
1208
1205
1209
1206
try {
1210
1207
await I . amOnPage ( '/info' ) ;
@@ -1225,9 +1222,9 @@ module.exports.tests = function () {
1225
1222
} ) ;
1226
1223
1227
1224
1228
- it ( 'should check css property for several elements' , async ( ) => {
1225
+ it ( 'should check css property for several elements' , async function ( ) {
1229
1226
if ( isHelper ( 'Nightmare' ) ) return ;
1230
- if ( isHelper ( 'TestCafe' ) ) return ;
1227
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
1231
1228
1232
1229
try {
1233
1230
await I . amOnPage ( '/' ) ;
@@ -1252,9 +1249,9 @@ module.exports.tests = function () {
1252
1249
}
1253
1250
} ) ;
1254
1251
1255
- it ( 'should normalize css color properties for given element' , async ( ) => {
1252
+ it ( 'should normalize css color properties for given element' , async function ( ) {
1256
1253
if ( isHelper ( 'Nightmare' ) ) return ;
1257
- if ( isHelper ( 'TestCafe' ) ) return ;
1254
+ if ( isHelper ( 'TestCafe' ) ) this . skip ( ) ;
1258
1255
1259
1256
await I . amOnPage ( '/form/css_colors' ) ;
1260
1257
await I . seeCssPropertiesOnElements ( '#namedColor' , {
0 commit comments