codeceptjs 3.1.3 → 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 +75 -1
- package/README.md +2 -3
- package/bin/codecept.js +1 -0
- package/docs/advanced.md +99 -61
- package/docs/basics.md +27 -2
- package/docs/bdd.md +2 -2
- package/docs/build/Appium.js +62 -0
- package/docs/build/FileSystem.js +12 -1
- package/docs/build/Playwright.js +37 -33
- package/docs/build/Protractor.js +9 -24
- package/docs/build/Puppeteer.js +10 -28
- package/docs/build/REST.js +1 -0
- package/docs/build/WebDriver.js +2 -24
- package/docs/changelog.md +75 -1
- package/docs/configuration.md +8 -8
- package/docs/custom-helpers.md +2 -37
- package/docs/data.md +9 -9
- package/docs/helpers/Appium.md +240 -198
- package/docs/helpers/FileSystem.md +12 -2
- package/docs/helpers/Playwright.md +226 -225
- package/docs/helpers/Puppeteer.md +1 -17
- package/docs/helpers/REST.md +3 -1
- package/docs/helpers/WebDriver.md +1 -17
- package/docs/installation.md +1 -1
- package/docs/mobile-react-native-locators.md +3 -0
- package/docs/mobile.md +11 -11
- package/docs/nightmare.md +3 -3
- package/docs/pageobjects.md +2 -0
- package/docs/playwright.md +4 -4
- package/docs/plugins.md +138 -9
- package/docs/puppeteer.md +5 -5
- package/docs/reports.md +3 -3
- 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/actor.js +19 -1
- package/lib/cli.js +25 -20
- package/lib/codecept.js +2 -0
- package/lib/command/info.js +1 -1
- package/lib/command/workers/runTests.js +25 -7
- package/lib/config.js +12 -0
- package/lib/container.js +3 -1
- package/lib/helper/Appium.js +62 -0
- package/lib/helper/FileSystem.js +12 -1
- package/lib/helper/Playwright.js +37 -23
- package/lib/helper/Protractor.js +2 -14
- package/lib/helper/Puppeteer.js +3 -18
- package/lib/helper/REST.js +1 -0
- package/lib/helper/WebDriver.js +2 -14
- package/lib/interfaces/featureConfig.js +3 -0
- package/lib/interfaces/scenarioConfig.js +4 -0
- package/lib/listener/steps.js +21 -3
- package/lib/listener/timeout.js +72 -0
- package/lib/locator.js +3 -0
- package/lib/plugin/allure.js +6 -1
- package/lib/plugin/autoLogin.js +1 -1
- package/lib/plugin/retryFailedStep.js +4 -3
- package/lib/plugin/retryTo.js +130 -0
- package/lib/plugin/screenshotOnFail.js +1 -0
- package/lib/plugin/stepByStepReport.js +7 -0
- package/lib/plugin/stepTimeout.js +91 -0
- package/lib/plugin/tryTo.js +6 -0
- package/lib/recorder.js +18 -6
- package/lib/step.js +58 -0
- package/lib/store.js +2 -0
- package/lib/ui.js +2 -2
- package/package.json +4 -6
- package/typings/index.d.ts +8 -1
- package/typings/types.d.ts +149 -164
- package/docs/angular.md +0 -325
- package/docs/helpers/Protractor.md +0 -1658
- package/docs/webapi/waitUntil.mustache +0 -11
- package/typings/Protractor.d.ts +0 -16
package/typings/types.d.ts
CHANGED
|
@@ -249,7 +249,7 @@ declare namespace CodeceptJS {
|
|
|
249
249
|
* });
|
|
250
250
|
* ```
|
|
251
251
|
*/
|
|
252
|
-
runOnIOS(caps: any, fn: any):
|
|
252
|
+
runOnIOS(caps: any, fn: any): Promise<any>;
|
|
253
253
|
/**
|
|
254
254
|
* Execute code only on Android
|
|
255
255
|
*
|
|
@@ -281,7 +281,7 @@ declare namespace CodeceptJS {
|
|
|
281
281
|
* });
|
|
282
282
|
* ```
|
|
283
283
|
*/
|
|
284
|
-
runOnAndroid(caps: any, fn: any):
|
|
284
|
+
runOnAndroid(caps: any, fn: any): Promise<any>;
|
|
285
285
|
/**
|
|
286
286
|
* Check if an app is installed.
|
|
287
287
|
*
|
|
@@ -289,10 +289,9 @@ declare namespace CodeceptJS {
|
|
|
289
289
|
* I.seeAppIsInstalled("com.example.android.apis");
|
|
290
290
|
* ```
|
|
291
291
|
* @param bundleId - String ID of bundled app
|
|
292
|
-
*
|
|
293
|
-
* Appium: support only Android
|
|
292
|
+
* @returns Appium: support only Android
|
|
294
293
|
*/
|
|
295
|
-
seeAppIsInstalled(bundleId: string): void
|
|
294
|
+
seeAppIsInstalled(bundleId: string): Promise<void>;
|
|
296
295
|
/**
|
|
297
296
|
* Check if an app is not installed.
|
|
298
297
|
*
|
|
@@ -300,10 +299,9 @@ declare namespace CodeceptJS {
|
|
|
300
299
|
* I.seeAppIsNotInstalled("com.example.android.apis");
|
|
301
300
|
* ```
|
|
302
301
|
* @param bundleId - String ID of bundled app
|
|
303
|
-
*
|
|
304
|
-
* Appium: support only Android
|
|
302
|
+
* @returns Appium: support only Android
|
|
305
303
|
*/
|
|
306
|
-
seeAppIsNotInstalled(bundleId: string): void
|
|
304
|
+
seeAppIsNotInstalled(bundleId: string): Promise<void>;
|
|
307
305
|
/**
|
|
308
306
|
* Install an app on device.
|
|
309
307
|
*
|
|
@@ -311,10 +309,9 @@ declare namespace CodeceptJS {
|
|
|
311
309
|
* I.installApp('/path/to/file.apk');
|
|
312
310
|
* ```
|
|
313
311
|
* @param path - path to apk file
|
|
314
|
-
*
|
|
315
|
-
* Appium: support only Android
|
|
312
|
+
* @returns Appium: support only Android
|
|
316
313
|
*/
|
|
317
|
-
installApp(path: string): void
|
|
314
|
+
installApp(path: string): Promise<void>;
|
|
318
315
|
/**
|
|
319
316
|
* Remove an app from the device.
|
|
320
317
|
*
|
|
@@ -332,29 +329,27 @@ declare namespace CodeceptJS {
|
|
|
332
329
|
* ```js
|
|
333
330
|
* I.seeCurrentActivityIs(".HomeScreenActivity")
|
|
334
331
|
* ```
|
|
335
|
-
* @
|
|
332
|
+
* @returns Appium: support only Android
|
|
336
333
|
*/
|
|
337
|
-
seeCurrentActivityIs(currentActivity: string): void
|
|
334
|
+
seeCurrentActivityIs(currentActivity: string): Promise<void>;
|
|
338
335
|
/**
|
|
339
336
|
* Check whether the device is locked.
|
|
340
337
|
*
|
|
341
338
|
* ```js
|
|
342
339
|
* I.seeDeviceIsLocked();
|
|
343
340
|
* ```
|
|
344
|
-
*
|
|
345
|
-
* Appium: support only Android
|
|
341
|
+
* @returns Appium: support only Android
|
|
346
342
|
*/
|
|
347
|
-
seeDeviceIsLocked(): void
|
|
343
|
+
seeDeviceIsLocked(): Promise<void>;
|
|
348
344
|
/**
|
|
349
345
|
* Check whether the device is not locked.
|
|
350
346
|
*
|
|
351
347
|
* ```js
|
|
352
348
|
* I.seeDeviceIsUnlocked();
|
|
353
349
|
* ```
|
|
354
|
-
*
|
|
355
|
-
* Appium: support only Android
|
|
350
|
+
* @returns Appium: support only Android
|
|
356
351
|
*/
|
|
357
|
-
seeDeviceIsUnlocked(): void
|
|
352
|
+
seeDeviceIsUnlocked(): Promise<void>;
|
|
358
353
|
/**
|
|
359
354
|
* Check the device orientation
|
|
360
355
|
*
|
|
@@ -366,7 +361,7 @@ declare namespace CodeceptJS {
|
|
|
366
361
|
*
|
|
367
362
|
* Appium: support Android and iOS
|
|
368
363
|
*/
|
|
369
|
-
seeOrientationIs(orientation: 'LANDSCAPE' | 'PORTRAIT'): void
|
|
364
|
+
seeOrientationIs(orientation: 'LANDSCAPE' | 'PORTRAIT'): Promise<void>;
|
|
370
365
|
/**
|
|
371
366
|
* Set a device orientation. Will fail, if app will not set orientation
|
|
372
367
|
*
|
|
@@ -375,40 +370,36 @@ declare namespace CodeceptJS {
|
|
|
375
370
|
* I.setOrientation('LANDSCAPE')
|
|
376
371
|
* ```
|
|
377
372
|
* @param orientation - LANDSCAPE or PORTRAIT
|
|
378
|
-
*
|
|
379
|
-
* Appium: support Android and iOS
|
|
373
|
+
* @returns Appium: support Android and iOS
|
|
380
374
|
*/
|
|
381
|
-
setOrientation(orientation: 'LANDSCAPE' | 'PORTRAIT'):
|
|
375
|
+
setOrientation(orientation: 'LANDSCAPE' | 'PORTRAIT'): Promise<any>;
|
|
382
376
|
/**
|
|
383
377
|
* Get list of all available contexts
|
|
384
378
|
*
|
|
385
379
|
* ```
|
|
386
380
|
* let contexts = await I.grabAllContexts();
|
|
387
381
|
* ```
|
|
388
|
-
*
|
|
389
|
-
* Appium: support Android and iOS
|
|
382
|
+
* @returns Appium: support Android and iOS
|
|
390
383
|
*/
|
|
391
|
-
grabAllContexts():
|
|
384
|
+
grabAllContexts(): Promise<string[]>;
|
|
392
385
|
/**
|
|
393
386
|
* Retrieve current context
|
|
394
387
|
*
|
|
395
388
|
* ```js
|
|
396
389
|
* let context = await I.grabContext();
|
|
397
390
|
* ```
|
|
398
|
-
*
|
|
399
|
-
* Appium: support Android and iOS
|
|
391
|
+
* @returns Appium: support Android and iOS
|
|
400
392
|
*/
|
|
401
|
-
grabContext():
|
|
393
|
+
grabContext(): Promise<string | null>;
|
|
402
394
|
/**
|
|
403
395
|
* Get current device activity.
|
|
404
396
|
*
|
|
405
397
|
* ```js
|
|
406
398
|
* let activity = await I.grabCurrentActivity();
|
|
407
399
|
* ```
|
|
408
|
-
*
|
|
409
|
-
* Appium: support only Android
|
|
400
|
+
* @returns Appium: support only Android
|
|
410
401
|
*/
|
|
411
|
-
grabCurrentActivity():
|
|
402
|
+
grabCurrentActivity(): Promise<string>;
|
|
412
403
|
/**
|
|
413
404
|
* Get information about the current network connection (Data/WIFI/Airplane).
|
|
414
405
|
* The actual server value will be a number. However WebdriverIO additional
|
|
@@ -417,30 +408,27 @@ declare namespace CodeceptJS {
|
|
|
417
408
|
* ```js
|
|
418
409
|
* let con = await I.grabNetworkConnection();
|
|
419
410
|
* ```
|
|
420
|
-
*
|
|
421
|
-
* Appium: support only Android
|
|
411
|
+
* @returns Appium: support only Android
|
|
422
412
|
*/
|
|
423
|
-
grabNetworkConnection():
|
|
413
|
+
grabNetworkConnection(): Promise<{}>;
|
|
424
414
|
/**
|
|
425
415
|
* Get current orientation.
|
|
426
416
|
*
|
|
427
417
|
* ```js
|
|
428
418
|
* let orientation = await I.grabOrientation();
|
|
429
419
|
* ```
|
|
430
|
-
*
|
|
431
|
-
* Appium: support Android and iOS
|
|
420
|
+
* @returns Appium: support Android and iOS
|
|
432
421
|
*/
|
|
433
|
-
grabOrientation():
|
|
422
|
+
grabOrientation(): Promise<string>;
|
|
434
423
|
/**
|
|
435
424
|
* Get all the currently specified settings.
|
|
436
425
|
*
|
|
437
426
|
* ```js
|
|
438
427
|
* let settings = await I.grabSettings();
|
|
439
428
|
* ```
|
|
440
|
-
*
|
|
441
|
-
* Appium: support Android and iOS
|
|
429
|
+
* @returns Appium: support Android and iOS
|
|
442
430
|
*/
|
|
443
|
-
grabSettings():
|
|
431
|
+
grabSettings(): Promise<string>;
|
|
444
432
|
/**
|
|
445
433
|
* Switch to the specified context.
|
|
446
434
|
* @param context - the context to switch to
|
|
@@ -458,7 +446,7 @@ declare namespace CodeceptJS {
|
|
|
458
446
|
* I.switchToWeb('WEBVIEW_io.selendroid.testapp');
|
|
459
447
|
* ```
|
|
460
448
|
*/
|
|
461
|
-
switchToWeb(context?: string): void
|
|
449
|
+
switchToWeb(context?: string): Promise<void>;
|
|
462
450
|
/**
|
|
463
451
|
* Switches to native context.
|
|
464
452
|
* By default switches to NATIVE_APP context unless other specified.
|
|
@@ -470,17 +458,16 @@ declare namespace CodeceptJS {
|
|
|
470
458
|
* I.switchToNative('SOME_OTHER_CONTEXT');
|
|
471
459
|
* ```
|
|
472
460
|
*/
|
|
473
|
-
switchToNative(context: any): void
|
|
461
|
+
switchToNative(context: any): Promise<void>;
|
|
474
462
|
/**
|
|
475
463
|
* Start an arbitrary Android activity during a session.
|
|
476
464
|
*
|
|
477
465
|
* ```js
|
|
478
466
|
* I.startActivity('io.selendroid.testapp', '.RegisterUserActivity');
|
|
479
467
|
* ```
|
|
480
|
-
*
|
|
481
|
-
* Appium: support only Android
|
|
468
|
+
* @returns Appium: support only Android
|
|
482
469
|
*/
|
|
483
|
-
startActivity(): void
|
|
470
|
+
startActivity(): Promise<void>;
|
|
484
471
|
/**
|
|
485
472
|
* Set network connection mode.
|
|
486
473
|
*
|
|
@@ -496,10 +483,9 @@ declare namespace CodeceptJS {
|
|
|
496
483
|
* I.setNetworkConnection(6) // airplane mode off, wifi on, data on
|
|
497
484
|
* ```
|
|
498
485
|
* See corresponding [webdriverio reference](http://webdriver.io/api/mobile/setNetworkConnection.html).
|
|
499
|
-
*
|
|
500
|
-
* Appium: support only Android
|
|
486
|
+
* @returns Appium: support only Android
|
|
501
487
|
*/
|
|
502
|
-
setNetworkConnection():
|
|
488
|
+
setNetworkConnection(): Promise<{}>;
|
|
503
489
|
/**
|
|
504
490
|
* Update the current setting on the device
|
|
505
491
|
*
|
|
@@ -507,10 +493,9 @@ declare namespace CodeceptJS {
|
|
|
507
493
|
* I.setSettings({cyberdelia: 'open'});
|
|
508
494
|
* ```
|
|
509
495
|
* @param settings - object
|
|
510
|
-
*
|
|
511
|
-
* Appium: support Android and iOS
|
|
496
|
+
* @returns Appium: support Android and iOS
|
|
512
497
|
*/
|
|
513
|
-
setSettings(settings: any):
|
|
498
|
+
setSettings(settings: any): Promise<any>;
|
|
514
499
|
/**
|
|
515
500
|
* Hide the keyboard.
|
|
516
501
|
*
|
|
@@ -536,20 +521,18 @@ declare namespace CodeceptJS {
|
|
|
536
521
|
* I.sendDeviceKeyEvent(3);
|
|
537
522
|
* ```
|
|
538
523
|
* @param keyValue - Device specific key value
|
|
539
|
-
*
|
|
540
|
-
* Appium: support only Android
|
|
524
|
+
* @returns Appium: support only Android
|
|
541
525
|
*/
|
|
542
|
-
sendDeviceKeyEvent(keyValue: number): void
|
|
526
|
+
sendDeviceKeyEvent(keyValue: number): Promise<void>;
|
|
543
527
|
/**
|
|
544
528
|
* Open the notifications panel on the device.
|
|
545
529
|
*
|
|
546
530
|
* ```js
|
|
547
531
|
* I.openNotifications();
|
|
548
532
|
* ```
|
|
549
|
-
*
|
|
550
|
-
* Appium: support only Android
|
|
533
|
+
* @returns Appium: support only Android
|
|
551
534
|
*/
|
|
552
|
-
openNotifications(): void
|
|
535
|
+
openNotifications(): Promise<void>;
|
|
553
536
|
/**
|
|
554
537
|
* The Touch Action API provides the basis of all gestures that can be
|
|
555
538
|
* automated in Appium. At its core is the ability to chain together ad hoc
|
|
@@ -560,10 +543,9 @@ declare namespace CodeceptJS {
|
|
|
560
543
|
* ```js
|
|
561
544
|
* I.makeTouchAction("~buttonStartWebviewCD", 'tap');
|
|
562
545
|
* ```
|
|
563
|
-
*
|
|
564
|
-
* Appium: support Android and iOS
|
|
546
|
+
* @returns Appium: support Android and iOS
|
|
565
547
|
*/
|
|
566
|
-
makeTouchAction(): void
|
|
548
|
+
makeTouchAction(): Promise<void>;
|
|
567
549
|
/**
|
|
568
550
|
* Taps on element.
|
|
569
551
|
*
|
|
@@ -573,7 +555,7 @@ declare namespace CodeceptJS {
|
|
|
573
555
|
*
|
|
574
556
|
* Shortcut for `makeTouchAction`
|
|
575
557
|
*/
|
|
576
|
-
tap(locator: any): void
|
|
558
|
+
tap(locator: any): Promise<void>;
|
|
577
559
|
/**
|
|
578
560
|
* Perform a swipe on the screen.
|
|
579
561
|
*
|
|
@@ -594,10 +576,9 @@ declare namespace CodeceptJS {
|
|
|
594
576
|
* ```
|
|
595
577
|
* @param [yoffset = 1000] - (optional)
|
|
596
578
|
* @param [speed = 1000] - (optional), 1000 by default
|
|
597
|
-
*
|
|
598
|
-
* Appium: support Android and iOS
|
|
579
|
+
* @returns Appium: support Android and iOS
|
|
599
580
|
*/
|
|
600
|
-
swipeDown(locator: CodeceptJS.LocatorOrString, yoffset?: number, speed?: number): void
|
|
581
|
+
swipeDown(locator: CodeceptJS.LocatorOrString, yoffset?: number, speed?: number): Promise<void>;
|
|
601
582
|
/**
|
|
602
583
|
* Perform a swipe left on an element.
|
|
603
584
|
*
|
|
@@ -609,10 +590,9 @@ declare namespace CodeceptJS {
|
|
|
609
590
|
* ```
|
|
610
591
|
* @param [xoffset = 1000] - (optional)
|
|
611
592
|
* @param [speed = 1000] - (optional), 1000 by default
|
|
612
|
-
*
|
|
613
|
-
* Appium: support Android and iOS
|
|
593
|
+
* @returns Appium: support Android and iOS
|
|
614
594
|
*/
|
|
615
|
-
swipeLeft(locator: CodeceptJS.LocatorOrString, xoffset?: number, speed?: number): void
|
|
595
|
+
swipeLeft(locator: CodeceptJS.LocatorOrString, xoffset?: number, speed?: number): Promise<void>;
|
|
616
596
|
/**
|
|
617
597
|
* Perform a swipe right on an element.
|
|
618
598
|
*
|
|
@@ -624,10 +604,9 @@ declare namespace CodeceptJS {
|
|
|
624
604
|
* ```
|
|
625
605
|
* @param [xoffset = 1000] - (optional)
|
|
626
606
|
* @param [speed = 1000] - (optional), 1000 by default
|
|
627
|
-
*
|
|
628
|
-
* Appium: support Android and iOS
|
|
607
|
+
* @returns Appium: support Android and iOS
|
|
629
608
|
*/
|
|
630
|
-
swipeRight(locator: CodeceptJS.LocatorOrString, xoffset?: number, speed?: number): void
|
|
609
|
+
swipeRight(locator: CodeceptJS.LocatorOrString, xoffset?: number, speed?: number): Promise<void>;
|
|
631
610
|
/**
|
|
632
611
|
* Perform a swipe up on an element.
|
|
633
612
|
*
|
|
@@ -639,10 +618,9 @@ declare namespace CodeceptJS {
|
|
|
639
618
|
* ```
|
|
640
619
|
* @param [yoffset = 1000] - (optional)
|
|
641
620
|
* @param [speed = 1000] - (optional), 1000 by default
|
|
642
|
-
*
|
|
643
|
-
* Appium: support Android and iOS
|
|
621
|
+
* @returns Appium: support Android and iOS
|
|
644
622
|
*/
|
|
645
|
-
swipeUp(locator: CodeceptJS.LocatorOrString, yoffset?: number, speed?: number): void
|
|
623
|
+
swipeUp(locator: CodeceptJS.LocatorOrString, yoffset?: number, speed?: number): Promise<void>;
|
|
646
624
|
/**
|
|
647
625
|
* Perform a swipe in selected direction on an element to searchable element.
|
|
648
626
|
*
|
|
@@ -655,9 +633,9 @@ declare namespace CodeceptJS {
|
|
|
655
633
|
* 100,
|
|
656
634
|
* 500);
|
|
657
635
|
* ```
|
|
658
|
-
* @
|
|
636
|
+
* @returns Appium: support Android and iOS
|
|
659
637
|
*/
|
|
660
|
-
swipeTo(searchableLocator: string, scrollLocator: string, direction: string, timeout: number, offset: number, speed: number): void
|
|
638
|
+
swipeTo(searchableLocator: string, scrollLocator: string, direction: string, timeout: number, offset: number, speed: number): Promise<void>;
|
|
661
639
|
/**
|
|
662
640
|
* Performs a specific touch action.
|
|
663
641
|
* The action object need to contain the action name, x/y coordinates
|
|
@@ -694,20 +672,18 @@ declare namespace CodeceptJS {
|
|
|
694
672
|
* // save file to output dir
|
|
695
673
|
* I.pullFile('/storage/emulated/0/DCIM/logo.png', output_dir);
|
|
696
674
|
* ```
|
|
697
|
-
*
|
|
698
|
-
* Appium: support Android and iOS
|
|
675
|
+
* @returns Appium: support Android and iOS
|
|
699
676
|
*/
|
|
700
|
-
pullFile():
|
|
677
|
+
pullFile(path: string, dest: string): Promise<string>;
|
|
701
678
|
/**
|
|
702
679
|
* Perform a shake action on the device.
|
|
703
680
|
*
|
|
704
681
|
* ```js
|
|
705
682
|
* I.shakeDevice();
|
|
706
683
|
* ```
|
|
707
|
-
*
|
|
708
|
-
* Appium: support only iOS
|
|
684
|
+
* @returns Appium: support only iOS
|
|
709
685
|
*/
|
|
710
|
-
shakeDevice(): void
|
|
686
|
+
shakeDevice(): Promise<void>;
|
|
711
687
|
/**
|
|
712
688
|
* Perform a rotation gesture centered on the specified element.
|
|
713
689
|
*
|
|
@@ -716,18 +692,16 @@ declare namespace CodeceptJS {
|
|
|
716
692
|
* ```
|
|
717
693
|
*
|
|
718
694
|
* See corresponding [webdriverio reference](http://webdriver.io/api/mobile/rotate.html).
|
|
719
|
-
*
|
|
720
|
-
* Appium: support only iOS
|
|
695
|
+
* @returns Appium: support only iOS
|
|
721
696
|
*/
|
|
722
|
-
rotate(): void
|
|
697
|
+
rotate(): Promise<void>;
|
|
723
698
|
/**
|
|
724
699
|
* Set immediate value in app.
|
|
725
700
|
*
|
|
726
701
|
* See corresponding [webdriverio reference](http://webdriver.io/api/mobile/setImmediateValue.html).
|
|
727
|
-
*
|
|
728
|
-
* Appium: support only iOS
|
|
702
|
+
* @returns Appium: support only iOS
|
|
729
703
|
*/
|
|
730
|
-
setImmediateValue(): void
|
|
704
|
+
setImmediateValue(): Promise<void>;
|
|
731
705
|
/**
|
|
732
706
|
* Simulate Touch ID with either valid (match == true) or invalid (match == false) fingerprint.
|
|
733
707
|
*
|
|
@@ -736,21 +710,19 @@ declare namespace CodeceptJS {
|
|
|
736
710
|
* I.touchId(true); // simulates valid fingerprint
|
|
737
711
|
* I.touchId(false); // simulates invalid fingerprint
|
|
738
712
|
* ```
|
|
739
|
-
*
|
|
740
|
-
* Appium: support only iOS
|
|
713
|
+
* @returns Appium: support only iOS
|
|
741
714
|
* TODO: not tested
|
|
742
715
|
*/
|
|
743
|
-
simulateTouchId(): void
|
|
716
|
+
simulateTouchId(): Promise<void>;
|
|
744
717
|
/**
|
|
745
718
|
* Close the given application.
|
|
746
719
|
*
|
|
747
720
|
* ```js
|
|
748
721
|
* I.closeApp();
|
|
749
722
|
* ```
|
|
750
|
-
*
|
|
751
|
-
* Appium: support only iOS
|
|
723
|
+
* @returns Appium: support only iOS
|
|
752
724
|
*/
|
|
753
|
-
closeApp(): void
|
|
725
|
+
closeApp(): Promise<void>;
|
|
754
726
|
/**
|
|
755
727
|
* Appends text to a input field or textarea.
|
|
756
728
|
* Field is located by name, label, CSS or XPath
|
|
@@ -959,7 +931,7 @@ declare namespace CodeceptJS {
|
|
|
959
931
|
* ```
|
|
960
932
|
* @param fileName - file name to save.
|
|
961
933
|
*/
|
|
962
|
-
saveScreenshot(fileName: string): void
|
|
934
|
+
saveScreenshot(fileName: string): Promise<void>;
|
|
963
935
|
/**
|
|
964
936
|
* Scroll element into viewport.
|
|
965
937
|
*
|
|
@@ -1106,7 +1078,17 @@ declare namespace CodeceptJS {
|
|
|
1106
1078
|
* I.amInPath('test');
|
|
1107
1079
|
* I.seeFile('codecept.json');
|
|
1108
1080
|
* I.seeInThisFile('FileSystem');
|
|
1109
|
-
* I.dontSeeInThisFile("
|
|
1081
|
+
* I.dontSeeInThisFile("WebDriver");
|
|
1082
|
+
* ```
|
|
1083
|
+
*
|
|
1084
|
+
* ## Configuration
|
|
1085
|
+
*
|
|
1086
|
+
* Enable helper in config file:
|
|
1087
|
+
*
|
|
1088
|
+
* ```js
|
|
1089
|
+
* helpers: {
|
|
1090
|
+
* FileSystem: {},
|
|
1091
|
+
* }
|
|
1110
1092
|
* ```
|
|
1111
1093
|
*
|
|
1112
1094
|
* ## Methods
|
|
@@ -1147,7 +1129,7 @@ declare namespace CodeceptJS {
|
|
|
1147
1129
|
* I.seeFileNameMatching('.pdf');
|
|
1148
1130
|
* ```
|
|
1149
1131
|
*/
|
|
1150
|
-
seeFileNameMatching(): void;
|
|
1132
|
+
seeFileNameMatching(text: string): void;
|
|
1151
1133
|
/**
|
|
1152
1134
|
* Checks that file found by `seeFile` includes a text.
|
|
1153
1135
|
*/
|
|
@@ -2426,16 +2408,18 @@ declare namespace CodeceptJS {
|
|
|
2426
2408
|
* * `keepBrowserState`: (optional, default: false) - keep browser state between tests when `restart` is set to false.
|
|
2427
2409
|
* * `keepCookies`: (optional, default: false) - keep cookies between tests when `restart` is set to false.
|
|
2428
2410
|
* * `waitForAction`: (optional) how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
|
|
2429
|
-
* * `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/
|
|
2411
|
+
* * `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).
|
|
2430
2412
|
* * `pressKeyDelay`: (optional, default: '10'). Delay between key presses in ms. Used when calling Playwrights page.type(...) in fillField/appendField
|
|
2431
2413
|
* * `getPageTimeout` (optional, default: '0') config option to set maximum navigation time in milliseconds.
|
|
2432
2414
|
* * `waitForTimeout`: (optional) default wait* timeout in ms. Default: 1000.
|
|
2433
2415
|
* * `basicAuth`: (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
|
|
2434
2416
|
* * `windowSize`: (optional) default window size. Set a dimension like `640x480`.
|
|
2435
2417
|
* * `userAgent`: (optional) user-agent string.
|
|
2418
|
+
* * `locale`: (optional) locale string. Example: 'en-GB', 'de-DE', 'fr-FR', ...
|
|
2436
2419
|
* * `manualStart`: (optional, default: false) - do not start browser before a test, start it manually inside a helper with `this.helpers["Playwright"]._startBrowser()`.
|
|
2437
2420
|
* * `chromium`: (optional) pass additional chromium options
|
|
2438
2421
|
* * `electron`: (optional) pass additional electron options
|
|
2422
|
+
* * `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).
|
|
2439
2423
|
*
|
|
2440
2424
|
* #### Video Recording Customization
|
|
2441
2425
|
*
|
|
@@ -2550,6 +2534,19 @@ declare namespace CodeceptJS {
|
|
|
2550
2534
|
* }
|
|
2551
2535
|
* ```
|
|
2552
2536
|
*
|
|
2537
|
+
* #### Example #7: Launch test with a specifc user locale
|
|
2538
|
+
*
|
|
2539
|
+
* ```js
|
|
2540
|
+
* {
|
|
2541
|
+
* helpers: {
|
|
2542
|
+
* Playwright : {
|
|
2543
|
+
* url: "http://localhost",
|
|
2544
|
+
* locale: "fr-FR",
|
|
2545
|
+
* }
|
|
2546
|
+
* }
|
|
2547
|
+
* }
|
|
2548
|
+
* ```
|
|
2549
|
+
*
|
|
2553
2550
|
* Note: When connecting to remote browser `show` and specific `chrome` options (e.g. `headless` or `devtools`) are ignored.
|
|
2554
2551
|
*
|
|
2555
2552
|
* ## Access From Helpers
|
|
@@ -2577,10 +2574,10 @@ declare namespace CodeceptJS {
|
|
|
2577
2574
|
* First argument is a description of an action.
|
|
2578
2575
|
* Second argument is async function that gets this helper as parameter.
|
|
2579
2576
|
*
|
|
2580
|
-
* { [`page`](https://github.com/microsoft/playwright/blob/
|
|
2577
|
+
* { [`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.
|
|
2581
2578
|
*
|
|
2582
2579
|
* ```js
|
|
2583
|
-
* I.usePlaywrightTo('emulate offline mode', async ({ context }) {
|
|
2580
|
+
* I.usePlaywrightTo('emulate offline mode', async ({ context }) => {
|
|
2584
2581
|
* await context.setOffline(true);
|
|
2585
2582
|
* });
|
|
2586
2583
|
* ```
|
|
@@ -2875,7 +2872,7 @@ declare namespace CodeceptJS {
|
|
|
2875
2872
|
* I.openNewTab();
|
|
2876
2873
|
* ```
|
|
2877
2874
|
*
|
|
2878
|
-
* You can pass in [page options](https://github.com/microsoft/playwright/blob/
|
|
2875
|
+
* You can pass in [page options](https://github.com/microsoft/playwright/blob/main/docs/api.md#browsernewpageoptions) to emulate device on this page
|
|
2879
2876
|
*
|
|
2880
2877
|
* ```js
|
|
2881
2878
|
* // enable mobile
|
|
@@ -3860,11 +3857,11 @@ declare namespace CodeceptJS {
|
|
|
3860
3857
|
*/
|
|
3861
3858
|
waitForRequest(urlOrPredicate: string | ((...params: any[]) => any), sec?: number): void;
|
|
3862
3859
|
/**
|
|
3863
|
-
* Waits for a network
|
|
3860
|
+
* Waits for a network response.
|
|
3864
3861
|
*
|
|
3865
3862
|
* ```js
|
|
3866
3863
|
* I.waitForResponse('http://example.com/resource');
|
|
3867
|
-
* I.waitForResponse(
|
|
3864
|
+
* I.waitForResponse(response => response.url() === 'https://example.com' && response.status() === 200);
|
|
3868
3865
|
* ```
|
|
3869
3866
|
* @param [sec = null] - number of seconds to wait
|
|
3870
3867
|
*/
|
|
@@ -3903,18 +3900,6 @@ declare namespace CodeceptJS {
|
|
|
3903
3900
|
* See [Playwright's reference](https://playwright.dev/docs/api/class-page?_highlight=waitfornavi#pagewaitfornavigationoptions)
|
|
3904
3901
|
*/
|
|
3905
3902
|
waitForNavigation(opts: any): void;
|
|
3906
|
-
/**
|
|
3907
|
-
* Waits for a function to return true (waits for 1sec by default).
|
|
3908
|
-
*
|
|
3909
|
-
* ```js
|
|
3910
|
-
* I.waitUntil(() => window.requests == 0);
|
|
3911
|
-
* I.waitUntil(() => window.requests == 0, 5);
|
|
3912
|
-
* ```
|
|
3913
|
-
* @param fn - function which is executed in browser context.
|
|
3914
|
-
* @param [sec = 1] - (optional, `1` by default) time in seconds to wait
|
|
3915
|
-
* @param [timeoutMsg = ''] - message to show in case of timeout fail.
|
|
3916
|
-
*/
|
|
3917
|
-
waitUntil(fn: ((...params: any[]) => any) | string, sec?: number, timeoutMsg?: string, interval?: number): void;
|
|
3918
3903
|
/**
|
|
3919
3904
|
* Waits for an element to become not attached to the DOM on a page (by default waits for 1sec).
|
|
3920
3905
|
* Element can be located by CSS or XPath.
|
|
@@ -4622,11 +4607,12 @@ declare namespace CodeceptJS {
|
|
|
4622
4607
|
/**
|
|
4623
4608
|
* Checks that title is equal to provided one.
|
|
4624
4609
|
*
|
|
4625
|
-
*
|
|
4626
|
-
*
|
|
4627
|
-
*
|
|
4610
|
+
* ```js
|
|
4611
|
+
* I.seeTitleEquals('Test title.');
|
|
4612
|
+
* ```
|
|
4613
|
+
* @param text - value to check.
|
|
4628
4614
|
*/
|
|
4629
|
-
seeTitleEquals(): void;
|
|
4615
|
+
seeTitleEquals(text: string): void;
|
|
4630
4616
|
/**
|
|
4631
4617
|
* Checks that title does not contain text.
|
|
4632
4618
|
*
|
|
@@ -5156,18 +5142,6 @@ declare namespace CodeceptJS {
|
|
|
5156
5142
|
* @param [sec = null] - (optional, `1` by default) time in seconds to wait
|
|
5157
5143
|
*/
|
|
5158
5144
|
waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): void;
|
|
5159
|
-
/**
|
|
5160
|
-
* Waits for a function to return true (waits for 1sec by default).
|
|
5161
|
-
*
|
|
5162
|
-
* ```js
|
|
5163
|
-
* I.waitUntil(() => window.requests == 0);
|
|
5164
|
-
* I.waitUntil(() => window.requests == 0, 5);
|
|
5165
|
-
* ```
|
|
5166
|
-
* @param fn - function which is executed in browser context.
|
|
5167
|
-
* @param [sec = 1] - (optional, `1` by default) time in seconds to wait
|
|
5168
|
-
* @param [timeoutMsg = ''] - message to show in case of timeout fail.
|
|
5169
|
-
*/
|
|
5170
|
-
waitUntil(fn: ((...params: any[]) => any) | string, sec?: number, timeoutMsg?: string, interval?: number): void;
|
|
5171
5145
|
/**
|
|
5172
5146
|
* Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
|
|
5173
5147
|
*
|
|
@@ -5634,11 +5608,12 @@ declare namespace CodeceptJS {
|
|
|
5634
5608
|
/**
|
|
5635
5609
|
* Checks that title is equal to provided one.
|
|
5636
5610
|
*
|
|
5637
|
-
*
|
|
5638
|
-
*
|
|
5639
|
-
*
|
|
5611
|
+
* ```js
|
|
5612
|
+
* I.seeTitleEquals('Test title.');
|
|
5613
|
+
* ```
|
|
5614
|
+
* @param text - value to check.
|
|
5640
5615
|
*/
|
|
5641
|
-
seeTitleEquals(): void;
|
|
5616
|
+
seeTitleEquals(text: string): void;
|
|
5642
5617
|
/**
|
|
5643
5618
|
* Checks that title does not contain text.
|
|
5644
5619
|
*
|
|
@@ -6847,18 +6822,6 @@ declare namespace CodeceptJS {
|
|
|
6847
6822
|
* See [Pupeteer's reference](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagewaitfornavigationoptions)
|
|
6848
6823
|
*/
|
|
6849
6824
|
waitForNavigation(opts: any): void;
|
|
6850
|
-
/**
|
|
6851
|
-
* Waits for a function to return true (waits for 1sec by default).
|
|
6852
|
-
*
|
|
6853
|
-
* ```js
|
|
6854
|
-
* I.waitUntil(() => window.requests == 0);
|
|
6855
|
-
* I.waitUntil(() => window.requests == 0, 5);
|
|
6856
|
-
* ```
|
|
6857
|
-
* @param fn - function which is executed in browser context.
|
|
6858
|
-
* @param [sec = 1] - (optional, `1` by default) time in seconds to wait
|
|
6859
|
-
* @param [timeoutMsg = ''] - message to show in case of timeout fail.
|
|
6860
|
-
*/
|
|
6861
|
-
waitUntil(fn: ((...params: any[]) => any) | string, sec?: number, timeoutMsg?: string, interval?: number): void;
|
|
6862
6825
|
/**
|
|
6863
6826
|
* Waits for an element to become not attached to the DOM on a page (by default waits for 1sec).
|
|
6864
6827
|
* Element can be located by CSS or XPath.
|
|
@@ -6971,8 +6934,9 @@ declare namespace CodeceptJS {
|
|
|
6971
6934
|
* ```js
|
|
6972
6935
|
* I.setRequestTimeout(10000); // In milliseconds
|
|
6973
6936
|
* ```
|
|
6937
|
+
* @param newTimeout - timeout in milliseconds
|
|
6974
6938
|
*/
|
|
6975
|
-
setRequestTimeout(): void;
|
|
6939
|
+
setRequestTimeout(newTimeout: number): void;
|
|
6976
6940
|
/**
|
|
6977
6941
|
* Send GET request to REST API
|
|
6978
6942
|
*
|
|
@@ -8422,7 +8386,7 @@ declare namespace CodeceptJS {
|
|
|
8422
8386
|
* ```
|
|
8423
8387
|
* @param timeouts - WebDriver timeouts object.
|
|
8424
8388
|
*/
|
|
8425
|
-
defineTimeout(timeouts:
|
|
8389
|
+
defineTimeout(timeouts: any): void;
|
|
8426
8390
|
/**
|
|
8427
8391
|
* Opens a web page in a browser. Requires relative or absolute url.
|
|
8428
8392
|
* If url starts with `/`, opens a web page of a site defined in `url` config parameter.
|
|
@@ -9642,18 +9606,6 @@ declare namespace CodeceptJS {
|
|
|
9642
9606
|
* @param [sec = null] - (optional, `1` by default) time in seconds to wait
|
|
9643
9607
|
*/
|
|
9644
9608
|
waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): void;
|
|
9645
|
-
/**
|
|
9646
|
-
* Waits for a function to return true (waits for 1sec by default).
|
|
9647
|
-
*
|
|
9648
|
-
* ```js
|
|
9649
|
-
* I.waitUntil(() => window.requests == 0);
|
|
9650
|
-
* I.waitUntil(() => window.requests == 0, 5);
|
|
9651
|
-
* ```
|
|
9652
|
-
* @param fn - function which is executed in browser context.
|
|
9653
|
-
* @param [sec = 1] - (optional, `1` by default) time in seconds to wait
|
|
9654
|
-
* @param [timeoutMsg = ''] - message to show in case of timeout fail.
|
|
9655
|
-
*/
|
|
9656
|
-
waitUntil(fn: ((...params: any[]) => any) | string, sec?: number, timeoutMsg?: string, interval?: number): void;
|
|
9657
9609
|
/**
|
|
9658
9610
|
* Switches frame or in case of null locator reverts to parent.
|
|
9659
9611
|
*
|
|
@@ -9805,6 +9757,11 @@ declare namespace CodeceptJS {
|
|
|
9805
9757
|
* add print comment method`
|
|
9806
9758
|
*/
|
|
9807
9759
|
say(msg: string, color?: string): Promise<any> | undefined;
|
|
9760
|
+
/**
|
|
9761
|
+
* set the maximum execution time for the next step
|
|
9762
|
+
* @param timeout - step timeout in seconds
|
|
9763
|
+
*/
|
|
9764
|
+
limitTime(timeout: number): this;
|
|
9808
9765
|
retry(opts?: any): this;
|
|
9809
9766
|
}
|
|
9810
9767
|
/**
|
|
@@ -10180,11 +10137,11 @@ declare namespace CodeceptJS {
|
|
|
10180
10137
|
/**
|
|
10181
10138
|
* Filters to modify locators
|
|
10182
10139
|
*/
|
|
10183
|
-
static filters:
|
|
10140
|
+
static filters: ((arg0: CodeceptJS.LocatorOrString, arg1: Locator) => void)[];
|
|
10184
10141
|
/**
|
|
10185
10142
|
* Appends new `Locator` filter to an `Locator.filters` array, and returns the new length of the array.
|
|
10186
10143
|
*/
|
|
10187
|
-
static addFilter():
|
|
10144
|
+
static addFilter(fn: (...params: any[]) => any): number;
|
|
10188
10145
|
}
|
|
10189
10146
|
namespace output {
|
|
10190
10147
|
var stepShift: number;
|
|
@@ -10274,7 +10231,7 @@ declare namespace CodeceptJS {
|
|
|
10274
10231
|
* true: it will retries if `retryOpts` set.
|
|
10275
10232
|
* false: ignore `retryOpts` and won't retry.
|
|
10276
10233
|
*/
|
|
10277
|
-
add(taskName: string | ((...params: any[]) => any), fn?: (...params: any[]) => any, force?: boolean, retry?: boolean): Promise<any> | undefined;
|
|
10234
|
+
add(taskName: string | ((...params: any[]) => any), fn?: (...params: any[]) => any, force?: boolean, retry?: boolean, timeout?: number): Promise<any> | undefined;
|
|
10278
10235
|
retry(opts: any): any;
|
|
10279
10236
|
catch(customErrFn?: (...params: any[]) => any): Promise<any>;
|
|
10280
10237
|
catchWithoutStop(customErrFn: (...params: any[]) => any): Promise<any>;
|
|
@@ -10337,6 +10294,13 @@ declare namespace CodeceptJS {
|
|
|
10337
10294
|
args: any[];
|
|
10338
10295
|
metaStep: MetaStep;
|
|
10339
10296
|
stack: string;
|
|
10297
|
+
getTimeout(): number | undefined;
|
|
10298
|
+
/**
|
|
10299
|
+
* @param timeout - timeout in milliseconds or 0 if no timeout
|
|
10300
|
+
* @param order - order defines the priority of timeout, timeouts set with lower order override those set with higher order.
|
|
10301
|
+
* When order below 0 value of timeout only override if new value is lower
|
|
10302
|
+
*/
|
|
10303
|
+
setTimeout(timeout: number, order: number): void;
|
|
10340
10304
|
setTrace(): void;
|
|
10341
10305
|
setArguments(args: any[]): void;
|
|
10342
10306
|
run(...args: any[]): any;
|
|
@@ -10358,6 +10322,7 @@ declare namespace CodeceptJS {
|
|
|
10358
10322
|
*/
|
|
10359
10323
|
namespace store {
|
|
10360
10324
|
var debugMode: boolean;
|
|
10325
|
+
var timeouts: boolean;
|
|
10361
10326
|
}
|
|
10362
10327
|
/**
|
|
10363
10328
|
* Describe a "suite" with the given `title`
|
|
@@ -10913,3 +10878,23 @@ declare namespace CodeceptJS {
|
|
|
10913
10878
|
}
|
|
10914
10879
|
}
|
|
10915
10880
|
|
|
10881
|
+
/**
|
|
10882
|
+
* timeouts set with order below zero only override timeouts of higher order if their value is smaller
|
|
10883
|
+
*/
|
|
10884
|
+
declare var testOrSuite: any;
|
|
10885
|
+
|
|
10886
|
+
/**
|
|
10887
|
+
* 0-9 - designated for override of timeouts set from code, 5 is used by stepTimeout plugin when stepTimeout.config.overrideStepLimits=true
|
|
10888
|
+
*/
|
|
10889
|
+
declare var stepTimeoutHard: any;
|
|
10890
|
+
|
|
10891
|
+
/**
|
|
10892
|
+
* 10-19 - designated for timeouts set from code, 15 is order of I.setTimeout(t) operation
|
|
10893
|
+
*/
|
|
10894
|
+
declare var codeLimitTime: any;
|
|
10895
|
+
|
|
10896
|
+
/**
|
|
10897
|
+
* 20-29 - designated for timeout settings which could be overriden in tests code, 25 is used by stepTimeout plugin when stepTimeout.config.overrideStepLimits=false
|
|
10898
|
+
*/
|
|
10899
|
+
declare var stepTimeoutSoft: any;
|
|
10900
|
+
|