codeceptjs 3.3.2 → 3.3.5-beta.1

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.
Files changed (77) hide show
  1. package/CHANGELOG.md +44 -2
  2. package/docs/api.md +4 -0
  3. package/docs/basics.md +2 -0
  4. package/docs/bdd.md +12 -0
  5. package/docs/build/JSONResponse.js +44 -3
  6. package/docs/build/Playwright.js +63 -40
  7. package/docs/build/Puppeteer.js +54 -43
  8. package/docs/build/REST.js +23 -9
  9. package/docs/build/WebDriver.js +39 -30
  10. package/docs/changelog.md +6 -2
  11. package/docs/community-helpers.md +1 -0
  12. package/docs/configuration.md +21 -18
  13. package/docs/helpers/Appium.md +0 -723
  14. package/docs/helpers/JSONResponse.md +24 -0
  15. package/docs/helpers/Playwright.md +276 -264
  16. package/docs/helpers/Puppeteer.md +230 -222
  17. package/docs/helpers/REST.md +21 -6
  18. package/docs/helpers/WebDriver.md +265 -259
  19. package/docs/plugins.md +41 -1
  20. package/docs/reports.md +11 -0
  21. package/docs/secrets.md +30 -0
  22. package/docs/wiki/.git/FETCH_HEAD +1 -0
  23. package/docs/wiki/.git/HEAD +1 -0
  24. package/docs/wiki/.git/ORIG_HEAD +1 -0
  25. package/docs/wiki/.git/config +11 -0
  26. package/docs/wiki/.git/description +1 -0
  27. package/docs/wiki/.git/hooks/applypatch-msg.sample +15 -0
  28. package/docs/wiki/.git/hooks/commit-msg.sample +24 -0
  29. package/docs/wiki/.git/hooks/fsmonitor-watchman.sample +173 -0
  30. package/docs/wiki/.git/hooks/post-update.sample +8 -0
  31. package/docs/wiki/.git/hooks/pre-applypatch.sample +14 -0
  32. package/docs/wiki/.git/hooks/pre-commit.sample +49 -0
  33. package/docs/wiki/.git/hooks/pre-merge-commit.sample +13 -0
  34. package/docs/wiki/.git/hooks/pre-push.sample +53 -0
  35. package/docs/wiki/.git/hooks/pre-rebase.sample +169 -0
  36. package/docs/wiki/.git/hooks/pre-receive.sample +24 -0
  37. package/docs/wiki/.git/hooks/prepare-commit-msg.sample +42 -0
  38. package/docs/wiki/.git/hooks/push-to-checkout.sample +78 -0
  39. package/docs/wiki/.git/hooks/update.sample +128 -0
  40. package/docs/wiki/.git/index +0 -0
  41. package/docs/wiki/.git/info/exclude +6 -0
  42. package/docs/wiki/.git/logs/HEAD +1 -0
  43. package/docs/wiki/.git/logs/refs/heads/master +1 -0
  44. package/docs/wiki/.git/logs/refs/remotes/origin/HEAD +1 -0
  45. package/docs/wiki/.git/objects/pack/pack-5938044f9d30daf1c195fda4dec1d54850933935.idx +0 -0
  46. package/docs/wiki/.git/objects/pack/pack-5938044f9d30daf1c195fda4dec1d54850933935.pack +0 -0
  47. package/docs/wiki/.git/packed-refs +2 -0
  48. package/docs/wiki/.git/refs/heads/master +1 -0
  49. package/docs/wiki/.git/refs/remotes/origin/HEAD +1 -0
  50. package/docs/wiki/Community-Helpers-&-Plugins.md +7 -3
  51. package/docs/wiki/Converting-Playwright-to-Istanbul-Coverage.md +29 -0
  52. package/docs/wiki/Examples.md +39 -48
  53. package/docs/wiki/Release-Process.md +8 -8
  54. package/docs/wiki/Tests.md +62 -60
  55. package/docs/wiki/Upgrading-to-CodeceptJS-3.md +2 -2
  56. package/lib/cli.js +1 -1
  57. package/lib/command/generate.js +3 -0
  58. package/lib/command/init.js +83 -24
  59. package/lib/command/interactive.js +1 -1
  60. package/lib/command/run-workers.js +1 -1
  61. package/lib/command/workers/runTests.js +15 -0
  62. package/lib/helper/JSONResponse.js +44 -3
  63. package/lib/helper/Playwright.js +63 -40
  64. package/lib/helper/Puppeteer.js +54 -43
  65. package/lib/helper/REST.js +23 -9
  66. package/lib/helper/WebDriver.js +39 -30
  67. package/lib/interfaces/gherkin.js +1 -1
  68. package/lib/output.js +4 -0
  69. package/lib/plugin/customLocator.js +50 -3
  70. package/lib/plugin/retryFailedStep.js +1 -1
  71. package/lib/plugin/retryTo.js +1 -8
  72. package/lib/secret.js +31 -1
  73. package/lib/step.js +22 -10
  74. package/lib/utils.js +1 -6
  75. package/package.json +4 -4
  76. package/typings/index.d.ts +158 -0
  77. package/typings/types.d.ts +367 -96
@@ -1562,6 +1562,12 @@ declare namespace CodeceptJS {
1562
1562
  *
1563
1563
  * I.seeResponseContainsJson({ user: { email: 'jon@doe.com' } });
1564
1564
  * ```
1565
+ * If an array is received, checks that at least one element contains JSON
1566
+ * ```js
1567
+ * // response.data == [{ user: { name: 'jon', email: 'jon@doe.com' } }]
1568
+ *
1569
+ * I.seeResponseContainsJson({ user: { email: 'jon@doe.com' } });
1570
+ * ```
1565
1571
  */
1566
1572
  seeResponseContainsJson(json: any): void;
1567
1573
  /**
@@ -1572,6 +1578,12 @@ declare namespace CodeceptJS {
1572
1578
  *
1573
1579
  * I.dontSeeResponseContainsJson({ user: 2 });
1574
1580
  * ```
1581
+ * If an array is received, checks that no element of array contains json:
1582
+ * ```js
1583
+ * // response.data == [{ user: 1 }, { user: 3 }]
1584
+ *
1585
+ * I.dontSeeResponseContainsJson({ user: 2 });
1586
+ * ```
1575
1587
  */
1576
1588
  dontSeeResponseContainsJson(json: any): void;
1577
1589
  /**
@@ -1582,6 +1594,14 @@ declare namespace CodeceptJS {
1582
1594
  *
1583
1595
  * I.seeResponseContainsKeys(['user']);
1584
1596
  * ```
1597
+ *
1598
+ * If an array is received, check is performed for each element of array:
1599
+ *
1600
+ * ```js
1601
+ * // response.data == [{ user: 'jon' }, { user: 'matt'}]
1602
+ *
1603
+ * I.seeResponseContainsKeys(['user']);
1604
+ * ```
1585
1605
  */
1586
1606
  seeResponseContainsKeys(keys: any[]): void;
1587
1607
  /**
@@ -2632,6 +2652,126 @@ declare namespace CodeceptJS {
2632
2652
  */
2633
2653
  grabPageScrollPosition(): Promise<PageScrollPosition>;
2634
2654
  }
2655
+ /**
2656
+ * ## Configuration
2657
+ *
2658
+ * This helper should be configured in codecept.conf.js
2659
+ */
2660
+ type PlaywrightConfig = {
2661
+ /**
2662
+ * base url of website to be tested
2663
+ */
2664
+ url: string;
2665
+ /**
2666
+ * a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium.
2667
+ */
2668
+ browser: string;
2669
+ /**
2670
+ * show browser window.
2671
+ */
2672
+ show?: boolean;
2673
+ /**
2674
+ * restart strategy between tests. Possible values:
2675
+ * 'context' or **false** - restarts [browser context](https://playwright.dev/docs/api/class-browsercontext) but keeps running browser. Recommended by Playwright team to keep tests isolated.
2676
+ * 'browser' or **true** - closes browser and opens it again between tests.
2677
+ * 'session' or 'keep' - keeps browser context and session, but cleans up cookies and localStorage between tests. The fastest option when running tests in windowed mode. Works with `keepCookies` and `keepBrowserState` options. This behavior was default before CodeceptJS 3.1
2678
+ */
2679
+ restart?: string | boolean;
2680
+ /**
2681
+ * - [timeout](https://playwright.dev/docs/api/class-page#page-set-default-timeout) in ms of all Playwright actions .
2682
+ * @defaultValue 1000
2683
+ */
2684
+ timeout?: number;
2685
+ /**
2686
+ * don't save screenshot on failure.
2687
+ */
2688
+ disableScreenshots?: boolean;
2689
+ /**
2690
+ * browser in device emulation mode.
2691
+ */
2692
+ emulate?: any;
2693
+ /**
2694
+ * enables video recording for failed tests; videos are saved into `output/videos` folder
2695
+ */
2696
+ video?: boolean;
2697
+ /**
2698
+ * record [tracing information](https://playwright.dev/docs/trace-viewer) with screenshots and snapshots.
2699
+ */
2700
+ trace?: boolean;
2701
+ /**
2702
+ * make full page screenshots on failure.
2703
+ */
2704
+ fullPageScreenshots?: boolean;
2705
+ /**
2706
+ * option to prevent screenshot override if you have scenarios with the same name in different suites.
2707
+ */
2708
+ uniqueScreenshotNames?: boolean;
2709
+ /**
2710
+ * keep browser state between tests when `restart` is set to 'session'.
2711
+ */
2712
+ keepBrowserState?: boolean;
2713
+ /**
2714
+ * keep cookies between tests when `restart` is set to 'session'.
2715
+ */
2716
+ keepCookies?: boolean;
2717
+ /**
2718
+ * how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
2719
+ */
2720
+ waitForAction?: number;
2721
+ /**
2722
+ * 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).
2723
+ */
2724
+ waitForNavigation?: number;
2725
+ /**
2726
+ * Delay between key presses in ms. Used when calling Playwrights page.type(...) in fillField/appendField
2727
+ * @defaultValue 10
2728
+ */
2729
+ pressKeyDelay?: number;
2730
+ /**
2731
+ * config option to set maximum navigation time in milliseconds.
2732
+ */
2733
+ getPageTimeout?: number;
2734
+ /**
2735
+ * default wait* timeout in ms. Default: 1000.
2736
+ */
2737
+ waitForTimeout?: number;
2738
+ /**
2739
+ * the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
2740
+ */
2741
+ basicAuth?: any;
2742
+ /**
2743
+ * default window size. Set a dimension like `640x480`.
2744
+ */
2745
+ windowSize?: string;
2746
+ /**
2747
+ * default color scheme. Possible values: `dark` | `light` | `no-preference`.
2748
+ */
2749
+ colorScheme?: string;
2750
+ /**
2751
+ * user-agent string.
2752
+ */
2753
+ userAgent?: string;
2754
+ /**
2755
+ * locale string. Example: 'en-GB', 'de-DE', 'fr-FR', ...
2756
+ */
2757
+ locale?: string;
2758
+ /**
2759
+ * do not start browser before a test, start it manually inside a helper with `this.helpers["Playwright"]._startBrowser()`.
2760
+ */
2761
+ manualStart?: boolean;
2762
+ /**
2763
+ * pass additional chromium options
2764
+ */
2765
+ chromium?: any;
2766
+ /**
2767
+ * (pass additional electron options
2768
+ */
2769
+ electron?: any;
2770
+ /**
2771
+ * (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).
2772
+ */
2773
+ channel?: any;
2774
+ };
2635
2775
  /**
2636
2776
  * Uses [Playwright](https://github.com/microsoft/playwright) library to run tests inside:
2637
2777
  *
@@ -2653,46 +2793,14 @@ declare namespace CodeceptJS {
2653
2793
  *
2654
2794
  * Using playwright-core package, will prevent the download of browser binaries and allow connecting to an existing browser installation or for connecting to a remote one.
2655
2795
  *
2656
- * ## Configuration
2657
2796
  *
2658
- * This helper should be configured in codecept.json or codecept.conf.js
2659
- *
2660
- * * `url`: base url of website to be tested
2661
- * * `browser`: a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium.
2662
- * * `show`: (optional, default: false) - show browser window.
2663
- * * `restart`: (optional, default: false) - restart strategy between tests. Possible values:
2664
- * * 'context' or **false** - restarts [browser context](https://playwright.dev/docs/api/class-browsercontext) but keeps running browser. Recommended by Playwright team to keep tests isolated.
2665
- * * 'browser' or **true** - closes browser and opens it again between tests.
2666
- * * 'session' or 'keep' - keeps browser context and session, but cleans up cookies and localStorage between tests. The fastest option when running tests in windowed mode. Works with `keepCookies` and `keepBrowserState` options. This behavior was default before CodeceptJS 3.1
2667
- * * `timeout`: (optional, default: 1000) - [timeout](https://playwright.dev/docs/api/class-page#page-set-default-timeout) in ms of all Playwright actions .
2668
- * * `disableScreenshots`: (optional, default: false) - don't save screenshot on failure.
2669
- * * `emulate`: (optional, default: {}) launch browser in device emulation mode.
2670
- * * `video`: (optional, default: false) enables video recording for failed tests; videos are saved into `output/videos` folder
2671
- * * `trace`: (optional, default: false) record [tracing information](https://playwright.dev/docs/trace-viewer) with screenshots and snapshots.
2672
- * * `fullPageScreenshots` (optional, default: false) - make full page screenshots on failure.
2673
- * * `uniqueScreenshotNames`: (optional, default: false) - option to prevent screenshot override if you have scenarios with the same name in different suites.
2674
- * * `keepBrowserState`: (optional, default: false) - keep browser state between tests when `restart` is set to 'session'.
2675
- * * `keepCookies`: (optional, default: false) - keep cookies between tests when `restart` is set to 'session'.
2676
- * * `waitForAction`: (optional) how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
2677
- * * `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).
2678
- * * `pressKeyDelay`: (optional, default: '10'). Delay between key presses in ms. Used when calling Playwrights page.type(...) in fillField/appendField
2679
- * * `getPageTimeout` (optional, default: '0') config option to set maximum navigation time in milliseconds.
2680
- * * `waitForTimeout`: (optional) default wait* timeout in ms. Default: 1000.
2681
- * * `basicAuth`: (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
2682
- * * `windowSize`: (optional) default window size. Set a dimension like `640x480`.
2683
- * * `colorScheme`: (optional) default color scheme. Possible values: `dark` | `light` | `no-preference`.
2684
- * * `userAgent`: (optional) user-agent string.
2685
- * * `locale`: (optional) locale string. Example: 'en-GB', 'de-DE', 'fr-FR', ...
2686
- * * `manualStart`: (optional, default: false) - do not start browser before a test, start it manually inside a helper with `this.helpers["Playwright"]._startBrowser()`.
2687
- * * `chromium`: (optional) pass additional chromium options
2688
- * * `electron`: (optional) pass additional electron options
2689
- * * `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).
2797
+ * <!-- configuration -->
2690
2798
  *
2691
2799
  * #### Video Recording Customization
2692
2800
  *
2693
2801
  * By default, video is saved to `output/video` dir. You can customize this path by passing `dir` option to `recordVideo` option.
2694
2802
  *
2695
- * * `video`: enables video recording for failed tests; videos are saved into `output/videos` folder
2803
+ * `video`: enables video recording for failed tests; videos are saved into `output/videos` folder
2696
2804
  * * `keepVideoForPassedTests`: - save videos for passed tests
2697
2805
  * * `recordVideo`: [additional options for videos customization](https://playwright.dev/docs/next/api/class-browser#browser-new-context)
2698
2806
  *
@@ -2755,7 +2863,8 @@ declare namespace CodeceptJS {
2755
2863
  * Playwright: {
2756
2864
  * url: "http://localhost",
2757
2865
  * chromium: {
2758
- * browserWSEndpoint: 'ws://localhost:9222/devtools/browser/c5aa6160-b5bc-4d53-bb49-6ecb36cd2e0a'
2866
+ * browserWSEndpoint: 'ws://localhost:9222/devtools/browser/c5aa6160-b5bc-4d53-bb49-6ecb36cd2e0a',
2867
+ * cdpConnection: false // default is false
2759
2868
  * }
2760
2869
  * }
2761
2870
  * }
@@ -2844,8 +2953,6 @@ declare namespace CodeceptJS {
2844
2953
  * const { browserContext } = this.helpers.Playwright;
2845
2954
  * await browserContext.cookies(); // get current browser context
2846
2955
  * ```
2847
- *
2848
- * ## Methods
2849
2956
  */
2850
2957
  class Playwright {
2851
2958
  /**
@@ -3753,9 +3860,11 @@ declare namespace CodeceptJS {
3753
3860
  * Get JS log from browser.
3754
3861
  *
3755
3862
  * ```js
3756
- * let logs = await I.grabBrowserLogs();
3757
- * console.log(JSON.stringify(logs))
3863
+ * const logs = await I.grabBrowserLogs();
3864
+ * const errors = logs.map(l => ({ type: l.type(), text: l.text() })).filter(l => l.type === 'error');
3865
+ * console.log(JSON.stringify(errors));
3758
3866
  * ```
3867
+ * [Learn more about console messages](https://playwright.dev/docs/api/class-consolemessage)
3759
3868
  */
3760
3869
  grabBrowserLogs(): Promise<any[]>;
3761
3870
  /**
@@ -5741,6 +5850,96 @@ declare namespace CodeceptJS {
5741
5850
  */
5742
5851
  setCookie(cookie: Cookie | Cookie[]): void;
5743
5852
  }
5853
+ /**
5854
+ * ## Configuration
5855
+ *
5856
+ * This helper should be configured in codecept.conf.js
5857
+ */
5858
+ type PuppeteerConfig = {
5859
+ /**
5860
+ * base url of website to be tested
5861
+ */
5862
+ url: string;
5863
+ /**
5864
+ * (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
5865
+ */
5866
+ basicAuth?: any;
5867
+ /**
5868
+ * show Google Chrome window for debug.
5869
+ */
5870
+ show?: boolean;
5871
+ /**
5872
+ * restart browser between tests.
5873
+ * @defaultValue true
5874
+ */
5875
+ restart?: boolean;
5876
+ /**
5877
+ * don't save screenshot on failure.
5878
+ */
5879
+ disableScreenshots?: boolean;
5880
+ /**
5881
+ * make full page screenshots on failure.
5882
+ */
5883
+ fullPageScreenshots?: boolean;
5884
+ /**
5885
+ * option to prevent screenshot override if you have scenarios with the same name in different suites.
5886
+ */
5887
+ uniqueScreenshotNames?: boolean;
5888
+ /**
5889
+ * keep browser state between tests when `restart` is set to false.
5890
+ */
5891
+ keepBrowserState?: boolean;
5892
+ /**
5893
+ * keep cookies between tests when `restart` is set to false.
5894
+ */
5895
+ keepCookies?: boolean;
5896
+ /**
5897
+ * how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
5898
+ * @defaultValue 100
5899
+ */
5900
+ waitForAction?: number;
5901
+ /**
5902
+ * when to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle0`, `networkidle2`. See [Puppeteer API](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagewaitfornavigationoptions). Array values are accepted as well.
5903
+ * @defaultValue load
5904
+ */
5905
+ waitForNavigation?: string;
5906
+ /**
5907
+ * delay between key presses in ms. Used when calling Puppeteers page.type(...) in fillField/appendField
5908
+ * @defaultValue 10
5909
+ */
5910
+ pressKeyDelay?: number;
5911
+ /**
5912
+ * config option to set maximum navigation time in milliseconds. If the timeout is set to 0, then timeout will be disabled.
5913
+ * @defaultValue 30000
5914
+ */
5915
+ getPageTimeout?: number;
5916
+ /**
5917
+ * default wait* timeout in ms.
5918
+ * @defaultValue 1000
5919
+ */
5920
+ waitForTimeout?: number;
5921
+ /**
5922
+ * default window size. Set a dimension in format WIDTHxHEIGHT like `640x480`.
5923
+ */
5924
+ windowSize?: string;
5925
+ /**
5926
+ * user-agent string.
5927
+ */
5928
+ userAgent?: string;
5929
+ /**
5930
+ * do not start browser before a test, start it manually inside a helper with `this.helpers["Puppeteer"]._startBrowser()`.
5931
+ */
5932
+ manualStart?: boolean;
5933
+ /**
5934
+ * can be changed to `firefox` when using [puppeteer-firefox](https://codecept.io/helpers/Puppeteer-firefox).
5935
+ * @defaultValue chrome
5936
+ */
5937
+ browser?: string;
5938
+ /**
5939
+ * pass additional [Puppeteer run options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions).
5940
+ */
5941
+ chrome?: any;
5942
+ };
5744
5943
  /**
5745
5944
  * Uses [Google Chrome's Puppeteer](https://github.com/GoogleChrome/puppeteer) library to run tests inside headless Chrome.
5746
5945
  * Browser control is executed via DevTools Protocol (instead of Selenium).
@@ -5758,30 +5957,7 @@ declare namespace CodeceptJS {
5758
5957
  *
5759
5958
  * > Experimental Firefox support [can be activated](https://codecept.io/helpers/Puppeteer-firefox).
5760
5959
  *
5761
- * ## Configuration
5762
- *
5763
- * This helper should be configured in codecept.json or codecept.conf.js
5764
- *
5765
- * * `url`: base url of website to be tested
5766
- * * `basicAuth`: (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
5767
- * * `show`: (optional, default: false) - show Google Chrome window for debug.
5768
- * * `restart`: (optional, default: true) - restart browser between tests.
5769
- * * `disableScreenshots`: (optional, default: false) - don't save screenshot on failure.
5770
- * * `fullPageScreenshots` (optional, default: false) - make full page screenshots on failure.
5771
- * * `uniqueScreenshotNames`: (optional, default: false) - option to prevent screenshot override if you have scenarios with the same name in different suites.
5772
- * * `keepBrowserState`: (optional, default: false) - keep browser state between tests when `restart` is set to false.
5773
- * * `keepCookies`: (optional, default: false) - keep cookies between tests when `restart` is set to false.
5774
- * * `waitForAction`: (optional) how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
5775
- * * `waitForNavigation`: (optional, default: 'load'). When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle0`, `networkidle2`. See [Puppeteer API](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagewaitfornavigationoptions). Array values are accepted as well.
5776
- * * `pressKeyDelay`: (optional, default: '10'). Delay between key presses in ms. Used when calling Puppeteers page.type(...) in fillField/appendField
5777
- * * `getPageTimeout` (optional, default: '30000') config option to set maximum navigation time in milliseconds. If the timeout is set to 0, then timeout will be disabled.
5778
- * * `waitForTimeout`: (optional) default wait* timeout in ms. Default: 1000.
5779
- * * `windowSize`: (optional) default window size. Set a dimension like `640x480`.
5780
- * * `userAgent`: (optional) user-agent string.
5781
- * * `manualStart`: (optional, default: false) - do not start browser before a test, start it manually inside a helper with `this.helpers["Puppeteer"]._startBrowser()`.
5782
- * * `browser`: (optional, default: chrome) - can be changed to `firefox` when using [puppeteer-firefox](https://codecept.io/helpers/Puppeteer-firefox).
5783
- * * `chrome`: (optional) pass additional [Puppeteer run options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions).
5784
- *
5960
+ * <!-- configuration -->
5785
5961
  *
5786
5962
  * #### Example #1: Wait for 0 network connections.
5787
5963
  *
@@ -7429,17 +7605,45 @@ declare namespace CodeceptJS {
7429
7605
  */
7430
7606
  grabElementBoundingRect(locator: LocatorOrString, elementSize?: string): Promise<DOMRect> | Promise<number>;
7431
7607
  }
7608
+ /**
7609
+ * ## Configuration
7610
+ */
7611
+ type RESTConfig = {
7612
+ /**
7613
+ * API base URL
7614
+ */
7615
+ endpoint: string;
7616
+ /**
7617
+ * pretty print json for response/request on console logs
7618
+ */
7619
+ prettyPrintJson?: boolean;
7620
+ /**
7621
+ * timeout for requests in milliseconds. 10000ms by default
7622
+ * @defaultValue 1000
7623
+ */
7624
+ timeout?: number;
7625
+ /**
7626
+ * a list of default headers
7627
+ */
7628
+ defaultHeaders?: any;
7629
+ /**
7630
+ * a async function which can update request object.
7631
+ */
7632
+ onRequest?: (...params: any[]) => any;
7633
+ /**
7634
+ * a async function which can update response object.
7635
+ */
7636
+ onResponse?: (...params: any[]) => any;
7637
+ /**
7638
+ * set the max content file size in MB when performing api calls.
7639
+ */
7640
+ maxUploadFileSize?: number;
7641
+ };
7432
7642
  /**
7433
7643
  * REST helper allows to send additional requests to the REST API during acceptance tests.
7434
7644
  * [Axios](https://github.com/axios/axios) library is used to perform requests.
7435
7645
  *
7436
- * ## Configuration
7437
- *
7438
- * * endpoint: API base URL
7439
- * * timeout: timeout for requests in milliseconds. 10000ms by default
7440
- * * defaultHeaders: a list of default headers
7441
- * * onRequest: a async function which can update request object.
7442
- * * maxUploadFileSize: set the max content file size in MB when performing api calls.
7646
+ * <!-- configuration -->
7443
7647
  *
7444
7648
  * ## Example
7445
7649
  *
@@ -7448,6 +7652,7 @@ declare namespace CodeceptJS {
7448
7652
  * helpers: {
7449
7653
  * REST: {
7450
7654
  * endpoint: 'http://site.com/api',
7655
+ * prettyPrintJson: true,
7451
7656
  * onRequest: (request) => {
7452
7657
  * request.headers.auth = '123';
7453
7658
  * }
@@ -8583,37 +8788,103 @@ declare namespace CodeceptJS {
8583
8788
  */
8584
8789
  waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): void;
8585
8790
  }
8791
+ /**
8792
+ * ## Configuration
8793
+ *
8794
+ * This helper should be configured in codecept.conf.js
8795
+ */
8796
+ type WebDriverConfig = {
8797
+ /**
8798
+ * base url of website to be tested.
8799
+ */
8800
+ url: string;
8801
+ /**
8802
+ * browser in which to perform testing.
8803
+ */
8804
+ browser: string;
8805
+ /**
8806
+ * (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
8807
+ */
8808
+ basicAuth?: string;
8809
+ /**
8810
+ * WebDriver host to connect.
8811
+ * @defaultValue localhost
8812
+ */
8813
+ host?: string;
8814
+ /**
8815
+ * WebDriver port to connect.
8816
+ * @defaultValue 4444
8817
+ */
8818
+ port?: string;
8819
+ /**
8820
+ * protocol for WebDriver server.
8821
+ * @defaultValue http
8822
+ */
8823
+ protocol?: string;
8824
+ /**
8825
+ * path to WebDriver server,
8826
+ * @defaultValue /wd/hub
8827
+ */
8828
+ path?: string;
8829
+ /**
8830
+ * restart browser between tests.
8831
+ * @defaultValue true
8832
+ */
8833
+ restart?: boolean;
8834
+ /**
8835
+ * **enables [SmartWait](http://codecept.io/acceptance/#smartwait)**; wait for additional milliseconds for element to appear. Enable for 5 secs: "smartWait": 5000.
8836
+ */
8837
+ smartWait?: boolean;
8838
+ /**
8839
+ * don't save screenshots on failure.
8840
+ */
8841
+ disableScreenshots?: boolean;
8842
+ /**
8843
+ * (optional - make full page screenshots on failure.
8844
+ */
8845
+ fullPageScreenshots?: boolean;
8846
+ /**
8847
+ * option to prevent screenshot override if you have scenarios with the same name in different suites.
8848
+ */
8849
+ uniqueScreenshotNames?: boolean;
8850
+ /**
8851
+ * keep browser state between tests when `restart` is set to false.
8852
+ */
8853
+ keepBrowserState?: boolean;
8854
+ /**
8855
+ * keep cookies between tests when `restart` set to false.
8856
+ */
8857
+ keepCookies?: boolean;
8858
+ /**
8859
+ * default window size. Set to `maximize` or a dimension in the format `640x480`.
8860
+ * @defaultValue window
8861
+ */
8862
+ windowSize?: string;
8863
+ /**
8864
+ * sets default wait time in *ms* for all `wait*` functions.
8865
+ * @defaultValue 1000
8866
+ */
8867
+ waitForTimeout?: number;
8868
+ /**
8869
+ * Selenium's [desired capabilities](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities).
8870
+ */
8871
+ desiredCapabilities?: any;
8872
+ /**
8873
+ * do not start browser before a test, start it manually inside a helper with `this.helpers["WebDriver"]._startBrowser()`.
8874
+ */
8875
+ manualStart?: boolean;
8876
+ /**
8877
+ * [WebDriver timeouts](http://webdriver.io/docs/timeouts.html) defined as hash.
8878
+ */
8879
+ timeouts?: any;
8880
+ };
8586
8881
  /**
8587
8882
  * WebDriver helper which wraps [webdriverio](http://webdriver.io/) library to
8588
8883
  * manipulate browser using Selenium WebDriver or PhantomJS.
8589
8884
  *
8590
8885
  * WebDriver requires Selenium Server and ChromeDriver/GeckoDriver to be installed. Those tools can be easily installed via NPM. Please check [Testing with WebDriver](https://codecept.io/webdriver/#testing-with-webdriver) for more details.
8591
8886
  *
8592
- * ### Configuration
8593
- *
8594
- * This helper should be configured in codecept.json or codecept.conf.js
8595
- *
8596
- * * `url`: base url of website to be tested.
8597
- * * `basicAuth`: (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
8598
- * * `browser`: browser in which to perform testing.
8599
- * * `host`: (optional, default: localhost) - WebDriver host to connect.
8600
- * * `port`: (optional, default: 4444) - WebDriver port to connect.
8601
- * * `protocol`: (optional, default: http) - protocol for WebDriver server.
8602
- * * `path`: (optional, default: /wd/hub) - path to WebDriver server,
8603
- * * `restart`: (optional, default: true) - restart browser between tests.
8604
- * * `smartWait`: (optional) **enables [SmartWait](http://codecept.io/acceptance/#smartwait)**; wait for additional milliseconds for element to appear. Enable for 5 secs: "smartWait": 5000.
8605
- * * `disableScreenshots`: (optional, default: false) - don't save screenshots on failure.
8606
- * * `fullPageScreenshots` (optional, default: false) - make full page screenshots on failure.
8607
- * * `uniqueScreenshotNames`: (optional, default: false) - option to prevent screenshot override if you have scenarios with the same name in different suites.
8608
- * * `keepBrowserState`: (optional, default: false) - keep browser state between tests when `restart` is set to false.
8609
- * * `keepCookies`: (optional, default: false) - keep cookies between tests when `restart` set to false.
8610
- * * `windowSize`: (optional) default window size. Set to `maximize` or a dimension in the format `640x480`.
8611
- * * `waitForTimeout`: (optional, default: 1000) sets default wait time in *ms* for all `wait*` functions.
8612
- * * `desiredCapabilities`: Selenium's [desired
8613
- * capabilities](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities).
8614
- * * `manualStart`: (optional, default: false) - do not start browser before a test, start it manually inside a helper
8615
- * with `this.helpers["WebDriver"]._startBrowser()`.
8616
- * * `timeouts`: [WebDriver timeouts](http://webdriver.io/docs/timeouts.html) defined as hash.
8887
+ * <!-- configuration -->
8617
8888
  *
8618
8889
  * Example:
8619
8890
  *
@@ -10967,7 +11238,7 @@ declare namespace CodeceptJS {
10967
11238
  class Secret {
10968
11239
  constructor(secret: string);
10969
11240
  toString(): string;
10970
- static secret(secret: any): Secret;
11241
+ static secret(...secret: any[]): Secret;
10971
11242
  }
10972
11243
  function session(sessionName: CodeceptJS.LocatorOrString, config: ((...params: any[]) => any) | {
10973
11244
  [key: string]: any;