codeceptjs 3.2.2 → 3.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/docs/advanced.md +5 -1
- package/docs/build/Appium.js +62 -0
- package/docs/build/FileSystem.js +11 -1
- package/docs/build/Playwright.js +12 -7
- package/docs/changelog.md +7 -0
- package/docs/configuration.md +8 -8
- package/docs/custom-helpers.md +1 -1
- package/docs/data.md +9 -9
- package/docs/helpers/Appium.md +239 -197
- package/docs/helpers/FileSystem.md +11 -1
- package/docs/helpers/Playwright.md +210 -207
- package/docs/installation.md +1 -1
- package/docs/mobile.md +11 -11
- package/docs/nightmare.md +3 -3
- package/docs/playwright.md +4 -4
- package/docs/plugins.md +11 -7
- package/docs/puppeteer.md +5 -5
- package/docs/reports.md +1 -1
- package/docs/testcafe.md +1 -1
- package/docs/translation.md +1 -1
- package/docs/visual.md +2 -2
- package/docs/vue.md +1 -1
- package/docs/webdriver.md +2 -2
- package/lib/cli.js +25 -20
- package/lib/command/workers/runTests.js +25 -7
- package/lib/helper/Appium.js +62 -0
- package/lib/helper/FileSystem.js +11 -1
- package/lib/helper/Playwright.js +12 -7
- package/lib/plugin/autoLogin.js +1 -1
- package/lib/plugin/tryTo.js +6 -0
- package/package.json +1 -1
- package/typings/index.d.ts +2 -0
- package/typings/types.d.ts +83 -100
package/lib/helper/Appium.js
CHANGED
|
@@ -331,6 +331,7 @@ class Appium extends Webdriver {
|
|
|
331
331
|
*
|
|
332
332
|
* @param {*} caps
|
|
333
333
|
* @param {*} fn
|
|
334
|
+
* @return {Promise<any>}
|
|
334
335
|
*/
|
|
335
336
|
async runOnIOS(caps, fn) {
|
|
336
337
|
if (this.platform !== 'ios') return;
|
|
@@ -373,6 +374,7 @@ class Appium extends Webdriver {
|
|
|
373
374
|
*
|
|
374
375
|
* @param {*} caps
|
|
375
376
|
* @param {*} fn
|
|
377
|
+
* @return {Promise<any>}
|
|
376
378
|
*/
|
|
377
379
|
async runOnAndroid(caps, fn) {
|
|
378
380
|
if (this.platform !== 'android') return;
|
|
@@ -393,6 +395,7 @@ class Appium extends Webdriver {
|
|
|
393
395
|
* ```
|
|
394
396
|
*
|
|
395
397
|
* @param {*} fn
|
|
398
|
+
* @return {Promise<any>}
|
|
396
399
|
*/
|
|
397
400
|
/* eslint-disable */
|
|
398
401
|
async runInWeb(fn) {
|
|
@@ -434,6 +437,7 @@ class Appium extends Webdriver {
|
|
|
434
437
|
* ```
|
|
435
438
|
*
|
|
436
439
|
* @param {string} bundleId String ID of bundled app
|
|
440
|
+
* @return {Promise<void>}
|
|
437
441
|
*
|
|
438
442
|
* Appium: support only Android
|
|
439
443
|
*/
|
|
@@ -451,6 +455,7 @@ class Appium extends Webdriver {
|
|
|
451
455
|
* ```
|
|
452
456
|
*
|
|
453
457
|
* @param {string} bundleId String ID of bundled app
|
|
458
|
+
* @return {Promise<void>}
|
|
454
459
|
*
|
|
455
460
|
* Appium: support only Android
|
|
456
461
|
*/
|
|
@@ -467,6 +472,7 @@ class Appium extends Webdriver {
|
|
|
467
472
|
* I.installApp('/path/to/file.apk');
|
|
468
473
|
* ```
|
|
469
474
|
* @param {string} path path to apk file
|
|
475
|
+
* @return {Promise<void>}
|
|
470
476
|
*
|
|
471
477
|
* Appium: support only Android
|
|
472
478
|
*/
|
|
@@ -508,6 +514,7 @@ class Appium extends Webdriver {
|
|
|
508
514
|
* I.seeCurrentActivityIs(".HomeScreenActivity")
|
|
509
515
|
* ```
|
|
510
516
|
* @param {string} currentActivity
|
|
517
|
+
* @return {Promise<void>}
|
|
511
518
|
*
|
|
512
519
|
* Appium: support only Android
|
|
513
520
|
*/
|
|
@@ -524,6 +531,8 @@ class Appium extends Webdriver {
|
|
|
524
531
|
* I.seeDeviceIsLocked();
|
|
525
532
|
* ```
|
|
526
533
|
*
|
|
534
|
+
* @return {Promise<void>}
|
|
535
|
+
*
|
|
527
536
|
* Appium: support only Android
|
|
528
537
|
*/
|
|
529
538
|
async seeDeviceIsLocked() {
|
|
@@ -539,6 +548,8 @@ class Appium extends Webdriver {
|
|
|
539
548
|
* I.seeDeviceIsUnlocked();
|
|
540
549
|
* ```
|
|
541
550
|
*
|
|
551
|
+
* @return {Promise<void>}
|
|
552
|
+
*
|
|
542
553
|
* Appium: support only Android
|
|
543
554
|
*/
|
|
544
555
|
async seeDeviceIsUnlocked() {
|
|
@@ -555,6 +566,8 @@ class Appium extends Webdriver {
|
|
|
555
566
|
* I.seeOrientationIs('LANDSCAPE')
|
|
556
567
|
* ```
|
|
557
568
|
*
|
|
569
|
+
* @return {Promise<void>}
|
|
570
|
+
*
|
|
558
571
|
* @param {'LANDSCAPE'|'PORTRAIT'} orientation LANDSCAPE or PORTRAIT
|
|
559
572
|
*
|
|
560
573
|
* Appium: support Android and iOS
|
|
@@ -586,6 +599,7 @@ class Appium extends Webdriver {
|
|
|
586
599
|
* ```
|
|
587
600
|
*
|
|
588
601
|
* @param {'LANDSCAPE'|'PORTRAIT'} orientation LANDSCAPE or PORTRAIT
|
|
602
|
+
* @return {Promise<any>}
|
|
589
603
|
*
|
|
590
604
|
* Appium: support Android and iOS
|
|
591
605
|
*/
|
|
@@ -609,6 +623,8 @@ class Appium extends Webdriver {
|
|
|
609
623
|
* let contexts = await I.grabAllContexts();
|
|
610
624
|
* ```
|
|
611
625
|
*
|
|
626
|
+
* @return {Promise<string[]>}
|
|
627
|
+
*
|
|
612
628
|
* Appium: support Android and iOS
|
|
613
629
|
*/
|
|
614
630
|
async grabAllContexts() {
|
|
@@ -623,6 +639,8 @@ class Appium extends Webdriver {
|
|
|
623
639
|
* let context = await I.grabContext();
|
|
624
640
|
* ```
|
|
625
641
|
*
|
|
642
|
+
* @return {Promise<string|null>}
|
|
643
|
+
*
|
|
626
644
|
* Appium: support Android and iOS
|
|
627
645
|
*/
|
|
628
646
|
async grabContext() {
|
|
@@ -637,6 +655,8 @@ class Appium extends Webdriver {
|
|
|
637
655
|
* let activity = await I.grabCurrentActivity();
|
|
638
656
|
* ```
|
|
639
657
|
*
|
|
658
|
+
* @return {Promise<string>}
|
|
659
|
+
*
|
|
640
660
|
* Appium: support only Android
|
|
641
661
|
*/
|
|
642
662
|
async grabCurrentActivity() {
|
|
@@ -653,6 +673,8 @@ class Appium extends Webdriver {
|
|
|
653
673
|
* let con = await I.grabNetworkConnection();
|
|
654
674
|
* ```
|
|
655
675
|
*
|
|
676
|
+
* @return {Promise<{}>}
|
|
677
|
+
*
|
|
656
678
|
* Appium: support only Android
|
|
657
679
|
*/
|
|
658
680
|
async grabNetworkConnection() {
|
|
@@ -673,6 +695,8 @@ class Appium extends Webdriver {
|
|
|
673
695
|
* let orientation = await I.grabOrientation();
|
|
674
696
|
* ```
|
|
675
697
|
*
|
|
698
|
+
* @return {Promise<string>}
|
|
699
|
+
*
|
|
676
700
|
* Appium: support Android and iOS
|
|
677
701
|
*/
|
|
678
702
|
async grabOrientation() {
|
|
@@ -689,6 +713,8 @@ class Appium extends Webdriver {
|
|
|
689
713
|
* let settings = await I.grabSettings();
|
|
690
714
|
* ```
|
|
691
715
|
*
|
|
716
|
+
* @return {Promise<string>}
|
|
717
|
+
*
|
|
692
718
|
* Appium: support Android and iOS
|
|
693
719
|
*/
|
|
694
720
|
async grabSettings() {
|
|
@@ -720,6 +746,8 @@ class Appium extends Webdriver {
|
|
|
720
746
|
* I.switchToWeb('WEBVIEW_io.selendroid.testapp');
|
|
721
747
|
* ```
|
|
722
748
|
*
|
|
749
|
+
* @return {Promise<void>}
|
|
750
|
+
*
|
|
723
751
|
* @param {string} [context]
|
|
724
752
|
*/
|
|
725
753
|
async switchToWeb(context) {
|
|
@@ -747,6 +775,7 @@ class Appium extends Webdriver {
|
|
|
747
775
|
* I.switchToNative('SOME_OTHER_CONTEXT');
|
|
748
776
|
* ```
|
|
749
777
|
* @param {*} context
|
|
778
|
+
* @return {Promise<void>}
|
|
750
779
|
*/
|
|
751
780
|
async switchToNative(context = null) {
|
|
752
781
|
this.isWeb = false;
|
|
@@ -763,6 +792,8 @@ class Appium extends Webdriver {
|
|
|
763
792
|
* I.startActivity('io.selendroid.testapp', '.RegisterUserActivity');
|
|
764
793
|
* ```
|
|
765
794
|
*
|
|
795
|
+
* @return {Promise<void>}
|
|
796
|
+
*
|
|
766
797
|
* Appium: support only Android
|
|
767
798
|
*/
|
|
768
799
|
async startActivity(appPackage, appActivity) {
|
|
@@ -786,6 +817,8 @@ class Appium extends Webdriver {
|
|
|
786
817
|
* ```
|
|
787
818
|
* See corresponding [webdriverio reference](http://webdriver.io/api/mobile/setNetworkConnection.html).
|
|
788
819
|
*
|
|
820
|
+
* @return {Promise<{}>}
|
|
821
|
+
*
|
|
789
822
|
* Appium: support only Android
|
|
790
823
|
*/
|
|
791
824
|
async setNetworkConnection(value) {
|
|
@@ -801,6 +834,7 @@ class Appium extends Webdriver {
|
|
|
801
834
|
* ```
|
|
802
835
|
*
|
|
803
836
|
* @param {object} settings object
|
|
837
|
+
* @return {Promise<any>}
|
|
804
838
|
*
|
|
805
839
|
* Appium: support Android and iOS
|
|
806
840
|
*/
|
|
@@ -841,6 +875,7 @@ class Appium extends Webdriver {
|
|
|
841
875
|
* ```
|
|
842
876
|
*
|
|
843
877
|
* @param {number} keyValue Device specific key value
|
|
878
|
+
* @return {Promise<void>}
|
|
844
879
|
*
|
|
845
880
|
* Appium: support only Android
|
|
846
881
|
*/
|
|
@@ -859,6 +894,8 @@ class Appium extends Webdriver {
|
|
|
859
894
|
* I.openNotifications();
|
|
860
895
|
* ```
|
|
861
896
|
*
|
|
897
|
+
* @return {Promise<void>}
|
|
898
|
+
*
|
|
862
899
|
* Appium: support only Android
|
|
863
900
|
*/
|
|
864
901
|
async openNotifications() {
|
|
@@ -877,6 +914,8 @@ class Appium extends Webdriver {
|
|
|
877
914
|
* I.makeTouchAction("~buttonStartWebviewCD", 'tap');
|
|
878
915
|
* ```
|
|
879
916
|
*
|
|
917
|
+
* @return {Promise<void>}
|
|
918
|
+
*
|
|
880
919
|
* Appium: support Android and iOS
|
|
881
920
|
*/
|
|
882
921
|
async makeTouchAction(locator, action) {
|
|
@@ -898,6 +937,8 @@ class Appium extends Webdriver {
|
|
|
898
937
|
*
|
|
899
938
|
* Shortcut for `makeTouchAction`
|
|
900
939
|
*
|
|
940
|
+
* @return {Promise<void>}
|
|
941
|
+
*
|
|
901
942
|
* @param {*} locator
|
|
902
943
|
*/
|
|
903
944
|
async tap(locator) {
|
|
@@ -918,6 +959,7 @@ class Appium extends Webdriver {
|
|
|
918
959
|
* @param {number} xoffset
|
|
919
960
|
* @param {number} yoffset
|
|
920
961
|
* @param {number} [speed=1000] (optional), 1000 by default
|
|
962
|
+
* @return {Promise<void>}
|
|
921
963
|
*
|
|
922
964
|
* Appium: support Android and iOS
|
|
923
965
|
*/
|
|
@@ -971,6 +1013,7 @@ class Appium extends Webdriver {
|
|
|
971
1013
|
* @param {CodeceptJS.LocatorOrString} locator
|
|
972
1014
|
* @param {number} [yoffset] (optional)
|
|
973
1015
|
* @param {number} [speed=1000] (optional), 1000 by default
|
|
1016
|
+
* @return {Promise<void>}
|
|
974
1017
|
*
|
|
975
1018
|
* Appium: support Android and iOS
|
|
976
1019
|
*/
|
|
@@ -999,6 +1042,7 @@ class Appium extends Webdriver {
|
|
|
999
1042
|
* @param {CodeceptJS.LocatorOrString} locator
|
|
1000
1043
|
* @param {number} [xoffset] (optional)
|
|
1001
1044
|
* @param {number} [speed=1000] (optional), 1000 by default
|
|
1045
|
+
* @return {Promise<void>}
|
|
1002
1046
|
*
|
|
1003
1047
|
* Appium: support Android and iOS
|
|
1004
1048
|
*/
|
|
@@ -1025,6 +1069,7 @@ class Appium extends Webdriver {
|
|
|
1025
1069
|
* @param {CodeceptJS.LocatorOrString} locator
|
|
1026
1070
|
* @param {number} [xoffset] (optional)
|
|
1027
1071
|
* @param {number} [speed=1000] (optional), 1000 by default
|
|
1072
|
+
* @return {Promise<void>}
|
|
1028
1073
|
*
|
|
1029
1074
|
* Appium: support Android and iOS
|
|
1030
1075
|
*/
|
|
@@ -1051,6 +1096,7 @@ class Appium extends Webdriver {
|
|
|
1051
1096
|
* @param {CodeceptJS.LocatorOrString} locator
|
|
1052
1097
|
* @param {number} [yoffset] (optional)
|
|
1053
1098
|
* @param {number} [speed=1000] (optional), 1000 by default
|
|
1099
|
+
* @return {Promise<void>}
|
|
1054
1100
|
*
|
|
1055
1101
|
* Appium: support Android and iOS
|
|
1056
1102
|
*/
|
|
@@ -1084,6 +1130,7 @@ class Appium extends Webdriver {
|
|
|
1084
1130
|
* @param {number} timeout
|
|
1085
1131
|
* @param {number} offset
|
|
1086
1132
|
* @param {number} speed
|
|
1133
|
+
* @return {Promise<void>}
|
|
1087
1134
|
*
|
|
1088
1135
|
* Appium: support Android and iOS
|
|
1089
1136
|
*/
|
|
@@ -1181,6 +1228,10 @@ class Appium extends Webdriver {
|
|
|
1181
1228
|
* I.pullFile('/storage/emulated/0/DCIM/logo.png', output_dir);
|
|
1182
1229
|
* ```
|
|
1183
1230
|
*
|
|
1231
|
+
* @param {string} path
|
|
1232
|
+
* @param {string} dest
|
|
1233
|
+
* @return {Promise<string>}
|
|
1234
|
+
*
|
|
1184
1235
|
* Appium: support Android and iOS
|
|
1185
1236
|
*/
|
|
1186
1237
|
async pullFile(path, dest) {
|
|
@@ -1200,6 +1251,8 @@ class Appium extends Webdriver {
|
|
|
1200
1251
|
* I.shakeDevice();
|
|
1201
1252
|
* ```
|
|
1202
1253
|
*
|
|
1254
|
+
* @return {Promise<void>}
|
|
1255
|
+
*
|
|
1203
1256
|
* Appium: support only iOS
|
|
1204
1257
|
*/
|
|
1205
1258
|
async shakeDevice() {
|
|
@@ -1216,6 +1269,8 @@ class Appium extends Webdriver {
|
|
|
1216
1269
|
*
|
|
1217
1270
|
* See corresponding [webdriverio reference](http://webdriver.io/api/mobile/rotate.html).
|
|
1218
1271
|
*
|
|
1272
|
+
* @return {Promise<void>}
|
|
1273
|
+
*
|
|
1219
1274
|
* Appium: support only iOS
|
|
1220
1275
|
*/
|
|
1221
1276
|
async rotate(x, y, duration, radius, rotation, touchCount) {
|
|
@@ -1228,6 +1283,8 @@ class Appium extends Webdriver {
|
|
|
1228
1283
|
*
|
|
1229
1284
|
* See corresponding [webdriverio reference](http://webdriver.io/api/mobile/setImmediateValue.html).
|
|
1230
1285
|
*
|
|
1286
|
+
* @return {Promise<void>}
|
|
1287
|
+
*
|
|
1231
1288
|
* Appium: support only iOS
|
|
1232
1289
|
*/
|
|
1233
1290
|
async setImmediateValue(id, value) {
|
|
@@ -1244,6 +1301,8 @@ class Appium extends Webdriver {
|
|
|
1244
1301
|
* I.touchId(false); // simulates invalid fingerprint
|
|
1245
1302
|
* ```
|
|
1246
1303
|
*
|
|
1304
|
+
* @return {Promise<void>}
|
|
1305
|
+
*
|
|
1247
1306
|
* Appium: support only iOS
|
|
1248
1307
|
* TODO: not tested
|
|
1249
1308
|
*/
|
|
@@ -1260,6 +1319,8 @@ class Appium extends Webdriver {
|
|
|
1260
1319
|
* I.closeApp();
|
|
1261
1320
|
* ```
|
|
1262
1321
|
*
|
|
1322
|
+
* @return {Promise<void>}
|
|
1323
|
+
*
|
|
1263
1324
|
* Appium: support only iOS
|
|
1264
1325
|
*/
|
|
1265
1326
|
async closeApp() {
|
|
@@ -1410,6 +1471,7 @@ class Appium extends Webdriver {
|
|
|
1410
1471
|
* ```
|
|
1411
1472
|
*
|
|
1412
1473
|
* @param {string} fileName file name to save.
|
|
1474
|
+
* @return {Promise<void>}
|
|
1413
1475
|
*/
|
|
1414
1476
|
async saveScreenshot(fileName) {
|
|
1415
1477
|
return super.saveScreenshot(fileName, false);
|
package/lib/helper/FileSystem.js
CHANGED
|
@@ -15,7 +15,17 @@ const { fileEquals } = require('../assert/equal');
|
|
|
15
15
|
* I.amInPath('test');
|
|
16
16
|
* I.seeFile('codecept.json');
|
|
17
17
|
* I.seeInThisFile('FileSystem');
|
|
18
|
-
* I.dontSeeInThisFile("
|
|
18
|
+
* I.dontSeeInThisFile("WebDriver");
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* ## Configuration
|
|
22
|
+
*
|
|
23
|
+
* Enable helper in config file:
|
|
24
|
+
*
|
|
25
|
+
* ```js
|
|
26
|
+
* helpers: {
|
|
27
|
+
* FileSystem: {},
|
|
28
|
+
* }
|
|
19
29
|
* ```
|
|
20
30
|
*
|
|
21
31
|
* ## Methods
|
package/lib/helper/Playwright.js
CHANGED
|
@@ -14,7 +14,6 @@ const {
|
|
|
14
14
|
ucfirst,
|
|
15
15
|
fileExists,
|
|
16
16
|
chunkArray,
|
|
17
|
-
toCamelCase,
|
|
18
17
|
convertCssPropertiesToCamelCase,
|
|
19
18
|
screenshotOutputFolder,
|
|
20
19
|
getNormalizedKeyAttributeValue,
|
|
@@ -73,7 +72,7 @@ const { createValueEngine, createDisabledEngine } = require('./extras/Playwright
|
|
|
73
72
|
* * `keepBrowserState`: (optional, default: false) - keep browser state between tests when `restart` is set to false.
|
|
74
73
|
* * `keepCookies`: (optional, default: false) - keep cookies between tests when `restart` is set to false.
|
|
75
74
|
* * `waitForAction`: (optional) how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
|
|
76
|
-
* * `waitForNavigation`: (optional, default: 'load'). When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle`. Choose one of those options is possible. See [Playwright API](https://github.com/microsoft/playwright/blob/
|
|
75
|
+
* * `waitForNavigation`: (optional, default: 'load'). When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle`. Choose one of those options is possible. See [Playwright API](https://github.com/microsoft/playwright/blob/main/docs/api.md#pagewaitfornavigationoptions).
|
|
77
76
|
* * `pressKeyDelay`: (optional, default: '10'). Delay between key presses in ms. Used when calling Playwrights page.type(...) in fillField/appendField
|
|
78
77
|
* * `getPageTimeout` (optional, default: '0') config option to set maximum navigation time in milliseconds.
|
|
79
78
|
* * `waitForTimeout`: (optional) default wait* timeout in ms. Default: 1000.
|
|
@@ -84,6 +83,7 @@ const { createValueEngine, createDisabledEngine } = require('./extras/Playwright
|
|
|
84
83
|
* * `manualStart`: (optional, default: false) - do not start browser before a test, start it manually inside a helper with `this.helpers["Playwright"]._startBrowser()`.
|
|
85
84
|
* * `chromium`: (optional) pass additional chromium options
|
|
86
85
|
* * `electron`: (optional) pass additional electron options
|
|
86
|
+
* * `channel`: (optional) While Playwright can operate against the stock Google Chrome and Microsoft Edge browsers available on the machine. In particular, current Playwright version will support Stable and Beta channels of these browsers. See [Google Chrome & Microsoft Edge](https://playwright.dev/docs/browsers/#google-chrome--microsoft-edge).
|
|
87
87
|
*
|
|
88
88
|
* #### Video Recording Customization
|
|
89
89
|
*
|
|
@@ -301,6 +301,11 @@ class Playwright extends Helper {
|
|
|
301
301
|
headless: !this.options.show,
|
|
302
302
|
...this._getOptionsForBrowser(config),
|
|
303
303
|
};
|
|
304
|
+
|
|
305
|
+
if (this.options.channel && this.options.browser === 'chromium') {
|
|
306
|
+
this.playwrightOptions.channel = this.options.channel;
|
|
307
|
+
}
|
|
308
|
+
|
|
304
309
|
if (this.options.video) {
|
|
305
310
|
this.options.recordVideo = { size: parseWindowSize(this.options.windowSize) };
|
|
306
311
|
}
|
|
@@ -501,10 +506,10 @@ class Playwright extends Helper {
|
|
|
501
506
|
* First argument is a description of an action.
|
|
502
507
|
* Second argument is async function that gets this helper as parameter.
|
|
503
508
|
*
|
|
504
|
-
* { [`page`](https://github.com/microsoft/playwright/blob/
|
|
509
|
+
* { [`page`](https://github.com/microsoft/playwright/blob/main/docs/src/api/class-page.md), [`context`](https://github.com/microsoft/playwright/blob/main/docs/src/api/class-browsercontext.md) [`browser`](https://github.com/microsoft/playwright/blob/main/docs/src/api/class-browser.md) } objects from Playwright API are available.
|
|
505
510
|
*
|
|
506
511
|
* ```js
|
|
507
|
-
* I.usePlaywrightTo('emulate offline mode', async ({ context }) {
|
|
512
|
+
* I.usePlaywrightTo('emulate offline mode', async ({ context }) => {
|
|
508
513
|
* await context.setOffline(true);
|
|
509
514
|
* });
|
|
510
515
|
* ```
|
|
@@ -1071,7 +1076,7 @@ class Playwright extends Helper {
|
|
|
1071
1076
|
* I.openNewTab();
|
|
1072
1077
|
* ```
|
|
1073
1078
|
*
|
|
1074
|
-
* You can pass in [page options](https://github.com/microsoft/playwright/blob/
|
|
1079
|
+
* You can pass in [page options](https://github.com/microsoft/playwright/blob/main/docs/api.md#browsernewpageoptions) to emulate device on this page
|
|
1075
1080
|
*
|
|
1076
1081
|
* ```js
|
|
1077
1082
|
* // enable mobile
|
|
@@ -1580,7 +1585,7 @@ class Playwright extends Helper {
|
|
|
1580
1585
|
*/
|
|
1581
1586
|
async clearCookie() {
|
|
1582
1587
|
// Playwright currently doesn't support to delete a certain cookie
|
|
1583
|
-
// https://github.com/microsoft/playwright/blob/
|
|
1588
|
+
// https://github.com/microsoft/playwright/blob/main/docs/api.md#class-browsercontext
|
|
1584
1589
|
if (!this.browserContext) return;
|
|
1585
1590
|
return this.browserContext.clearCookies();
|
|
1586
1591
|
}
|
|
@@ -1888,7 +1893,7 @@ class Playwright extends Helper {
|
|
|
1888
1893
|
}
|
|
1889
1894
|
|
|
1890
1895
|
if (this.options.trace) {
|
|
1891
|
-
const path = `${global.output_dir}/trace/${clearString(test.title)
|
|
1896
|
+
const path = `${`${global.output_dir}/trace/${clearString(test.title)}`.slice(0, 251)}.zip`;
|
|
1892
1897
|
await this.browserContext.tracing.stop({ path });
|
|
1893
1898
|
test.artifacts.trace = path;
|
|
1894
1899
|
}
|
package/lib/plugin/autoLogin.js
CHANGED
package/lib/plugin/tryTo.js
CHANGED
|
@@ -42,6 +42,12 @@ const defaultConfig = {
|
|
|
42
42
|
* #### Multiple Conditional Assertions
|
|
43
43
|
*
|
|
44
44
|
* ```js
|
|
45
|
+
*
|
|
46
|
+
* Add assert requires first:
|
|
47
|
+
* ```js
|
|
48
|
+
* const assert = require('assert');
|
|
49
|
+
* ```
|
|
50
|
+
* Then use the assert:
|
|
45
51
|
* const result1 = await tryTo(() => I.see('Hello, user'));
|
|
46
52
|
* const result2 = await tryTo(() => I.seeElement('.welcome'));
|
|
47
53
|
* assert.ok(result1 && result2, 'Assertions were not succesful');
|
package/package.json
CHANGED