codeceptjs 3.4.0 → 3.5.0
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 +70 -0
- package/README.md +9 -7
- package/bin/codecept.js +1 -1
- package/docs/ai.md +246 -0
- package/docs/build/Appium.js +47 -7
- package/docs/build/JSONResponse.js +4 -4
- package/docs/build/Nightmare.js +3 -1
- package/docs/build/OpenAI.js +122 -0
- package/docs/build/Playwright.js +193 -45
- package/docs/build/Protractor.js +3 -1
- package/docs/build/Puppeteer.js +45 -12
- package/docs/build/REST.js +15 -5
- package/docs/build/TestCafe.js +3 -1
- package/docs/build/WebDriver.js +30 -5
- package/docs/changelog.md +70 -0
- package/docs/helpers/Appium.md +152 -147
- package/docs/helpers/JSONResponse.md +4 -4
- package/docs/helpers/Nightmare.md +2 -0
- package/docs/helpers/OpenAI.md +70 -0
- package/docs/helpers/Playwright.md +194 -152
- package/docs/helpers/Puppeteer.md +6 -0
- package/docs/helpers/REST.md +6 -5
- package/docs/helpers/TestCafe.md +2 -0
- package/docs/helpers/WebDriver.md +10 -4
- package/docs/mobile.md +49 -2
- package/docs/parallel.md +56 -0
- package/docs/plugins.md +87 -33
- package/docs/secrets.md +6 -0
- package/docs/tutorial.md +5 -5
- package/docs/webapi/appendField.mustache +2 -0
- package/docs/webapi/type.mustache +3 -0
- package/lib/ai.js +171 -0
- package/lib/cli.js +1 -1
- package/lib/codecept.js +4 -0
- package/lib/command/dryRun.js +9 -1
- package/lib/command/generate.js +46 -3
- package/lib/command/init.js +13 -1
- package/lib/command/interactive.js +15 -1
- package/lib/command/run-workers.js +2 -1
- package/lib/container.js +13 -3
- package/lib/helper/Appium.js +45 -7
- package/lib/helper/JSONResponse.js +4 -4
- package/lib/helper/Nightmare.js +1 -1
- package/lib/helper/OpenAI.js +122 -0
- package/lib/helper/Playwright.js +190 -38
- package/lib/helper/Protractor.js +1 -1
- package/lib/helper/Puppeteer.js +40 -12
- package/lib/helper/REST.js +15 -5
- package/lib/helper/TestCafe.js +1 -1
- package/lib/helper/WebDriver.js +25 -5
- package/lib/helper/scripts/highlightElement.js +20 -0
- package/lib/html.js +258 -0
- package/lib/listener/retry.js +2 -1
- package/lib/pause.js +73 -17
- package/lib/plugin/debugErrors.js +67 -0
- package/lib/plugin/fakerTransform.js +4 -6
- package/lib/plugin/heal.js +179 -0
- package/lib/plugin/screenshotOnFail.js +11 -2
- package/lib/plugin/wdio.js +4 -12
- package/lib/recorder.js +4 -4
- package/lib/scenario.js +6 -4
- package/lib/secret.js +5 -4
- package/lib/step.js +6 -1
- package/lib/ui.js +4 -3
- package/lib/utils.js +4 -0
- package/lib/workers.js +57 -9
- package/package.json +26 -14
- package/translations/ja-JP.js +9 -9
- package/typings/index.d.ts +43 -9
- package/typings/promiseBasedTypes.d.ts +124 -24
- package/typings/types.d.ts +138 -30
package/typings/types.d.ts
CHANGED
|
@@ -756,6 +756,8 @@ declare namespace CodeceptJS {
|
|
|
756
756
|
*
|
|
757
757
|
* ```js
|
|
758
758
|
* I.appendField('#myTextField', 'appended');
|
|
759
|
+
* // typing secret
|
|
760
|
+
* I.appendField('password', secret('123456'));
|
|
759
761
|
* ```
|
|
760
762
|
* @param field - located by label|name|CSS|XPath|strict locator
|
|
761
763
|
* @param value - text value to append.
|
|
@@ -1658,16 +1660,16 @@ declare namespace CodeceptJS {
|
|
|
1658
1660
|
*
|
|
1659
1661
|
* I.seeResponseMatchesJsonSchema(joi => {
|
|
1660
1662
|
* return joi.object({
|
|
1661
|
-
* name: joi.string()
|
|
1662
|
-
* id: joi.number()
|
|
1663
|
+
* name: joi.string(),
|
|
1664
|
+
* id: joi.number()
|
|
1663
1665
|
* })
|
|
1664
1666
|
* });
|
|
1665
1667
|
*
|
|
1666
1668
|
* // or pass a valid schema
|
|
1667
|
-
* const joi = require('joi);
|
|
1669
|
+
* const joi = require('joi');
|
|
1668
1670
|
*
|
|
1669
1671
|
* I.seeResponseMatchesJsonSchema(joi.object({
|
|
1670
|
-
* name: joi.string()
|
|
1672
|
+
* name: joi.string(),
|
|
1671
1673
|
* id: joi.number();
|
|
1672
1674
|
* });
|
|
1673
1675
|
* ```
|
|
@@ -2171,6 +2173,8 @@ declare namespace CodeceptJS {
|
|
|
2171
2173
|
*
|
|
2172
2174
|
* ```js
|
|
2173
2175
|
* I.appendField('#myTextField', 'appended');
|
|
2176
|
+
* // typing secret
|
|
2177
|
+
* I.appendField('password', secret('123456'));
|
|
2174
2178
|
* ```
|
|
2175
2179
|
* @param field - located by label|name|CSS|XPath|strict locator
|
|
2176
2180
|
* @param value - text value to append.
|
|
@@ -2675,12 +2679,52 @@ declare namespace CodeceptJS {
|
|
|
2675
2679
|
*/
|
|
2676
2680
|
grabPageScrollPosition(): Promise<PageScrollPosition>;
|
|
2677
2681
|
}
|
|
2682
|
+
/**
|
|
2683
|
+
* OpenAI Helper for CodeceptJS.
|
|
2684
|
+
*
|
|
2685
|
+
* This helper class provides integration with the OpenAI GPT-3.5 or 4 language model for generating responses to questions or prompts within the context of web pages. It allows you to interact with the GPT-3.5 model to obtain intelligent responses based on HTML fragments or general prompts.
|
|
2686
|
+
* This helper should be enabled with any web helpers like Playwright or Puppeteer or WebDrvier to ensure the HTML context is available.
|
|
2687
|
+
*
|
|
2688
|
+
* ## Configuration
|
|
2689
|
+
*
|
|
2690
|
+
* This helper should be configured in codecept.json or codecept.conf.js
|
|
2691
|
+
*
|
|
2692
|
+
* * `chunkSize`: (optional, default: 80000) - The maximum number of characters to send to the OpenAI API at once. We split HTML fragments by 8000 chars to not exceed token limit. Increase this value if you use GPT-4.
|
|
2693
|
+
*/
|
|
2694
|
+
class OpenAI {
|
|
2695
|
+
/**
|
|
2696
|
+
* Asks the OpenAI GPT language model a question based on the provided prompt within the context of the current page's HTML.
|
|
2697
|
+
*
|
|
2698
|
+
* ```js
|
|
2699
|
+
* I.askGptOnPage('what does this page do?');
|
|
2700
|
+
* ```
|
|
2701
|
+
* @param prompt - The question or prompt to ask the GPT model.
|
|
2702
|
+
* @returns - A Promise that resolves to the generated responses from the GPT model, joined by newlines.
|
|
2703
|
+
*/
|
|
2704
|
+
askGptOnPage(prompt: string): Promise<string>;
|
|
2705
|
+
/**
|
|
2706
|
+
* Asks the OpenAI GPT-3.5 language model a question based on the provided prompt within the context of a specific HTML fragment on the current page.
|
|
2707
|
+
*
|
|
2708
|
+
* ```js
|
|
2709
|
+
* I.askGptOnPageFragment('describe features of this screen', '.screen');
|
|
2710
|
+
* ```
|
|
2711
|
+
* @param prompt - The question or prompt to ask the GPT-3.5 model.
|
|
2712
|
+
* @param locator - The locator or selector used to identify the HTML fragment on the page.
|
|
2713
|
+
* @returns - A Promise that resolves to the generated response from the GPT model.
|
|
2714
|
+
*/
|
|
2715
|
+
askGptOnPageFragment(prompt: string, locator: string): Promise<string>;
|
|
2716
|
+
/**
|
|
2717
|
+
* Send a general request to ChatGPT and return response.
|
|
2718
|
+
* @returns - A Promise that resolves to the generated response from the GPT model.
|
|
2719
|
+
*/
|
|
2720
|
+
askGptGeneralPrompt(prompt: string): Promise<string>;
|
|
2721
|
+
}
|
|
2678
2722
|
/**
|
|
2679
2723
|
* ## Configuration
|
|
2680
2724
|
*
|
|
2681
2725
|
* This helper should be configured in codecept.conf.js
|
|
2682
2726
|
* @property url - base url of website to be tested
|
|
2683
|
-
* @property [browser] - a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium.
|
|
2727
|
+
* @property [browser = 'chromium'] - a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium.
|
|
2684
2728
|
* @property [show = false] - show browser window.
|
|
2685
2729
|
* @property [restart = false] - restart strategy between tests. Possible values:
|
|
2686
2730
|
* * '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.
|
|
@@ -2714,10 +2758,12 @@ declare namespace CodeceptJS {
|
|
|
2714
2758
|
* @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
2759
|
* @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
2760
|
* @property [ignoreHTTPSErrors] - Allows access to untrustworthy pages, e.g. to a page with an expired certificate. Default value is `false`
|
|
2761
|
+
* @property [bypassCSP] - bypass Content Security Policy or CSP
|
|
2762
|
+
* @property [highlightElement] - highlight the interacting elements
|
|
2717
2763
|
*/
|
|
2718
2764
|
type PlaywrightConfig = {
|
|
2719
2765
|
url: string;
|
|
2720
|
-
browser?:
|
|
2766
|
+
browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
|
|
2721
2767
|
show?: boolean;
|
|
2722
2768
|
restart?: string | boolean;
|
|
2723
2769
|
timeout?: number;
|
|
@@ -2732,13 +2778,13 @@ declare namespace CodeceptJS {
|
|
|
2732
2778
|
keepBrowserState?: boolean;
|
|
2733
2779
|
keepCookies?: boolean;
|
|
2734
2780
|
waitForAction?: number;
|
|
2735
|
-
waitForNavigation?:
|
|
2781
|
+
waitForNavigation?: 'load' | 'domcontentloaded' | 'networkidle';
|
|
2736
2782
|
pressKeyDelay?: number;
|
|
2737
2783
|
getPageTimeout?: number;
|
|
2738
2784
|
waitForTimeout?: number;
|
|
2739
2785
|
basicAuth?: any;
|
|
2740
2786
|
windowSize?: string;
|
|
2741
|
-
colorScheme?:
|
|
2787
|
+
colorScheme?: 'dark' | 'light' | 'no-preference';
|
|
2742
2788
|
userAgent?: string;
|
|
2743
2789
|
locale?: string;
|
|
2744
2790
|
manualStart?: boolean;
|
|
@@ -2748,6 +2794,8 @@ declare namespace CodeceptJS {
|
|
|
2748
2794
|
channel?: any;
|
|
2749
2795
|
ignoreLog?: string[];
|
|
2750
2796
|
ignoreHTTPSErrors?: boolean;
|
|
2797
|
+
bypassCSP?: boolean;
|
|
2798
|
+
highlightElement?: boolean;
|
|
2751
2799
|
};
|
|
2752
2800
|
/**
|
|
2753
2801
|
* Uses [Playwright](https://github.com/microsoft/playwright) library to run tests inside:
|
|
@@ -2783,7 +2831,7 @@ declare namespace CodeceptJS {
|
|
|
2783
2831
|
*
|
|
2784
2832
|
* #### Trace Recording Customization
|
|
2785
2833
|
*
|
|
2786
|
-
* Trace recording provides
|
|
2834
|
+
* Trace recording provides complete information on test execution and includes DOM snapshots, screenshots, and network requests logged during run.
|
|
2787
2835
|
* Traces will be saved to `output/trace`
|
|
2788
2836
|
*
|
|
2789
2837
|
* * `trace`: enables trace recording for failed tests; trace are saved into `output/trace` folder
|
|
@@ -3078,6 +3126,39 @@ declare namespace CodeceptJS {
|
|
|
3078
3126
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3079
3127
|
*/
|
|
3080
3128
|
moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
|
|
3129
|
+
/**
|
|
3130
|
+
* Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the matching element.
|
|
3131
|
+
* @param locator - field located by label|name|CSS|XPath|strict locator.
|
|
3132
|
+
* @param [options] - [Additional options](https://playwright.dev/docs/api/class-locator#locator-focus) for available options object as 2nd argument.
|
|
3133
|
+
*
|
|
3134
|
+
* Examples:
|
|
3135
|
+
*
|
|
3136
|
+
* ```js
|
|
3137
|
+
* I.dontSee('#add-to-cart-btn');
|
|
3138
|
+
* I.focus('#product-tile')
|
|
3139
|
+
* I.see('#add-to-cart-bnt');
|
|
3140
|
+
* ```
|
|
3141
|
+
*/
|
|
3142
|
+
focus(locator: CodeceptJS.LocatorOrString, options?: any): void;
|
|
3143
|
+
/**
|
|
3144
|
+
* Remove focus from a text input, button, etc
|
|
3145
|
+
* Calls [blur](https://playwright.dev/docs/api/class-locator#locator-blur) on the element.
|
|
3146
|
+
* @param locator - field located by label|name|CSS|XPath|strict locator.
|
|
3147
|
+
* @param [options] - [Additional options](https://playwright.dev/docs/api/class-locator#locator-blur) for available options object as 2nd argument.
|
|
3148
|
+
*
|
|
3149
|
+
* Examples:
|
|
3150
|
+
*
|
|
3151
|
+
* ```js
|
|
3152
|
+
* I.blur('.text-area')
|
|
3153
|
+
* ```
|
|
3154
|
+
* ```js
|
|
3155
|
+
* //element `#product-tile` is focused
|
|
3156
|
+
* I.see('#add-to-cart-btn');
|
|
3157
|
+
* I.blur('#product-tile')
|
|
3158
|
+
* I.dontSee('#add-to-cart-btn');
|
|
3159
|
+
* ```
|
|
3160
|
+
*/
|
|
3161
|
+
blur(locator: CodeceptJS.LocatorOrString, options?: any): void;
|
|
3081
3162
|
/**
|
|
3082
3163
|
* Drag an item to a destination element.
|
|
3083
3164
|
*
|
|
@@ -3094,7 +3175,7 @@ declare namespace CodeceptJS {
|
|
|
3094
3175
|
* I.dragAndDrop('img.src', 'img.dst', { sourcePosition: {x: 10, y: 10} })
|
|
3095
3176
|
* ```
|
|
3096
3177
|
*
|
|
3097
|
-
* >
|
|
3178
|
+
* > When no option is set, custom drag and drop would be used, to use the dragAndDrop API from Playwright, please set options, for example `force: true`
|
|
3098
3179
|
*/
|
|
3099
3180
|
dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString, options?: any): void;
|
|
3100
3181
|
/**
|
|
@@ -3378,7 +3459,7 @@ declare namespace CodeceptJS {
|
|
|
3378
3459
|
* @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
3379
3460
|
* @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
3380
3461
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3381
|
-
* @param [
|
|
3462
|
+
* @param [options] - [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
|
|
3382
3463
|
*
|
|
3383
3464
|
* Examples:
|
|
3384
3465
|
*
|
|
@@ -3390,7 +3471,7 @@ declare namespace CodeceptJS {
|
|
|
3390
3471
|
* I.click('.edit', null, { modifiers: ['Ctrl'] } )
|
|
3391
3472
|
* ```
|
|
3392
3473
|
*/
|
|
3393
|
-
click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null,
|
|
3474
|
+
click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null, options?: any): void;
|
|
3394
3475
|
/**
|
|
3395
3476
|
* Clicks link and waits for navigation (deprecated)
|
|
3396
3477
|
*/
|
|
@@ -3641,6 +3722,9 @@ declare namespace CodeceptJS {
|
|
|
3641
3722
|
*
|
|
3642
3723
|
* // passing in an array
|
|
3643
3724
|
* I.type(['T', 'E', 'X', 'T']);
|
|
3725
|
+
*
|
|
3726
|
+
* // passing a secret
|
|
3727
|
+
* I.type(secret('123456'));
|
|
3644
3728
|
* ```
|
|
3645
3729
|
* @param key - or array of keys to type.
|
|
3646
3730
|
* @param [delay = null] - (optional) delay in ms between key presses
|
|
@@ -3667,23 +3751,28 @@ declare namespace CodeceptJS {
|
|
|
3667
3751
|
*/
|
|
3668
3752
|
fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): void;
|
|
3669
3753
|
/**
|
|
3670
|
-
*
|
|
3754
|
+
* Clear the <input>, <textarea> or [contenteditable] .
|
|
3755
|
+
* @param locator - field located by label|name|CSS|XPath|strict locator.
|
|
3756
|
+
* @param [options] - [Additional options](https://playwright.dev/docs/api/class-locator#locator-clear) for available options object as 2nd argument.
|
|
3757
|
+
*
|
|
3758
|
+
* Examples:
|
|
3671
3759
|
*
|
|
3672
3760
|
* ```js
|
|
3673
|
-
* I.clearField('
|
|
3674
|
-
*
|
|
3675
|
-
*
|
|
3761
|
+
* I.clearField('.text-area')
|
|
3762
|
+
* ```
|
|
3763
|
+
* ```js
|
|
3764
|
+
* I.clearField('#submit', { force: true }) // force to bypass the [actionability](https://playwright.dev/docs/actionability) checks.
|
|
3676
3765
|
* ```
|
|
3677
|
-
* @param editable - field located by label|name|CSS|XPath|strict locator.
|
|
3678
|
-
* ⚠️ returns a _promise_ which is synchronized internally by recorder.
|
|
3679
3766
|
*/
|
|
3680
|
-
clearField(
|
|
3767
|
+
clearField(locator: CodeceptJS.LocatorOrString, options?: any): void;
|
|
3681
3768
|
/**
|
|
3682
3769
|
* Appends text to a input field or textarea.
|
|
3683
3770
|
* Field is located by name, label, CSS or XPath
|
|
3684
3771
|
*
|
|
3685
3772
|
* ```js
|
|
3686
3773
|
* I.appendField('#myTextField', 'appended');
|
|
3774
|
+
* // typing secret
|
|
3775
|
+
* I.appendField('password', secret('123456'));
|
|
3687
3776
|
* ```
|
|
3688
3777
|
* @param field - located by label|name|CSS|XPath|strict locator
|
|
3689
3778
|
* @param value - text value to append.
|
|
@@ -4413,7 +4502,7 @@ declare namespace CodeceptJS {
|
|
|
4413
4502
|
*
|
|
4414
4503
|
* See [Playwright's reference](https://playwright.dev/docs/api/class-page?_highlight=waitfornavi#pagewaitfornavigationoptions)
|
|
4415
4504
|
*/
|
|
4416
|
-
waitForNavigation(
|
|
4505
|
+
waitForNavigation(options: any): void;
|
|
4417
4506
|
/**
|
|
4418
4507
|
* Waits for an element to become not attached to the DOM on a page (by default waits for 1sec).
|
|
4419
4508
|
* Element can be located by CSS or XPath.
|
|
@@ -4939,6 +5028,8 @@ declare namespace CodeceptJS {
|
|
|
4939
5028
|
*
|
|
4940
5029
|
* ```js
|
|
4941
5030
|
* I.appendField('#myTextField', 'appended');
|
|
5031
|
+
* // typing secret
|
|
5032
|
+
* I.appendField('password', secret('123456'));
|
|
4942
5033
|
* ```
|
|
4943
5034
|
* @param field - located by label|name|CSS|XPath|strict locator
|
|
4944
5035
|
* @param value - text value to append.
|
|
@@ -5875,6 +5966,7 @@ declare namespace CodeceptJS {
|
|
|
5875
5966
|
* @property [manualStart = false] - do not start browser before a test, start it manually inside a helper with `this.helpers["Puppeteer"]._startBrowser()`.
|
|
5876
5967
|
* @property [browser = chrome] - can be changed to `firefox` when using [puppeteer-firefox](https://codecept.io/helpers/Puppeteer-firefox).
|
|
5877
5968
|
* @property [chrome] - pass additional [Puppeteer run options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions).
|
|
5969
|
+
* @property [highlightElement] - highlight the interacting elements
|
|
5878
5970
|
*/
|
|
5879
5971
|
type PuppeteerConfig = {
|
|
5880
5972
|
url: string;
|
|
@@ -5896,6 +5988,7 @@ declare namespace CodeceptJS {
|
|
|
5896
5988
|
manualStart?: boolean;
|
|
5897
5989
|
browser?: string;
|
|
5898
5990
|
chrome?: any;
|
|
5991
|
+
highlightElement?: boolean;
|
|
5899
5992
|
};
|
|
5900
5993
|
/**
|
|
5901
5994
|
* Uses [Google Chrome's Puppeteer](https://github.com/GoogleChrome/puppeteer) library to run tests inside headless Chrome.
|
|
@@ -6693,6 +6786,9 @@ declare namespace CodeceptJS {
|
|
|
6693
6786
|
*
|
|
6694
6787
|
* // passing in an array
|
|
6695
6788
|
* I.type(['T', 'E', 'X', 'T']);
|
|
6789
|
+
*
|
|
6790
|
+
* // passing a secret
|
|
6791
|
+
* I.type(secret('123456'));
|
|
6696
6792
|
* ```
|
|
6697
6793
|
* @param key - or array of keys to type.
|
|
6698
6794
|
* @param [delay = null] - (optional) delay in ms between key presses
|
|
@@ -6738,6 +6834,8 @@ declare namespace CodeceptJS {
|
|
|
6738
6834
|
*
|
|
6739
6835
|
* ```js
|
|
6740
6836
|
* I.appendField('#myTextField', 'appended');
|
|
6837
|
+
* // typing secret
|
|
6838
|
+
* I.appendField('password', secret('123456'));
|
|
6741
6839
|
* ```
|
|
6742
6840
|
* @param field - located by label|name|CSS|XPath|strict locator
|
|
6743
6841
|
* @param value - text value to append.
|
|
@@ -7616,7 +7714,8 @@ declare namespace CodeceptJS {
|
|
|
7616
7714
|
* endpoint: 'http://site.com/api',
|
|
7617
7715
|
* prettyPrintJson: true,
|
|
7618
7716
|
* onRequest: (request) => {
|
|
7619
|
-
*
|
|
7717
|
+
* request.headers.auth = '123';
|
|
7718
|
+
* }
|
|
7620
7719
|
* }
|
|
7621
7720
|
* }
|
|
7622
7721
|
* }
|
|
@@ -7675,7 +7774,7 @@ declare namespace CodeceptJS {
|
|
|
7675
7774
|
* ```js
|
|
7676
7775
|
* I.sendGetRequest('/api/users.json');
|
|
7677
7776
|
* ```
|
|
7678
|
-
* @param [headers = {}] - the headers object to be sent. By default it is sent as an empty object
|
|
7777
|
+
* @param [headers = {}] - the headers object to be sent. By default, it is sent as an empty object
|
|
7679
7778
|
* @returns response
|
|
7680
7779
|
*/
|
|
7681
7780
|
sendGetRequest(url: any, headers?: any): Promise<any>;
|
|
@@ -7689,8 +7788,8 @@ declare namespace CodeceptJS {
|
|
|
7689
7788
|
* I.sendPostRequest('/api/users.json', secret({ "email": "user@user.com" }));
|
|
7690
7789
|
*
|
|
7691
7790
|
* ```
|
|
7692
|
-
* @param [payload = {}] - the payload to be sent. By default it is sent as an empty object
|
|
7693
|
-
* @param [headers = {}] - the headers object to be sent. By default it is sent as an empty object
|
|
7791
|
+
* @param [payload = {}] - the payload to be sent. By default, it is sent as an empty object
|
|
7792
|
+
* @param [headers = {}] - the headers object to be sent. By default, it is sent as an empty object
|
|
7694
7793
|
* @returns response
|
|
7695
7794
|
*/
|
|
7696
7795
|
sendPostRequest(url: any, payload?: any, headers?: any): Promise<any>;
|
|
@@ -7730,7 +7829,7 @@ declare namespace CodeceptJS {
|
|
|
7730
7829
|
* ```js
|
|
7731
7830
|
* I.sendDeleteRequest('/api/users/1');
|
|
7732
7831
|
* ```
|
|
7733
|
-
* @param [headers = {}] - the headers object to be sent. By default it is sent as an empty object
|
|
7832
|
+
* @param [headers = {}] - the headers object to be sent. By default, it is sent as an empty object
|
|
7734
7833
|
* @returns response
|
|
7735
7834
|
*/
|
|
7736
7835
|
sendDeleteRequest(url: any, headers?: any): Promise<any>;
|
|
@@ -8005,6 +8104,8 @@ declare namespace CodeceptJS {
|
|
|
8005
8104
|
*
|
|
8006
8105
|
* ```js
|
|
8007
8106
|
* I.appendField('#myTextField', 'appended');
|
|
8107
|
+
* // typing secret
|
|
8108
|
+
* I.appendField('password', secret('123456'));
|
|
8008
8109
|
* ```
|
|
8009
8110
|
* @param field - located by label|name|CSS|XPath|strict locator
|
|
8010
8111
|
* @param value - text value to append.
|
|
@@ -8756,7 +8857,7 @@ declare namespace CodeceptJS {
|
|
|
8756
8857
|
*
|
|
8757
8858
|
* This helper should be configured in codecept.conf.js
|
|
8758
8859
|
* @property url - base url of website to be tested.
|
|
8759
|
-
* @property browser -
|
|
8860
|
+
* @property browser - Browser in which to perform testing.
|
|
8760
8861
|
* @property [basicAuth] - (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
|
|
8761
8862
|
* @property [host = localhost] - WebDriver host to connect.
|
|
8762
8863
|
* @property [port = 4444] - WebDriver port to connect.
|
|
@@ -8774,6 +8875,7 @@ declare namespace CodeceptJS {
|
|
|
8774
8875
|
* @property [desiredCapabilities] - Selenium's [desired capabilities](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities).
|
|
8775
8876
|
* @property [manualStart = false] - do not start browser before a test, start it manually inside a helper with `this.helpers["WebDriver"]._startBrowser()`.
|
|
8776
8877
|
* @property [timeouts] - [WebDriver timeouts](http://webdriver.io/docs/timeouts.html) defined as hash.
|
|
8878
|
+
* @property [highlightElement] - highlight the interacting elements
|
|
8777
8879
|
*/
|
|
8778
8880
|
type WebDriverConfig = {
|
|
8779
8881
|
url: string;
|
|
@@ -8795,6 +8897,7 @@ declare namespace CodeceptJS {
|
|
|
8795
8897
|
desiredCapabilities?: any;
|
|
8796
8898
|
manualStart?: boolean;
|
|
8797
8899
|
timeouts?: any;
|
|
8900
|
+
highlightElement?: boolean;
|
|
8798
8901
|
};
|
|
8799
8902
|
/**
|
|
8800
8903
|
* WebDriver helper which wraps [webdriverio](http://webdriver.io/) library to
|
|
@@ -9157,7 +9260,7 @@ declare namespace CodeceptJS {
|
|
|
9157
9260
|
*/
|
|
9158
9261
|
_locate(locator: CodeceptJS.LocatorOrString): void;
|
|
9159
9262
|
/**
|
|
9160
|
-
* Find a checkbox by providing human
|
|
9263
|
+
* Find a checkbox by providing human-readable text:
|
|
9161
9264
|
*
|
|
9162
9265
|
* ```js
|
|
9163
9266
|
* this.helpers['WebDriver']._locateCheckable('I agree with terms and conditions').then // ...
|
|
@@ -9166,7 +9269,7 @@ declare namespace CodeceptJS {
|
|
|
9166
9269
|
*/
|
|
9167
9270
|
_locateCheckable(locator: CodeceptJS.LocatorOrString): void;
|
|
9168
9271
|
/**
|
|
9169
|
-
* Find a clickable element by providing human
|
|
9272
|
+
* Find a clickable element by providing human-readable text:
|
|
9170
9273
|
*
|
|
9171
9274
|
* ```js
|
|
9172
9275
|
* const els = await this.helpers.WebDriver._locateClickable('Next page');
|
|
@@ -9176,7 +9279,7 @@ declare namespace CodeceptJS {
|
|
|
9176
9279
|
*/
|
|
9177
9280
|
_locateClickable(locator: CodeceptJS.LocatorOrString): void;
|
|
9178
9281
|
/**
|
|
9179
|
-
* Find field elements by providing human
|
|
9282
|
+
* Find field elements by providing human-readable text:
|
|
9180
9283
|
*
|
|
9181
9284
|
* ```js
|
|
9182
9285
|
* this.helpers['WebDriver']._locateFields('Your email').then // ...
|
|
@@ -9360,6 +9463,8 @@ declare namespace CodeceptJS {
|
|
|
9360
9463
|
*
|
|
9361
9464
|
* ```js
|
|
9362
9465
|
* I.appendField('#myTextField', 'appended');
|
|
9466
|
+
* // typing secret
|
|
9467
|
+
* I.appendField('password', secret('123456'));
|
|
9363
9468
|
* ```
|
|
9364
9469
|
* @param field - located by label|name|CSS|XPath|strict locator
|
|
9365
9470
|
* @param value - text value to append.
|
|
@@ -10239,6 +10344,9 @@ declare namespace CodeceptJS {
|
|
|
10239
10344
|
*
|
|
10240
10345
|
* // passing in an array
|
|
10241
10346
|
* I.type(['T', 'E', 'X', 'T']);
|
|
10347
|
+
*
|
|
10348
|
+
* // passing a secret
|
|
10349
|
+
* I.type(secret('123456'));
|
|
10242
10350
|
* ```
|
|
10243
10351
|
* @param key - or array of keys to type.
|
|
10244
10352
|
* @param [delay = null] - (optional) delay in ms between key presses
|
|
@@ -11134,7 +11242,7 @@ declare namespace CodeceptJS {
|
|
|
11134
11242
|
* true: it will retries if `retryOpts` set.
|
|
11135
11243
|
* false: ignore `retryOpts` and won't retry.
|
|
11136
11244
|
*/
|
|
11137
|
-
add(taskName: string | ((...params: any[]) => any), fn?: (...params: any[]) => any, force?: boolean, retry?: boolean, timeout?: number): Promise<any
|
|
11245
|
+
add(taskName: string | ((...params: any[]) => any), fn?: (...params: any[]) => any, force?: boolean, retry?: boolean, timeout?: number): Promise<any>;
|
|
11138
11246
|
retry(opts: any): any;
|
|
11139
11247
|
catch(customErrFn?: (...params: any[]) => any): Promise<any>;
|
|
11140
11248
|
catchWithoutStop(customErrFn: (...params: any[]) => any): Promise<any>;
|