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.
@@ -249,7 +249,7 @@ declare namespace CodeceptJS {
249
249
  * });
250
250
  * ```
251
251
  */
252
- runOnIOS(caps: any, fn: any): void;
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): void;
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
- * @param currentActivity - Appium: support only Android
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'): void;
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(): void;
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(): void;
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(): void;
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(): void;
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(): void;
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(): void;
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(): void;
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): void;
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
- * @param speed - Appium: support Android and iOS
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(): void;
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("WebDriverIO");
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
@@ -2426,7 +2408,7 @@ 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/master/docs/api.md#pagewaitfornavigationoptions).
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.
@@ -2437,6 +2419,7 @@ declare namespace CodeceptJS {
2437
2419
  * * `manualStart`: (optional, default: false) - do not start browser before a test, start it manually inside a helper with `this.helpers["Playwright"]._startBrowser()`.
2438
2420
  * * `chromium`: (optional) pass additional chromium options
2439
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).
2440
2423
  *
2441
2424
  * #### Video Recording Customization
2442
2425
  *
@@ -2591,10 +2574,10 @@ declare namespace CodeceptJS {
2591
2574
  * First argument is a description of an action.
2592
2575
  * Second argument is async function that gets this helper as parameter.
2593
2576
  *
2594
- * { [`page`](https://github.com/microsoft/playwright/blob/master/docs/api.md#class-page), [`context`](https://github.com/microsoft/playwright/blob/master/docs/api.md#class-context) [`browser`](https://github.com/microsoft/playwright/blob/master/docs/api.md#class-browser) } objects from Playwright API are available.
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.
2595
2578
  *
2596
2579
  * ```js
2597
- * I.usePlaywrightTo('emulate offline mode', async ({ context }) {
2580
+ * I.usePlaywrightTo('emulate offline mode', async ({ context }) => {
2598
2581
  * await context.setOffline(true);
2599
2582
  * });
2600
2583
  * ```
@@ -2889,7 +2872,7 @@ declare namespace CodeceptJS {
2889
2872
  * I.openNewTab();
2890
2873
  * ```
2891
2874
  *
2892
- * You can pass in [page options](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsernewpageoptions) to emulate device on this page
2875
+ * You can pass in [page options](https://github.com/microsoft/playwright/blob/main/docs/api.md#browsernewpageoptions) to emulate device on this page
2893
2876
  *
2894
2877
  * ```js
2895
2878
  * // enable mobile