codeceptjs 3.3.7 → 3.4.0-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.
- package/CHANGELOG.md +2422 -0
- package/README.md +31 -32
- package/docs/advanced.md +48 -24
- package/docs/basics.md +115 -40
- package/docs/best.md +2 -2
- package/docs/build/ApiDataFactory.js +6 -6
- package/docs/build/Appium.js +2 -19
- package/docs/build/FileSystem.js +2 -2
- package/docs/build/GraphQLDataFactory.js +2 -2
- package/docs/build/Playwright.js +3 -2
- package/docs/build/TestCafe.js +4 -4
- package/docs/build/WebDriver.js +29 -164
- package/docs/helpers/ApiDataFactory.md +6 -6
- package/docs/helpers/FileSystem.md +2 -2
- package/docs/helpers/GraphQLDataFactory.md +2 -2
- package/docs/helpers/Playwright.md +2 -1
- package/docs/index.md +1 -1
- package/docs/plugins.md +73 -48
- package/docs/reports.md +0 -56
- package/docs/typescript.md +2 -8
- package/lib/actor.js +2 -1
- package/lib/cli.js +3 -3
- package/lib/codecept.js +2 -1
- package/lib/command/generate.js +3 -1
- package/lib/command/gherkin/snippets.js +8 -4
- package/lib/command/init.js +0 -8
- package/lib/command/run-workers.js +3 -6
- package/lib/command/utils.js +0 -10
- package/lib/command/workers/runTests.js +2 -2
- package/lib/config.js +5 -1
- package/lib/helper/ApiDataFactory.js +7 -7
- package/lib/helper/Appium.js +2 -19
- package/lib/helper/FileSystem.js +3 -3
- package/lib/helper/GraphQL.js +1 -1
- package/lib/helper/GraphQLDataFactory.js +3 -3
- package/lib/helper/JSONResponse.js +1 -1
- package/lib/helper/Mochawesome.js +1 -1
- package/lib/helper/Nightmare.js +1 -1
- package/lib/helper/Playwright.js +4 -3
- package/lib/helper/Protractor.js +1 -1
- package/lib/helper/Puppeteer.js +1 -1
- package/lib/helper/REST.js +1 -1
- package/lib/helper/TestCafe.js +5 -5
- package/lib/helper/WebDriver.js +30 -165
- package/lib/helper.js +0 -2
- package/lib/interfaces/bdd.js +1 -1
- package/lib/interfaces/featureConfig.js +1 -0
- package/lib/interfaces/gherkin.js +38 -25
- package/lib/listener/exit.js +2 -2
- package/lib/listener/retry.js +67 -0
- package/lib/listener/steps.js +1 -1
- package/lib/listener/timeout.js +47 -10
- package/lib/mochaFactory.js +3 -3
- package/lib/plugin/allure.js +14 -323
- package/lib/plugin/fakerTransform.js +2 -2
- package/lib/recorder.js +1 -1
- package/lib/scenario.js +20 -21
- package/lib/utils.js +6 -0
- package/lib/workers.js +4 -7
- package/package.json +13 -17
- package/typings/index.d.ts +66 -1
- package/typings/promiseBasedTypes.d.ts +12 -12
- package/typings/types.d.ts +95 -262
package/typings/types.d.ts
CHANGED
|
@@ -42,8 +42,8 @@ declare namespace CodeceptJS {
|
|
|
42
42
|
* ```js
|
|
43
43
|
* // tests/factories/posts.js
|
|
44
44
|
*
|
|
45
|
-
* const Factory = require('rosie')
|
|
46
|
-
* const faker = require('@faker-js/faker');
|
|
45
|
+
* const { Factory } = require('rosie');
|
|
46
|
+
* const { faker } = require('@faker-js/faker');
|
|
47
47
|
*
|
|
48
48
|
* module.exports = new Factory()
|
|
49
49
|
* // no need to set id, it will be set by REST API
|
|
@@ -190,10 +190,10 @@ declare namespace CodeceptJS {
|
|
|
190
190
|
* I.have('user', { }, { age: 33, height: 55 })
|
|
191
191
|
* ```
|
|
192
192
|
* @param factory - factory to use
|
|
193
|
-
* @param params - predefined parameters
|
|
194
|
-
* @param options - options for programmatically generate the attributes
|
|
193
|
+
* @param [params] - predefined parameters
|
|
194
|
+
* @param [options] - options for programmatically generate the attributes
|
|
195
195
|
*/
|
|
196
|
-
have(factory: any, params
|
|
196
|
+
have(factory: any, params?: any, options?: any): Promise<any>;
|
|
197
197
|
/**
|
|
198
198
|
* Generates bunch of records and saves multiple API requests to store them.
|
|
199
199
|
*
|
|
@@ -208,7 +208,7 @@ declare namespace CodeceptJS {
|
|
|
208
208
|
* I.haveMultiple('post', 3, { author: 'davert' }, { publish_date: '01.01.1997' });
|
|
209
209
|
* ```
|
|
210
210
|
*/
|
|
211
|
-
haveMultiple(factory: any, times: any, params
|
|
211
|
+
haveMultiple(factory: any, times: any, params?: any, options?: any): void;
|
|
212
212
|
/**
|
|
213
213
|
* Executes request to create a record in API.
|
|
214
214
|
* Can be replaced from a in custom helper.
|
|
@@ -1153,10 +1153,10 @@ declare namespace CodeceptJS {
|
|
|
1153
1153
|
*/
|
|
1154
1154
|
seeFile(name: string): void;
|
|
1155
1155
|
/**
|
|
1156
|
-
* Waits for file to be present in current directory.
|
|
1156
|
+
* Waits for the file to be present in the current directory.
|
|
1157
1157
|
*
|
|
1158
1158
|
* ```js
|
|
1159
|
-
* I.handleDownloads();
|
|
1159
|
+
* I.handleDownloads('downloads/largeFilesName.txt');
|
|
1160
1160
|
* I.click('Download large File');
|
|
1161
1161
|
* I.amInPath('output/downloads');
|
|
1162
1162
|
* I.waitForFile('largeFilesName.txt', 10); // wait 10 seconds for file
|
|
@@ -1340,8 +1340,8 @@ declare namespace CodeceptJS {
|
|
|
1340
1340
|
* ```js
|
|
1341
1341
|
* // tests/factories/users.js
|
|
1342
1342
|
*
|
|
1343
|
-
* const Factory = require('rosie').Factory;
|
|
1344
|
-
* const faker = require('@faker-js/faker');
|
|
1343
|
+
* const { Factory } = require('rosie').Factory;
|
|
1344
|
+
* const { faker } = require('@faker-js/faker');
|
|
1345
1345
|
*
|
|
1346
1346
|
* // Used with a constructor function passed to Factory, so that the final build
|
|
1347
1347
|
* // object matches the necessary pattern to be sent as the variables object.
|
|
@@ -2679,136 +2679,74 @@ declare namespace CodeceptJS {
|
|
|
2679
2679
|
* ## Configuration
|
|
2680
2680
|
*
|
|
2681
2681
|
* This helper should be configured in codecept.conf.js
|
|
2682
|
+
* @property url - base url of website to be tested
|
|
2683
|
+
* @property [browser] - a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium.
|
|
2684
|
+
* @property [show = false] - show browser window.
|
|
2685
|
+
* @property [restart = false] - restart strategy between tests. Possible values:
|
|
2686
|
+
* * '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.
|
|
2687
|
+
* * 'browser' or **true** - closes browser and opens it again between tests.
|
|
2688
|
+
* * '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
|
|
2689
|
+
* @property [timeout = 1000] - - [timeout](https://playwright.dev/docs/api/class-page#page-set-default-timeout) in ms of all Playwright actions .
|
|
2690
|
+
* @property [disableScreenshots = false] - don't save screenshot on failure.
|
|
2691
|
+
* @property [emulate] - browser in device emulation mode.
|
|
2692
|
+
* @property [video = false] - enables video recording for failed tests; videos are saved into `output/videos` folder
|
|
2693
|
+
* @property [keepVideoForPassedTests = false] - save videos for passed tests; videos are saved into `output/videos` folder
|
|
2694
|
+
* @property [trace = false] - record [tracing information](https://playwright.dev/docs/trace-viewer) with screenshots and snapshots.
|
|
2695
|
+
* @property [keepTraceForPassedTests = false] - save trace for passed tests.
|
|
2696
|
+
* @property [fullPageScreenshots = false] - make full page screenshots on failure.
|
|
2697
|
+
* @property [uniqueScreenshotNames = false] - option to prevent screenshot override if you have scenarios with the same name in different suites.
|
|
2698
|
+
* @property [keepBrowserState = false] - keep browser state between tests when `restart` is set to 'session'.
|
|
2699
|
+
* @property [keepCookies = false] - keep cookies between tests when `restart` is set to 'session'.
|
|
2700
|
+
* @property [waitForAction] - how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
|
|
2701
|
+
* @property [waitForNavigation] - When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle`. Choose one of those options is possible. See [Playwright API](https://playwright.dev/docs/api/class-page#page-wait-for-navigation).
|
|
2702
|
+
* @property [pressKeyDelay = 10] - Delay between key presses in ms. Used when calling Playwrights page.type(...) in fillField/appendField
|
|
2703
|
+
* @property [getPageTimeout] - config option to set maximum navigation time in milliseconds.
|
|
2704
|
+
* @property [waitForTimeout] - default wait* timeout in ms. Default: 1000.
|
|
2705
|
+
* @property [basicAuth] - the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
|
|
2706
|
+
* @property [windowSize] - default window size. Set a dimension like `640x480`.
|
|
2707
|
+
* @property [colorScheme] - default color scheme. Possible values: `dark` | `light` | `no-preference`.
|
|
2708
|
+
* @property [userAgent] - user-agent string.
|
|
2709
|
+
* @property [locale] - locale string. Example: 'en-GB', 'de-DE', 'fr-FR', ...
|
|
2710
|
+
* @property [manualStart] - do not start browser before a test, start it manually inside a helper with `this.helpers["Playwright"]._startBrowser()`.
|
|
2711
|
+
* @property [chromium] - pass additional chromium options
|
|
2712
|
+
* @property [firefox] - pass additional firefox options
|
|
2713
|
+
* @property [electron] - (pass additional electron options
|
|
2714
|
+
* @property [channel] - (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).
|
|
2715
|
+
* @property [ignoreLog] - An array with console message types that are not logged to debug log. Default value is `['warning', 'log']`. E.g. you can set `[]` to log all messages. See all possible [values](https://playwright.dev/docs/api/class-consolemessage#console-message-type).
|
|
2716
|
+
* @property [ignoreHTTPSErrors] - Allows access to untrustworthy pages, e.g. to a page with an expired certificate. Default value is `false`
|
|
2682
2717
|
*/
|
|
2683
2718
|
type PlaywrightConfig = {
|
|
2684
|
-
/**
|
|
2685
|
-
* base url of website to be tested
|
|
2686
|
-
*/
|
|
2687
2719
|
url: string;
|
|
2688
|
-
/**
|
|
2689
|
-
* a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium.
|
|
2690
|
-
*/
|
|
2691
2720
|
browser?: string;
|
|
2692
|
-
/**
|
|
2693
|
-
* show browser window.
|
|
2694
|
-
*/
|
|
2695
2721
|
show?: boolean;
|
|
2696
|
-
/**
|
|
2697
|
-
* restart strategy between tests. Possible values:
|
|
2698
|
-
* '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.
|
|
2699
|
-
* 'browser' or **true** - closes browser and opens it again between tests.
|
|
2700
|
-
* '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
|
|
2701
|
-
*/
|
|
2702
2722
|
restart?: string | boolean;
|
|
2703
|
-
/**
|
|
2704
|
-
* - [timeout](https://playwright.dev/docs/api/class-page#page-set-default-timeout) in ms of all Playwright actions .
|
|
2705
|
-
* @defaultValue 1000
|
|
2706
|
-
*/
|
|
2707
2723
|
timeout?: number;
|
|
2708
|
-
/**
|
|
2709
|
-
* don't save screenshot on failure.
|
|
2710
|
-
*/
|
|
2711
2724
|
disableScreenshots?: boolean;
|
|
2712
|
-
/**
|
|
2713
|
-
* browser in device emulation mode.
|
|
2714
|
-
*/
|
|
2715
2725
|
emulate?: any;
|
|
2716
|
-
/**
|
|
2717
|
-
* enables video recording for failed tests; videos are saved into `output/videos` folder
|
|
2718
|
-
*/
|
|
2719
2726
|
video?: boolean;
|
|
2720
|
-
/**
|
|
2721
|
-
* save videos for passed tests; videos are saved into `output/videos` folder
|
|
2722
|
-
*/
|
|
2723
2727
|
keepVideoForPassedTests?: boolean;
|
|
2724
|
-
/**
|
|
2725
|
-
* record [tracing information](https://playwright.dev/docs/trace-viewer) with screenshots and snapshots.
|
|
2726
|
-
*/
|
|
2727
2728
|
trace?: boolean;
|
|
2728
|
-
|
|
2729
|
-
* make full page screenshots on failure.
|
|
2730
|
-
*/
|
|
2729
|
+
keepTraceForPassedTests?: boolean;
|
|
2731
2730
|
fullPageScreenshots?: boolean;
|
|
2732
|
-
/**
|
|
2733
|
-
* option to prevent screenshot override if you have scenarios with the same name in different suites.
|
|
2734
|
-
*/
|
|
2735
2731
|
uniqueScreenshotNames?: boolean;
|
|
2736
|
-
/**
|
|
2737
|
-
* keep browser state between tests when `restart` is set to 'session'.
|
|
2738
|
-
*/
|
|
2739
2732
|
keepBrowserState?: boolean;
|
|
2740
|
-
/**
|
|
2741
|
-
* keep cookies between tests when `restart` is set to 'session'.
|
|
2742
|
-
*/
|
|
2743
2733
|
keepCookies?: boolean;
|
|
2744
|
-
/**
|
|
2745
|
-
* how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
|
|
2746
|
-
*/
|
|
2747
2734
|
waitForAction?: number;
|
|
2748
|
-
/**
|
|
2749
|
-
* When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle`. Choose one of those options is possible. See [Playwright API](https://playwright.dev/docs/api/class-page#page-wait-for-navigation).
|
|
2750
|
-
*/
|
|
2751
2735
|
waitForNavigation?: string;
|
|
2752
|
-
/**
|
|
2753
|
-
* Delay between key presses in ms. Used when calling Playwrights page.type(...) in fillField/appendField
|
|
2754
|
-
* @defaultValue 10
|
|
2755
|
-
*/
|
|
2756
2736
|
pressKeyDelay?: number;
|
|
2757
|
-
/**
|
|
2758
|
-
* config option to set maximum navigation time in milliseconds.
|
|
2759
|
-
*/
|
|
2760
2737
|
getPageTimeout?: number;
|
|
2761
|
-
/**
|
|
2762
|
-
* default wait* timeout in ms. Default: 1000.
|
|
2763
|
-
*/
|
|
2764
2738
|
waitForTimeout?: number;
|
|
2765
|
-
/**
|
|
2766
|
-
* the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
|
|
2767
|
-
*/
|
|
2768
2739
|
basicAuth?: any;
|
|
2769
|
-
/**
|
|
2770
|
-
* default window size. Set a dimension like `640x480`.
|
|
2771
|
-
*/
|
|
2772
2740
|
windowSize?: string;
|
|
2773
|
-
/**
|
|
2774
|
-
* default color scheme. Possible values: `dark` | `light` | `no-preference`.
|
|
2775
|
-
*/
|
|
2776
2741
|
colorScheme?: string;
|
|
2777
|
-
/**
|
|
2778
|
-
* user-agent string.
|
|
2779
|
-
*/
|
|
2780
2742
|
userAgent?: string;
|
|
2781
|
-
/**
|
|
2782
|
-
* locale string. Example: 'en-GB', 'de-DE', 'fr-FR', ...
|
|
2783
|
-
*/
|
|
2784
2743
|
locale?: string;
|
|
2785
|
-
/**
|
|
2786
|
-
* do not start browser before a test, start it manually inside a helper with `this.helpers["Playwright"]._startBrowser()`.
|
|
2787
|
-
*/
|
|
2788
2744
|
manualStart?: boolean;
|
|
2789
|
-
/**
|
|
2790
|
-
* pass additional chromium options
|
|
2791
|
-
*/
|
|
2792
2745
|
chromium?: any;
|
|
2793
|
-
/**
|
|
2794
|
-
* pass additional firefox options
|
|
2795
|
-
*/
|
|
2796
2746
|
firefox?: any;
|
|
2797
|
-
/**
|
|
2798
|
-
* (pass additional electron options
|
|
2799
|
-
*/
|
|
2800
2747
|
electron?: any;
|
|
2801
|
-
/**
|
|
2802
|
-
* (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).
|
|
2803
|
-
*/
|
|
2804
2748
|
channel?: any;
|
|
2805
|
-
/**
|
|
2806
|
-
* An array with console message types that are not logged to debug log. Default value is `['warning', 'log']`. E.g. you can set `[]` to log all messages. See all possible [values](https://playwright.dev/docs/api/class-consolemessage#console-message-type).
|
|
2807
|
-
*/
|
|
2808
2749
|
ignoreLog?: string[];
|
|
2809
|
-
/**
|
|
2810
|
-
* Allows access to untrustworthy pages, e.g. to a page with an expired certificate. Default value is `false`
|
|
2811
|
-
*/
|
|
2812
2750
|
ignoreHTTPSErrors?: boolean;
|
|
2813
2751
|
};
|
|
2814
2752
|
/**
|
|
@@ -3412,9 +3350,9 @@ declare namespace CodeceptJS {
|
|
|
3412
3350
|
* I.waitForFile('avatar.jpg', 5);
|
|
3413
3351
|
*
|
|
3414
3352
|
* ```
|
|
3415
|
-
* @param
|
|
3353
|
+
* @param fileName - set filename for downloaded file
|
|
3416
3354
|
*/
|
|
3417
|
-
handleDownloads(fileName
|
|
3355
|
+
handleDownloads(fileName: string): Promise<void>;
|
|
3418
3356
|
/**
|
|
3419
3357
|
* Perform a click on a link or a button, given by a locator.
|
|
3420
3358
|
* If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
|
|
@@ -5918,90 +5856,45 @@ declare namespace CodeceptJS {
|
|
|
5918
5856
|
* ## Configuration
|
|
5919
5857
|
*
|
|
5920
5858
|
* This helper should be configured in codecept.conf.js
|
|
5859
|
+
* @property url - base url of website to be tested
|
|
5860
|
+
* @property [basicAuth] - (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
|
|
5861
|
+
* @property [show] - show Google Chrome window for debug.
|
|
5862
|
+
* @property [restart = true] - restart browser between tests.
|
|
5863
|
+
* @property [disableScreenshots = false] - don't save screenshot on failure.
|
|
5864
|
+
* @property [fullPageScreenshots = false] - make full page screenshots on failure.
|
|
5865
|
+
* @property [uniqueScreenshotNames = false] - option to prevent screenshot override if you have scenarios with the same name in different suites.
|
|
5866
|
+
* @property [keepBrowserState = false] - keep browser state between tests when `restart` is set to false.
|
|
5867
|
+
* @property [keepCookies = false] - keep cookies between tests when `restart` is set to false.
|
|
5868
|
+
* @property [waitForAction = 100] - how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
|
|
5869
|
+
* @property [waitForNavigation = 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.
|
|
5870
|
+
* @property [pressKeyDelay = 10] - delay between key presses in ms. Used when calling Puppeteers page.type(...) in fillField/appendField
|
|
5871
|
+
* @property [getPageTimeout = 30000] - config option to set maximum navigation time in milliseconds. If the timeout is set to 0, then timeout will be disabled.
|
|
5872
|
+
* @property [waitForTimeout = 1000] - default wait* timeout in ms.
|
|
5873
|
+
* @property [windowSize] - default window size. Set a dimension in format WIDTHxHEIGHT like `640x480`.
|
|
5874
|
+
* @property [userAgent] - user-agent string.
|
|
5875
|
+
* @property [manualStart = false] - do not start browser before a test, start it manually inside a helper with `this.helpers["Puppeteer"]._startBrowser()`.
|
|
5876
|
+
* @property [browser = chrome] - can be changed to `firefox` when using [puppeteer-firefox](https://codecept.io/helpers/Puppeteer-firefox).
|
|
5877
|
+
* @property [chrome] - pass additional [Puppeteer run options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions).
|
|
5921
5878
|
*/
|
|
5922
5879
|
type PuppeteerConfig = {
|
|
5923
|
-
/**
|
|
5924
|
-
* base url of website to be tested
|
|
5925
|
-
*/
|
|
5926
5880
|
url: string;
|
|
5927
|
-
/**
|
|
5928
|
-
* (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
|
|
5929
|
-
*/
|
|
5930
5881
|
basicAuth?: any;
|
|
5931
|
-
/**
|
|
5932
|
-
* show Google Chrome window for debug.
|
|
5933
|
-
*/
|
|
5934
5882
|
show?: boolean;
|
|
5935
|
-
/**
|
|
5936
|
-
* restart browser between tests.
|
|
5937
|
-
* @defaultValue true
|
|
5938
|
-
*/
|
|
5939
5883
|
restart?: boolean;
|
|
5940
|
-
/**
|
|
5941
|
-
* don't save screenshot on failure.
|
|
5942
|
-
*/
|
|
5943
5884
|
disableScreenshots?: boolean;
|
|
5944
|
-
/**
|
|
5945
|
-
* make full page screenshots on failure.
|
|
5946
|
-
*/
|
|
5947
5885
|
fullPageScreenshots?: boolean;
|
|
5948
|
-
/**
|
|
5949
|
-
* option to prevent screenshot override if you have scenarios with the same name in different suites.
|
|
5950
|
-
*/
|
|
5951
5886
|
uniqueScreenshotNames?: boolean;
|
|
5952
|
-
/**
|
|
5953
|
-
* keep browser state between tests when `restart` is set to false.
|
|
5954
|
-
*/
|
|
5955
5887
|
keepBrowserState?: boolean;
|
|
5956
|
-
/**
|
|
5957
|
-
* keep cookies between tests when `restart` is set to false.
|
|
5958
|
-
*/
|
|
5959
5888
|
keepCookies?: boolean;
|
|
5960
|
-
/**
|
|
5961
|
-
* how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
|
|
5962
|
-
* @defaultValue 100
|
|
5963
|
-
*/
|
|
5964
5889
|
waitForAction?: number;
|
|
5965
|
-
/**
|
|
5966
|
-
* 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.
|
|
5967
|
-
* @defaultValue load
|
|
5968
|
-
*/
|
|
5969
5890
|
waitForNavigation?: string;
|
|
5970
|
-
/**
|
|
5971
|
-
* delay between key presses in ms. Used when calling Puppeteers page.type(...) in fillField/appendField
|
|
5972
|
-
* @defaultValue 10
|
|
5973
|
-
*/
|
|
5974
5891
|
pressKeyDelay?: number;
|
|
5975
|
-
/**
|
|
5976
|
-
* config option to set maximum navigation time in milliseconds. If the timeout is set to 0, then timeout will be disabled.
|
|
5977
|
-
* @defaultValue 30000
|
|
5978
|
-
*/
|
|
5979
5892
|
getPageTimeout?: number;
|
|
5980
|
-
/**
|
|
5981
|
-
* default wait* timeout in ms.
|
|
5982
|
-
* @defaultValue 1000
|
|
5983
|
-
*/
|
|
5984
5893
|
waitForTimeout?: number;
|
|
5985
|
-
/**
|
|
5986
|
-
* default window size. Set a dimension in format WIDTHxHEIGHT like `640x480`.
|
|
5987
|
-
*/
|
|
5988
5894
|
windowSize?: string;
|
|
5989
|
-
/**
|
|
5990
|
-
* user-agent string.
|
|
5991
|
-
*/
|
|
5992
5895
|
userAgent?: string;
|
|
5993
|
-
/**
|
|
5994
|
-
* do not start browser before a test, start it manually inside a helper with `this.helpers["Puppeteer"]._startBrowser()`.
|
|
5995
|
-
*/
|
|
5996
5896
|
manualStart?: boolean;
|
|
5997
|
-
/**
|
|
5998
|
-
* can be changed to `firefox` when using [puppeteer-firefox](https://codecept.io/helpers/Puppeteer-firefox).
|
|
5999
|
-
* @defaultValue chrome
|
|
6000
|
-
*/
|
|
6001
5897
|
browser?: string;
|
|
6002
|
-
/**
|
|
6003
|
-
* pass additional [Puppeteer run options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions).
|
|
6004
|
-
*/
|
|
6005
5898
|
chrome?: any;
|
|
6006
5899
|
};
|
|
6007
5900
|
/**
|
|
@@ -7691,36 +7584,21 @@ declare namespace CodeceptJS {
|
|
|
7691
7584
|
}
|
|
7692
7585
|
/**
|
|
7693
7586
|
* ## Configuration
|
|
7587
|
+
* @property [endpoint] - API base URL
|
|
7588
|
+
* @property [prettyPrintJson = false] - pretty print json for response/request on console logs
|
|
7589
|
+
* @property [timeout = 1000] - timeout for requests in milliseconds. 10000ms by default
|
|
7590
|
+
* @property [defaultHeaders] - a list of default headers
|
|
7591
|
+
* @property [onRequest] - a async function which can update request object.
|
|
7592
|
+
* @property [onResponse] - a async function which can update response object.
|
|
7593
|
+
* @property [maxUploadFileSize] - set the max content file size in MB when performing api calls.
|
|
7694
7594
|
*/
|
|
7695
7595
|
type RESTConfig = {
|
|
7696
|
-
/**
|
|
7697
|
-
* API base URL
|
|
7698
|
-
*/
|
|
7699
7596
|
endpoint?: string;
|
|
7700
|
-
/**
|
|
7701
|
-
* pretty print json for response/request on console logs
|
|
7702
|
-
*/
|
|
7703
7597
|
prettyPrintJson?: boolean;
|
|
7704
|
-
/**
|
|
7705
|
-
* timeout for requests in milliseconds. 10000ms by default
|
|
7706
|
-
* @defaultValue 1000
|
|
7707
|
-
*/
|
|
7708
7598
|
timeout?: number;
|
|
7709
|
-
/**
|
|
7710
|
-
* a list of default headers
|
|
7711
|
-
*/
|
|
7712
7599
|
defaultHeaders?: any;
|
|
7713
|
-
/**
|
|
7714
|
-
* a async function which can update request object.
|
|
7715
|
-
*/
|
|
7716
7600
|
onRequest?: (...params: any[]) => any;
|
|
7717
|
-
/**
|
|
7718
|
-
* a async function which can update response object.
|
|
7719
|
-
*/
|
|
7720
7601
|
onResponse?: (...params: any[]) => any;
|
|
7721
|
-
/**
|
|
7722
|
-
* set the max content file size in MB when performing api calls.
|
|
7723
|
-
*/
|
|
7724
7602
|
maxUploadFileSize?: number;
|
|
7725
7603
|
};
|
|
7726
7604
|
/**
|
|
@@ -8877,90 +8755,45 @@ declare namespace CodeceptJS {
|
|
|
8877
8755
|
* ## Configuration
|
|
8878
8756
|
*
|
|
8879
8757
|
* This helper should be configured in codecept.conf.js
|
|
8758
|
+
* @property url - base url of website to be tested.
|
|
8759
|
+
* @property browser - browser in which to perform testing.
|
|
8760
|
+
* @property [basicAuth] - (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
|
|
8761
|
+
* @property [host = localhost] - WebDriver host to connect.
|
|
8762
|
+
* @property [port = 4444] - WebDriver port to connect.
|
|
8763
|
+
* @property [protocol = http] - protocol for WebDriver server.
|
|
8764
|
+
* @property [path = /wd/hub] - path to WebDriver server.
|
|
8765
|
+
* @property [restart = true] - restart browser between tests.
|
|
8766
|
+
* @property [smartWait = false] - **enables [SmartWait](http://codecept.io/acceptance/#smartwait)**; wait for additional milliseconds for element to appear. Enable for 5 secs: "smartWait": 5000.
|
|
8767
|
+
* @property [disableScreenshots = false] - don't save screenshots on failure.
|
|
8768
|
+
* @property [fullPageScreenshots = false] - (optional - make full page screenshots on failure.
|
|
8769
|
+
* @property [uniqueScreenshotNames = false] - option to prevent screenshot override if you have scenarios with the same name in different suites.
|
|
8770
|
+
* @property [keepBrowserState = false] - keep browser state between tests when `restart` is set to false.
|
|
8771
|
+
* @property [keepCookies = false] - keep cookies between tests when `restart` set to false.
|
|
8772
|
+
* @property [windowSize = window] - default window size. Set to `maximize` or a dimension in the format `640x480`.
|
|
8773
|
+
* @property [waitForTimeout = 1000] - sets default wait time in *ms* for all `wait*` functions.
|
|
8774
|
+
* @property [desiredCapabilities] - Selenium's [desired capabilities](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities).
|
|
8775
|
+
* @property [manualStart = false] - do not start browser before a test, start it manually inside a helper with `this.helpers["WebDriver"]._startBrowser()`.
|
|
8776
|
+
* @property [timeouts] - [WebDriver timeouts](http://webdriver.io/docs/timeouts.html) defined as hash.
|
|
8880
8777
|
*/
|
|
8881
8778
|
type WebDriverConfig = {
|
|
8882
|
-
/**
|
|
8883
|
-
* base url of website to be tested.
|
|
8884
|
-
*/
|
|
8885
8779
|
url: string;
|
|
8886
|
-
/**
|
|
8887
|
-
* browser in which to perform testing.
|
|
8888
|
-
*/
|
|
8889
8780
|
browser: string;
|
|
8890
|
-
/**
|
|
8891
|
-
* (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
|
|
8892
|
-
*/
|
|
8893
8781
|
basicAuth?: string;
|
|
8894
|
-
/**
|
|
8895
|
-
* WebDriver host to connect.
|
|
8896
|
-
* @defaultValue localhost
|
|
8897
|
-
*/
|
|
8898
8782
|
host?: string;
|
|
8899
|
-
/**
|
|
8900
|
-
* WebDriver port to connect.
|
|
8901
|
-
* @defaultValue 4444
|
|
8902
|
-
*/
|
|
8903
8783
|
port?: number;
|
|
8904
|
-
/**
|
|
8905
|
-
* protocol for WebDriver server.
|
|
8906
|
-
* @defaultValue http
|
|
8907
|
-
*/
|
|
8908
8784
|
protocol?: string;
|
|
8909
|
-
/**
|
|
8910
|
-
* path to WebDriver server.
|
|
8911
|
-
* @defaultValue /wd/hub
|
|
8912
|
-
*/
|
|
8913
8785
|
path?: string;
|
|
8914
|
-
/**
|
|
8915
|
-
* restart browser between tests.
|
|
8916
|
-
* @defaultValue true
|
|
8917
|
-
*/
|
|
8918
8786
|
restart?: boolean;
|
|
8919
|
-
/**
|
|
8920
|
-
* **enables [SmartWait](http://codecept.io/acceptance/#smartwait)**; wait for additional milliseconds for element to appear. Enable for 5 secs: "smartWait": 5000.
|
|
8921
|
-
*/
|
|
8922
8787
|
smartWait?: boolean | number;
|
|
8923
|
-
/**
|
|
8924
|
-
* don't save screenshots on failure.
|
|
8925
|
-
*/
|
|
8926
8788
|
disableScreenshots?: boolean;
|
|
8927
|
-
/**
|
|
8928
|
-
* (optional - make full page screenshots on failure.
|
|
8929
|
-
*/
|
|
8930
8789
|
fullPageScreenshots?: boolean;
|
|
8931
|
-
/**
|
|
8932
|
-
* option to prevent screenshot override if you have scenarios with the same name in different suites.
|
|
8933
|
-
*/
|
|
8934
8790
|
uniqueScreenshotNames?: boolean;
|
|
8935
|
-
/**
|
|
8936
|
-
* keep browser state between tests when `restart` is set to false.
|
|
8937
|
-
*/
|
|
8938
8791
|
keepBrowserState?: boolean;
|
|
8939
|
-
/**
|
|
8940
|
-
* keep cookies between tests when `restart` set to false.
|
|
8941
|
-
*/
|
|
8942
8792
|
keepCookies?: boolean;
|
|
8943
|
-
/**
|
|
8944
|
-
* default window size. Set to `maximize` or a dimension in the format `640x480`.
|
|
8945
|
-
* @defaultValue window
|
|
8946
|
-
*/
|
|
8947
8793
|
windowSize?: string;
|
|
8948
|
-
/**
|
|
8949
|
-
* sets default wait time in *ms* for all `wait*` functions.
|
|
8950
|
-
* @defaultValue 1000
|
|
8951
|
-
*/
|
|
8952
8794
|
waitForTimeout?: number;
|
|
8953
|
-
/**
|
|
8954
|
-
* Selenium's [desired capabilities](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities).
|
|
8955
|
-
*/
|
|
8956
8795
|
desiredCapabilities?: any;
|
|
8957
|
-
/**
|
|
8958
|
-
* do not start browser before a test, start it manually inside a helper with `this.helpers["WebDriver"]._startBrowser()`.
|
|
8959
|
-
*/
|
|
8960
8796
|
manualStart?: boolean;
|
|
8961
|
-
/**
|
|
8962
|
-
* [WebDriver timeouts](http://webdriver.io/docs/timeouts.html) defined as hash.
|
|
8963
|
-
*/
|
|
8964
8797
|
timeouts?: any;
|
|
8965
8798
|
};
|
|
8966
8799
|
/**
|
|
@@ -10825,7 +10658,7 @@ declare namespace CodeceptJS {
|
|
|
10825
10658
|
/**
|
|
10826
10659
|
* add print comment method`
|
|
10827
10660
|
*/
|
|
10828
|
-
say(msg: string, color?: string):
|
|
10661
|
+
say(msg: string, color?: string): void;
|
|
10829
10662
|
/**
|
|
10830
10663
|
* set the maximum execution time for the next step
|
|
10831
10664
|
* @param timeout - step timeout in seconds
|
|
@@ -11336,7 +11169,7 @@ declare namespace CodeceptJS {
|
|
|
11336
11169
|
interface RecorderSession {
|
|
11337
11170
|
running: boolean;
|
|
11338
11171
|
start(name: string): void;
|
|
11339
|
-
restore(name
|
|
11172
|
+
restore(name?: string): void;
|
|
11340
11173
|
catch(fn: (...params: any[]) => any): void;
|
|
11341
11174
|
}
|
|
11342
11175
|
class Secret {
|