codeceptjs 3.4.1 → 3.5.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 (75) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/README.md +11 -9
  3. package/bin/codecept.js +1 -1
  4. package/docs/ai.md +248 -0
  5. package/docs/build/Appium.js +47 -7
  6. package/docs/build/JSONResponse.js +4 -4
  7. package/docs/build/Nightmare.js +3 -1
  8. package/docs/build/OpenAI.js +122 -0
  9. package/docs/build/Playwright.js +234 -54
  10. package/docs/build/Protractor.js +3 -1
  11. package/docs/build/Puppeteer.js +101 -12
  12. package/docs/build/REST.js +15 -5
  13. package/docs/build/TestCafe.js +61 -2
  14. package/docs/build/WebDriver.js +85 -5
  15. package/docs/changelog.md +85 -0
  16. package/docs/helpers/Appium.md +152 -147
  17. package/docs/helpers/JSONResponse.md +4 -4
  18. package/docs/helpers/Nightmare.md +2 -0
  19. package/docs/helpers/OpenAI.md +70 -0
  20. package/docs/helpers/Playwright.md +228 -151
  21. package/docs/helpers/Puppeteer.md +153 -101
  22. package/docs/helpers/REST.md +6 -5
  23. package/docs/helpers/TestCafe.md +97 -49
  24. package/docs/helpers/WebDriver.md +159 -107
  25. package/docs/mobile.md +49 -2
  26. package/docs/parallel.md +56 -0
  27. package/docs/plugins.md +87 -33
  28. package/docs/secrets.md +6 -0
  29. package/docs/tutorial.md +2 -2
  30. package/docs/webapi/appendField.mustache +2 -0
  31. package/docs/webapi/blur.mustache +17 -0
  32. package/docs/webapi/focus.mustache +12 -0
  33. package/docs/webapi/type.mustache +3 -0
  34. package/lib/ai.js +171 -0
  35. package/lib/cli.js +10 -2
  36. package/lib/codecept.js +4 -0
  37. package/lib/command/dryRun.js +9 -1
  38. package/lib/command/generate.js +46 -3
  39. package/lib/command/init.js +23 -1
  40. package/lib/command/interactive.js +15 -1
  41. package/lib/command/run-workers.js +2 -1
  42. package/lib/container.js +13 -3
  43. package/lib/event.js +2 -0
  44. package/lib/helper/Appium.js +45 -7
  45. package/lib/helper/JSONResponse.js +4 -4
  46. package/lib/helper/Nightmare.js +1 -1
  47. package/lib/helper/OpenAI.js +122 -0
  48. package/lib/helper/Playwright.js +200 -45
  49. package/lib/helper/Protractor.js +1 -1
  50. package/lib/helper/Puppeteer.js +67 -12
  51. package/lib/helper/REST.js +15 -5
  52. package/lib/helper/TestCafe.js +30 -2
  53. package/lib/helper/WebDriver.js +51 -5
  54. package/lib/helper/scripts/blurElement.js +17 -0
  55. package/lib/helper/scripts/focusElement.js +17 -0
  56. package/lib/helper/scripts/highlightElement.js +20 -0
  57. package/lib/html.js +258 -0
  58. package/lib/interfaces/gherkin.js +8 -0
  59. package/lib/listener/retry.js +2 -1
  60. package/lib/pause.js +73 -17
  61. package/lib/plugin/debugErrors.js +67 -0
  62. package/lib/plugin/fakerTransform.js +4 -6
  63. package/lib/plugin/heal.js +177 -0
  64. package/lib/plugin/screenshotOnFail.js +11 -2
  65. package/lib/recorder.js +11 -8
  66. package/lib/secret.js +5 -4
  67. package/lib/step.js +6 -1
  68. package/lib/ui.js +4 -3
  69. package/lib/utils.js +17 -0
  70. package/lib/workers.js +57 -9
  71. package/package.json +25 -16
  72. package/translations/ja-JP.js +9 -9
  73. package/typings/index.d.ts +43 -9
  74. package/typings/promiseBasedTypes.d.ts +242 -25
  75. package/typings/types.d.ts +260 -35
@@ -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.
@@ -1655,16 +1657,16 @@ declare namespace CodeceptJS {
1655
1657
  *
1656
1658
  * I.seeResponseMatchesJsonSchema(joi => {
1657
1659
  * return joi.object({
1658
- * name: joi.string();
1659
- * id: joi.number();
1660
+ * name: joi.string(),
1661
+ * id: joi.number()
1660
1662
  * })
1661
1663
  * });
1662
1664
  *
1663
1665
  * // or pass a valid schema
1664
- * const joi = require('joi);
1666
+ * const joi = require('joi');
1665
1667
  *
1666
1668
  * I.seeResponseMatchesJsonSchema(joi.object({
1667
- * name: joi.string();
1669
+ * name: joi.string(),
1668
1670
  * id: joi.number();
1669
1671
  * });
1670
1672
  * ```
@@ -2167,6 +2169,8 @@ declare namespace CodeceptJS {
2167
2169
  *
2168
2170
  * ```js
2169
2171
  * I.appendField('#myTextField', 'appended');
2172
+ * // typing secret
2173
+ * I.appendField('password', secret('123456'));
2170
2174
  * ```
2171
2175
  * @param field - located by label|name|CSS|XPath|strict locator
2172
2176
  * @param value - text value to append.
@@ -2671,6 +2675,46 @@ declare namespace CodeceptJS {
2671
2675
  */
2672
2676
  grabPageScrollPosition(): Promise<PageScrollPosition>;
2673
2677
  }
2678
+ /**
2679
+ * OpenAI Helper for CodeceptJS.
2680
+ *
2681
+ * 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.
2682
+ * This helper should be enabled with any web helpers like Playwright or Puppeteer or WebDrvier to ensure the HTML context is available.
2683
+ *
2684
+ * ## Configuration
2685
+ *
2686
+ * This helper should be configured in codecept.json or codecept.conf.js
2687
+ *
2688
+ * * `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.
2689
+ */
2690
+ class OpenAITs {
2691
+ /**
2692
+ * Asks the OpenAI GPT language model a question based on the provided prompt within the context of the current page's HTML.
2693
+ *
2694
+ * ```js
2695
+ * I.askGptOnPage('what does this page do?');
2696
+ * ```
2697
+ * @param prompt - The question or prompt to ask the GPT model.
2698
+ * @returns - A Promise that resolves to the generated responses from the GPT model, joined by newlines.
2699
+ */
2700
+ askGptOnPage(prompt: string): Promise<string>;
2701
+ /**
2702
+ * 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.
2703
+ *
2704
+ * ```js
2705
+ * I.askGptOnPageFragment('describe features of this screen', '.screen');
2706
+ * ```
2707
+ * @param prompt - The question or prompt to ask the GPT-3.5 model.
2708
+ * @param locator - The locator or selector used to identify the HTML fragment on the page.
2709
+ * @returns - A Promise that resolves to the generated response from the GPT model.
2710
+ */
2711
+ askGptOnPageFragment(prompt: string, locator: string): Promise<string>;
2712
+ /**
2713
+ * Send a general request to ChatGPT and return response.
2714
+ * @returns - A Promise that resolves to the generated response from the GPT model.
2715
+ */
2716
+ askGptGeneralPrompt(prompt: string): Promise<string>;
2717
+ }
2674
2718
  /**
2675
2719
  * Uses [Playwright](https://github.com/microsoft/playwright) library to run tests inside:
2676
2720
  *
@@ -2705,7 +2749,7 @@ declare namespace CodeceptJS {
2705
2749
  *
2706
2750
  * #### Trace Recording Customization
2707
2751
  *
2708
- * Trace recording provides a complete information on test execution and includes DOM snapshots, screenshots, and network requests logged during run.
2752
+ * Trace recording provides complete information on test execution and includes DOM snapshots, screenshots, and network requests logged during run.
2709
2753
  * Traces will be saved to `output/trace`
2710
2754
  *
2711
2755
  * * `trace`: enables trace recording for failed tests; trace are saved into `output/trace` folder
@@ -2835,6 +2879,22 @@ declare namespace CodeceptJS {
2835
2879
  * }
2836
2880
  * ```
2837
2881
  *
2882
+ * * #### Example #9: Launch electron test
2883
+ *
2884
+ * ```js
2885
+ * {
2886
+ * helpers: {
2887
+ * Playwright: {
2888
+ * browser: 'electron',
2889
+ * electron: {
2890
+ * executablePath: require("electron"),
2891
+ * args: [path.join('../', "main.js")],
2892
+ * },
2893
+ * }
2894
+ * },
2895
+ * }
2896
+ * ```
2897
+ *
2838
2898
  * Note: When connecting to remote browser `show` and specific `chrome` options (e.g. `headless` or `devtools`) are ignored.
2839
2899
  *
2840
2900
  * ## Access From Helpers
@@ -2999,6 +3059,39 @@ declare namespace CodeceptJS {
2999
3059
  * ⚠️ returns a _promise_ which is synchronized internally by recorder
3000
3060
  */
3001
3061
  moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
3062
+ /**
3063
+ * Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the matching element.
3064
+ *
3065
+ * Examples:
3066
+ *
3067
+ * ```js
3068
+ * I.dontSee('#add-to-cart-btn');
3069
+ * I.focus('#product-tile')
3070
+ * I.see('#add-to-cart-bnt');
3071
+ * ```
3072
+ * @param locator - field located by label|name|CSS|XPath|strict locator.
3073
+ * @param [options] - Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-focus) for available options object as 2nd argument.
3074
+ */
3075
+ focus(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
3076
+ /**
3077
+ * Remove focus from a text input, button, etc.
3078
+ * Calls [blur](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element.
3079
+ *
3080
+ * Examples:
3081
+ *
3082
+ * ```js
3083
+ * I.blur('.text-area')
3084
+ * ```
3085
+ * ```js
3086
+ * //element `#product-tile` is focused
3087
+ * I.see('#add-to-cart-btn');
3088
+ * I.blur('#product-tile')
3089
+ * I.dontSee('#add-to-cart-btn');
3090
+ * ```
3091
+ * @param locator - field located by label|name|CSS|XPath|strict locator.
3092
+ * @param [options] - Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-blur) for available options object as 2nd argument.
3093
+ */
3094
+ blur(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
3002
3095
  /**
3003
3096
  * Drag an item to a destination element.
3004
3097
  *
@@ -3015,7 +3108,7 @@ declare namespace CodeceptJS {
3015
3108
  * I.dragAndDrop('img.src', 'img.dst', { sourcePosition: {x: 10, y: 10} })
3016
3109
  * ```
3017
3110
  *
3018
- * > By default option `force: true` is set
3111
+ * > 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`
3019
3112
  */
3020
3113
  dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString, options?: any): Promise<any>;
3021
3114
  /**
@@ -3299,7 +3392,7 @@ declare namespace CodeceptJS {
3299
3392
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
3300
3393
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
3301
3394
  * ⚠️ returns a _promise_ which is synchronized internally by recorder
3302
- * @param [opts] - [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
3395
+ * @param [options] - [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
3303
3396
  *
3304
3397
  * Examples:
3305
3398
  *
@@ -3311,7 +3404,7 @@ declare namespace CodeceptJS {
3311
3404
  * I.click('.edit', null, { modifiers: ['Ctrl'] } )
3312
3405
  * ```
3313
3406
  */
3314
- click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null, opts?: any): Promise<any>;
3407
+ click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null, options?: any): Promise<any>;
3315
3408
  /**
3316
3409
  * Clicks link and waits for navigation (deprecated)
3317
3410
  */
@@ -3562,6 +3655,9 @@ declare namespace CodeceptJS {
3562
3655
  *
3563
3656
  * // passing in an array
3564
3657
  * I.type(['T', 'E', 'X', 'T']);
3658
+ *
3659
+ * // passing a secret
3660
+ * I.type(secret('123456'));
3565
3661
  * ```
3566
3662
  * @param key - or array of keys to type.
3567
3663
  * @param [delay = null] - (optional) delay in ms between key presses
@@ -3588,23 +3684,30 @@ declare namespace CodeceptJS {
3588
3684
  */
3589
3685
  fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
3590
3686
  /**
3591
- * Clears a `<textarea>` or text `<input>` element's value.
3687
+ * Clears the text input element: `<input>`, `<textarea>` or `[contenteditable]` .
3688
+ *
3689
+ *
3690
+ * Examples:
3592
3691
  *
3593
3692
  * ```js
3594
- * I.clearField('Email');
3595
- * I.clearField('user[email]');
3596
- * I.clearField('#email');
3693
+ * I.clearField('.text-area')
3694
+ *
3695
+ * // if this doesn't work use force option
3696
+ * I.clearField('#submit', { force: true })
3597
3697
  * ```
3598
- * @param editable - field located by label|name|CSS|XPath|strict locator.
3599
- * ⚠️ returns a _promise_ which is synchronized internally by recorder.
3698
+ * Use `force` to bypass the [actionability](https://playwright.dev/docs/actionability) checks.
3699
+ * @param locator - field located by label|name|CSS|XPath|strict locator.
3700
+ * @param [options] - [Additional options](https://playwright.dev/docs/api/class-locator#locator-clear) for available options object as 2nd argument.
3600
3701
  */
3601
- clearField(editable: LocatorOrString): Promise<any>;
3702
+ clearField(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
3602
3703
  /**
3603
3704
  * Appends text to a input field or textarea.
3604
3705
  * Field is located by name, label, CSS or XPath
3605
3706
  *
3606
3707
  * ```js
3607
3708
  * I.appendField('#myTextField', 'appended');
3709
+ * // typing secret
3710
+ * I.appendField('password', secret('123456'));
3608
3711
  * ```
3609
3712
  * @param field - located by label|name|CSS|XPath|strict locator
3610
3713
  * @param value - text value to append.
@@ -4334,7 +4437,7 @@ declare namespace CodeceptJS {
4334
4437
  *
4335
4438
  * See [Playwright's reference](https://playwright.dev/docs/api/class-page?_highlight=waitfornavi#pagewaitfornavigationoptions)
4336
4439
  */
4337
- waitForNavigation(opts: any): Promise<any>;
4440
+ waitForNavigation(options: any): Promise<any>;
4338
4441
  /**
4339
4442
  * Waits for an element to become not attached to the DOM on a page (by default waits for 1sec).
4340
4443
  * Element can be located by CSS or XPath.
@@ -4859,6 +4962,8 @@ declare namespace CodeceptJS {
4859
4962
  *
4860
4963
  * ```js
4861
4964
  * I.appendField('#myTextField', 'appended');
4965
+ * // typing secret
4966
+ * I.appendField('password', secret('123456'));
4862
4967
  * ```
4863
4968
  * @param field - located by label|name|CSS|XPath|strict locator
4864
4969
  * @param value - text value to append.
@@ -6031,6 +6136,39 @@ declare namespace CodeceptJS {
6031
6136
  * {{ react }}
6032
6137
  */
6033
6138
  moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
6139
+ /**
6140
+ * Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the matching element.
6141
+ *
6142
+ * Examples:
6143
+ *
6144
+ * ```js
6145
+ * I.dontSee('#add-to-cart-btn');
6146
+ * I.focus('#product-tile')
6147
+ * I.see('#add-to-cart-bnt');
6148
+ * ```
6149
+ * @param locator - field located by label|name|CSS|XPath|strict locator.
6150
+ * @param [options] - Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-focus) for available options object as 2nd argument.
6151
+ */
6152
+ focus(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
6153
+ /**
6154
+ * Remove focus from a text input, button, etc.
6155
+ * Calls [blur](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element.
6156
+ *
6157
+ * Examples:
6158
+ *
6159
+ * ```js
6160
+ * I.blur('.text-area')
6161
+ * ```
6162
+ * ```js
6163
+ * //element `#product-tile` is focused
6164
+ * I.see('#add-to-cart-btn');
6165
+ * I.blur('#product-tile')
6166
+ * I.dontSee('#add-to-cart-btn');
6167
+ * ```
6168
+ * @param locator - field located by label|name|CSS|XPath|strict locator.
6169
+ * @param [options] - Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-blur) for available options object as 2nd argument.
6170
+ */
6171
+ blur(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
6034
6172
  /**
6035
6173
  * Drag an item to a destination element.
6036
6174
  *
@@ -6567,6 +6705,9 @@ declare namespace CodeceptJS {
6567
6705
  *
6568
6706
  * // passing in an array
6569
6707
  * I.type(['T', 'E', 'X', 'T']);
6708
+ *
6709
+ * // passing a secret
6710
+ * I.type(secret('123456'));
6570
6711
  * ```
6571
6712
  * @param key - or array of keys to type.
6572
6713
  * @param [delay = null] - (optional) delay in ms between key presses
@@ -6612,6 +6753,8 @@ declare namespace CodeceptJS {
6612
6753
  *
6613
6754
  * ```js
6614
6755
  * I.appendField('#myTextField', 'appended');
6756
+ * // typing secret
6757
+ * I.appendField('password', secret('123456'));
6615
6758
  * ```
6616
6759
  * @param field - located by label|name|CSS|XPath|strict locator
6617
6760
  * @param value - text value to append.
@@ -7471,7 +7614,8 @@ declare namespace CodeceptJS {
7471
7614
  * endpoint: 'http://site.com/api',
7472
7615
  * prettyPrintJson: true,
7473
7616
  * onRequest: (request) => {
7474
- * request.headers.auth = '123';
7617
+ * request.headers.auth = '123';
7618
+ * }
7475
7619
  * }
7476
7620
  * }
7477
7621
  * }
@@ -7530,7 +7674,7 @@ declare namespace CodeceptJS {
7530
7674
  * ```js
7531
7675
  * I.sendGetRequest('/api/users.json');
7532
7676
  * ```
7533
- * @param [headers = {}] - the headers object to be sent. By default it is sent as an empty object
7677
+ * @param [headers = {}] - the headers object to be sent. By default, it is sent as an empty object
7534
7678
  * @returns response
7535
7679
  */
7536
7680
  sendGetRequest(url: any, headers?: any): Promise<any>;
@@ -7544,8 +7688,8 @@ declare namespace CodeceptJS {
7544
7688
  * I.sendPostRequest('/api/users.json', secret({ "email": "user@user.com" }));
7545
7689
  *
7546
7690
  * ```
7547
- * @param [payload = {}] - the payload to be sent. By default it is sent as an empty object
7548
- * @param [headers = {}] - the headers object to be sent. By default it is sent as an empty object
7691
+ * @param [payload = {}] - the payload to be sent. By default, it is sent as an empty object
7692
+ * @param [headers = {}] - the headers object to be sent. By default, it is sent as an empty object
7549
7693
  * @returns response
7550
7694
  */
7551
7695
  sendPostRequest(url: any, payload?: any, headers?: any): Promise<any>;
@@ -7585,7 +7729,7 @@ declare namespace CodeceptJS {
7585
7729
  * ```js
7586
7730
  * I.sendDeleteRequest('/api/users/1');
7587
7731
  * ```
7588
- * @param [headers = {}] - the headers object to be sent. By default it is sent as an empty object
7732
+ * @param [headers = {}] - the headers object to be sent. By default, it is sent as an empty object
7589
7733
  * @returns response
7590
7734
  */
7591
7735
  sendDeleteRequest(url: any, headers?: any): Promise<any>;
@@ -7774,6 +7918,39 @@ declare namespace CodeceptJS {
7774
7918
  * ⚠️ returns a _promise_ which is synchronized internally by recorder
7775
7919
  */
7776
7920
  resizeWindow(width: number, height: number): Promise<any>;
7921
+ /**
7922
+ * Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the matching element.
7923
+ *
7924
+ * Examples:
7925
+ *
7926
+ * ```js
7927
+ * I.dontSee('#add-to-cart-btn');
7928
+ * I.focus('#product-tile')
7929
+ * I.see('#add-to-cart-bnt');
7930
+ * ```
7931
+ * @param locator - field located by label|name|CSS|XPath|strict locator.
7932
+ * @param [options] - Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-focus) for available options object as 2nd argument.
7933
+ */
7934
+ focus(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
7935
+ /**
7936
+ * Remove focus from a text input, button, etc.
7937
+ * Calls [blur](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element.
7938
+ *
7939
+ * Examples:
7940
+ *
7941
+ * ```js
7942
+ * I.blur('.text-area')
7943
+ * ```
7944
+ * ```js
7945
+ * //element `#product-tile` is focused
7946
+ * I.see('#add-to-cart-btn');
7947
+ * I.blur('#product-tile')
7948
+ * I.dontSee('#add-to-cart-btn');
7949
+ * ```
7950
+ * @param locator - field located by label|name|CSS|XPath|strict locator.
7951
+ * @param [options] - Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-blur) for available options object as 2nd argument.
7952
+ */
7953
+ blur(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
7777
7954
  /**
7778
7955
  * Perform a click on a link or a button, given by a locator.
7779
7956
  * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
@@ -7859,6 +8036,8 @@ declare namespace CodeceptJS {
7859
8036
  *
7860
8037
  * ```js
7861
8038
  * I.appendField('#myTextField', 'appended');
8039
+ * // typing secret
8040
+ * I.appendField('password', secret('123456'));
7862
8041
  * ```
7863
8042
  * @param field - located by label|name|CSS|XPath|strict locator
7864
8043
  * @param value - text value to append.
@@ -8274,7 +8453,7 @@ declare namespace CodeceptJS {
8274
8453
  * ⚠️ returns a _promise_ which is synchronized internally by recorder
8275
8454
  *
8276
8455
  *
8277
- * If a function returns a Promise It will wait for it resolution.
8456
+ * If a function returns a Promise It will wait for its resolution.
8278
8457
  */
8279
8458
  executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
8280
8459
  /**
@@ -8966,7 +9145,7 @@ declare namespace CodeceptJS {
8966
9145
  */
8967
9146
  _locate(locator: CodeceptJS.LocatorOrString): Promise<any>;
8968
9147
  /**
8969
- * Find a checkbox by providing human readable text:
9148
+ * Find a checkbox by providing human-readable text:
8970
9149
  *
8971
9150
  * ```js
8972
9151
  * this.helpers['WebDriver']._locateCheckable('I agree with terms and conditions').then // ...
@@ -8975,7 +9154,7 @@ declare namespace CodeceptJS {
8975
9154
  */
8976
9155
  _locateCheckable(locator: CodeceptJS.LocatorOrString): Promise<any>;
8977
9156
  /**
8978
- * Find a clickable element by providing human readable text:
9157
+ * Find a clickable element by providing human-readable text:
8979
9158
  *
8980
9159
  * ```js
8981
9160
  * const els = await this.helpers.WebDriver._locateClickable('Next page');
@@ -8985,7 +9164,7 @@ declare namespace CodeceptJS {
8985
9164
  */
8986
9165
  _locateClickable(locator: CodeceptJS.LocatorOrString): Promise<any>;
8987
9166
  /**
8988
- * Find field elements by providing human readable text:
9167
+ * Find field elements by providing human-readable text:
8989
9168
  *
8990
9169
  * ```js
8991
9170
  * this.helpers['WebDriver']._locateFields('Your email').then // ...
@@ -9168,6 +9347,8 @@ declare namespace CodeceptJS {
9168
9347
  *
9169
9348
  * ```js
9170
9349
  * I.appendField('#myTextField', 'appended');
9350
+ * // typing secret
9351
+ * I.appendField('password', secret('123456'));
9171
9352
  * ```
9172
9353
  * @param field - located by label|name|CSS|XPath|strict locator
9173
9354
  * @param value - text value to append.
@@ -10047,6 +10228,9 @@ declare namespace CodeceptJS {
10047
10228
  *
10048
10229
  * // passing in an array
10049
10230
  * I.type(['T', 'E', 'X', 'T']);
10231
+ *
10232
+ * // passing a secret
10233
+ * I.type(secret('123456'));
10050
10234
  * ```
10051
10235
  * @param key - or array of keys to type.
10052
10236
  * @param [delay = null] - (optional) delay in ms between key presses
@@ -10063,6 +10247,39 @@ declare namespace CodeceptJS {
10063
10247
  * Appium: not tested in web, in apps doesn't work
10064
10248
  */
10065
10249
  resizeWindow(width: number, height: number): Promise<any>;
10250
+ /**
10251
+ * Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the matching element.
10252
+ *
10253
+ * Examples:
10254
+ *
10255
+ * ```js
10256
+ * I.dontSee('#add-to-cart-btn');
10257
+ * I.focus('#product-tile')
10258
+ * I.see('#add-to-cart-bnt');
10259
+ * ```
10260
+ * @param locator - field located by label|name|CSS|XPath|strict locator.
10261
+ * @param [options] - Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-focus) for available options object as 2nd argument.
10262
+ */
10263
+ focus(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
10264
+ /**
10265
+ * Remove focus from a text input, button, etc.
10266
+ * Calls [blur](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element.
10267
+ *
10268
+ * Examples:
10269
+ *
10270
+ * ```js
10271
+ * I.blur('.text-area')
10272
+ * ```
10273
+ * ```js
10274
+ * //element `#product-tile` is focused
10275
+ * I.see('#add-to-cart-btn');
10276
+ * I.blur('#product-tile')
10277
+ * I.dontSee('#add-to-cart-btn');
10278
+ * ```
10279
+ * @param locator - field located by label|name|CSS|XPath|strict locator.
10280
+ * @param [options] - Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-blur) for available options object as 2nd argument.
10281
+ */
10282
+ blur(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
10066
10283
  /**
10067
10284
  * Drag an item to a destination element.
10068
10285
  *