codeceptjs 4.0.1-beta.8 → 4.0.2-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/bin/codecept.js +2 -2
- package/lib/command/definitions.js +8 -3
- package/lib/command/workers/runTests.js +12 -2
- package/lib/config.js +3 -2
- package/lib/container.js +78 -6
- package/lib/helper/Playwright.js +80 -120
- package/lib/helper/Puppeteer.js +8 -5
- package/lib/listener/helpers.js +2 -14
- package/lib/mocha/factory.js +2 -27
- package/lib/mocha/test.js +4 -2
- package/lib/output.js +2 -2
- package/lib/step/base.js +14 -1
- package/lib/step/meta.js +18 -1
- package/lib/step/record.js +8 -0
- package/lib/utils/loaderCheck.js +13 -3
- package/lib/utils/typescript.js +82 -35
- package/lib/workers.js +5 -2
- package/package.json +22 -22
- package/typings/index.d.ts +1 -1
- package/typings/promiseBasedTypes.d.ts +136 -43
- package/typings/types.d.ts +150 -74
package/typings/types.d.ts
CHANGED
|
@@ -872,9 +872,13 @@ declare namespace CodeceptJS {
|
|
|
872
872
|
* For buttons, the "value" attribute, "name" attribute, and inner text are searched. For links, the link text is searched.
|
|
873
873
|
* For images, the "alt" attribute and inner text of any parent links are searched.
|
|
874
874
|
*
|
|
875
|
+
* If no locator is provided, defaults to clicking the body element (`'//body'`).
|
|
876
|
+
*
|
|
875
877
|
* The second parameter is a context (CSS or XPath locator) to narrow the search.
|
|
876
878
|
*
|
|
877
879
|
* ```js
|
|
880
|
+
* // click body element (default)
|
|
881
|
+
* I.click();
|
|
878
882
|
* // simple link
|
|
879
883
|
* I.click('Logout');
|
|
880
884
|
* // button of form
|
|
@@ -888,11 +892,11 @@ declare namespace CodeceptJS {
|
|
|
888
892
|
* // using strict locator
|
|
889
893
|
* I.click({css: 'nav a.login'});
|
|
890
894
|
* ```
|
|
891
|
-
* @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
895
|
+
* @param [locator = '//body'] - (optional, `'//body'` by default) clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
892
896
|
* @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
893
897
|
* @returns automatically synchronized promise through #recorder
|
|
894
898
|
*/
|
|
895
|
-
click(locator
|
|
899
|
+
click(locator?: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): void;
|
|
896
900
|
/**
|
|
897
901
|
* Verifies that the specified checkbox is not checked.
|
|
898
902
|
*
|
|
@@ -1752,28 +1756,28 @@ declare namespace CodeceptJS {
|
|
|
1752
1756
|
*/
|
|
1753
1757
|
seeResponseEquals(resp: any): void;
|
|
1754
1758
|
/**
|
|
1755
|
-
* Validates JSON structure of response using [
|
|
1756
|
-
* See [
|
|
1759
|
+
* Validates JSON structure of response using [Zod library](https://zod.dev).
|
|
1760
|
+
* See [Zod API](https://zod.dev/) for complete reference on usage.
|
|
1757
1761
|
*
|
|
1758
|
-
* Use pre-initialized
|
|
1762
|
+
* Use pre-initialized Zod instance by passing function callback:
|
|
1759
1763
|
*
|
|
1760
1764
|
* ```js
|
|
1761
1765
|
* // response.data is { name: 'jon', id: 1 }
|
|
1762
1766
|
*
|
|
1763
|
-
* I.seeResponseMatchesJsonSchema(
|
|
1764
|
-
* return
|
|
1765
|
-
* name:
|
|
1766
|
-
* id:
|
|
1767
|
+
* I.seeResponseMatchesJsonSchema(z => {
|
|
1768
|
+
* return z.object({
|
|
1769
|
+
* name: z.string(),
|
|
1770
|
+
* id: z.number()
|
|
1767
1771
|
* })
|
|
1768
1772
|
* });
|
|
1769
1773
|
*
|
|
1770
1774
|
* // or pass a valid schema
|
|
1771
|
-
*
|
|
1775
|
+
* import { z } from 'zod';
|
|
1772
1776
|
*
|
|
1773
|
-
* I.seeResponseMatchesJsonSchema(
|
|
1774
|
-
* name:
|
|
1775
|
-
* id:
|
|
1776
|
-
* });
|
|
1777
|
+
* I.seeResponseMatchesJsonSchema(z.object({
|
|
1778
|
+
* name: z.string(),
|
|
1779
|
+
* id: z.number()
|
|
1780
|
+
* }));
|
|
1777
1781
|
* ```
|
|
1778
1782
|
*/
|
|
1779
1783
|
seeResponseMatchesJsonSchema(fnOrSchema: any): void;
|
|
@@ -2780,6 +2784,13 @@ declare namespace CodeceptJS {
|
|
|
2780
2784
|
*/
|
|
2781
2785
|
grabPageScrollPosition(): Promise<PageScrollPosition>;
|
|
2782
2786
|
}
|
|
2787
|
+
/**
|
|
2788
|
+
* Creates a Playwright selector engine factory for a custom locator strategy.
|
|
2789
|
+
* @param name - Strategy name for error messages
|
|
2790
|
+
* @param func - The locator function (selector, root) => Element|Element[]
|
|
2791
|
+
* @returns Selector engine factory
|
|
2792
|
+
*/
|
|
2793
|
+
function createCustomSelectorEngine(name: string, func: (...params: any[]) => any): (...params: any[]) => any;
|
|
2783
2794
|
/**
|
|
2784
2795
|
* ## Configuration
|
|
2785
2796
|
*
|
|
@@ -2789,7 +2800,6 @@ declare namespace CodeceptJS {
|
|
|
2789
2800
|
* @property [show = true] - show browser window.
|
|
2790
2801
|
* @property [restart = false] - restart strategy between tests. Possible values:
|
|
2791
2802
|
* * '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.
|
|
2792
|
-
* * 'browser' or **true** - closes browser and opens it again between tests.
|
|
2793
2803
|
* * '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
|
|
2794
2804
|
* @property [timeout = 1000] - - [timeout](https://playwright.dev/docs/api/class-page#page-set-default-timeout) in ms of all Playwright actions .
|
|
2795
2805
|
* @property [disableScreenshots = false] - don't save screenshot on failure.
|
|
@@ -2831,8 +2841,6 @@ declare namespace CodeceptJS {
|
|
|
2831
2841
|
* May include session cookies, auth tokens, localStorage and (if captured with
|
|
2832
2842
|
* `grabStorageState({ indexedDB: true })`) IndexedDB data; treat as sensitive and do not commit.
|
|
2833
2843
|
*/
|
|
2834
|
-
// @ts-ignore
|
|
2835
|
-
// @ts-ignore
|
|
2836
2844
|
type PlaywrightConfig = {
|
|
2837
2845
|
url?: string;
|
|
2838
2846
|
browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
|
|
@@ -3303,20 +3311,6 @@ declare namespace CodeceptJS {
|
|
|
3303
3311
|
* @returns automatically synchronized promise through #recorder
|
|
3304
3312
|
*/
|
|
3305
3313
|
dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString, options?: any): void;
|
|
3306
|
-
/**
|
|
3307
|
-
* Restart browser with a new context and a new page
|
|
3308
|
-
*
|
|
3309
|
-
* ```js
|
|
3310
|
-
* // Restart browser and use a new timezone
|
|
3311
|
-
* I.restartBrowser({ timezoneId: 'America/Phoenix' });
|
|
3312
|
-
* // Open URL in a new page in changed timezone
|
|
3313
|
-
* I.amOnPage('/');
|
|
3314
|
-
* // Restart browser, allow reading/copying of text from/into clipboard in Chrome
|
|
3315
|
-
* I.restartBrowser({ permissions: ['clipboard-read', 'clipboard-write'] });
|
|
3316
|
-
* ```
|
|
3317
|
-
* @param [contextOptions] - [Options for browser context](https://playwright.dev/docs/api/class-browser#browser-new-context) when starting new browser
|
|
3318
|
-
*/
|
|
3319
|
-
restartBrowser(contextOptions?: any): void;
|
|
3320
3314
|
/**
|
|
3321
3315
|
* Reload the current page.
|
|
3322
3316
|
*
|
|
@@ -3612,9 +3606,13 @@ declare namespace CodeceptJS {
|
|
|
3612
3606
|
* For buttons, the "value" attribute, "name" attribute, and inner text are searched. For links, the link text is searched.
|
|
3613
3607
|
* For images, the "alt" attribute and inner text of any parent links are searched.
|
|
3614
3608
|
*
|
|
3609
|
+
* If no locator is provided, defaults to clicking the body element (`'//body'`).
|
|
3610
|
+
*
|
|
3615
3611
|
* The second parameter is a context (CSS or XPath locator) to narrow the search.
|
|
3616
3612
|
*
|
|
3617
3613
|
* ```js
|
|
3614
|
+
* // click body element (default)
|
|
3615
|
+
* I.click();
|
|
3618
3616
|
* // simple link
|
|
3619
3617
|
* I.click('Logout');
|
|
3620
3618
|
* // button of form
|
|
@@ -3636,12 +3634,12 @@ declare namespace CodeceptJS {
|
|
|
3636
3634
|
* // make ctrl-click
|
|
3637
3635
|
* I.click('.edit', null, { modifiers: ['Ctrl'] } )
|
|
3638
3636
|
* ```
|
|
3639
|
-
* @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
3637
|
+
* @param [locator = '//body'] - (optional, `'//body'` by default) clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
3640
3638
|
* @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
3641
3639
|
* @param [options] - [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
|
|
3642
3640
|
* @returns automatically synchronized promise through #recorder
|
|
3643
3641
|
*/
|
|
3644
|
-
click(locator
|
|
3642
|
+
click(locator?: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null, options?: any): void;
|
|
3645
3643
|
/**
|
|
3646
3644
|
* Clicks link and waits for navigation (deprecated)
|
|
3647
3645
|
*/
|
|
@@ -3707,6 +3705,23 @@ declare namespace CodeceptJS {
|
|
|
3707
3705
|
* @returns automatically synchronized promise through #recorder
|
|
3708
3706
|
*/
|
|
3709
3707
|
rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
|
|
3708
|
+
/**
|
|
3709
|
+
* Performs click at specific coordinates.
|
|
3710
|
+
* If locator is provided, the coordinates are relative to the element.
|
|
3711
|
+
* If locator is not provided, the coordinates are global page coordinates.
|
|
3712
|
+
*
|
|
3713
|
+
* ```js
|
|
3714
|
+
* // Click at global coordinates (100, 200)
|
|
3715
|
+
* I.clickXY(100, 200);
|
|
3716
|
+
*
|
|
3717
|
+
* // Click at coordinates (50, 30) relative to element
|
|
3718
|
+
* I.clickXY('#someElement', 50, 30);
|
|
3719
|
+
* ```
|
|
3720
|
+
* @param locator - Element to click on or X coordinate if no element.
|
|
3721
|
+
* @param [x] - X coordinate relative to element, or Y coordinate if locator is a number.
|
|
3722
|
+
* @param [y] - Y coordinate relative to element.
|
|
3723
|
+
*/
|
|
3724
|
+
clickXY(locator: CodeceptJS.LocatorOrString | number, x?: number, y?: number): Promise<void>;
|
|
3710
3725
|
/**
|
|
3711
3726
|
* [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-check) for check available as 3rd argument.
|
|
3712
3727
|
*
|
|
@@ -4447,6 +4462,24 @@ declare namespace CodeceptJS {
|
|
|
4447
4462
|
* @returns attribute value
|
|
4448
4463
|
*/
|
|
4449
4464
|
grabAttributeFromAll(locator: CodeceptJS.LocatorOrString, attr: string): Promise<string[]>;
|
|
4465
|
+
/**
|
|
4466
|
+
* Retrieves the ARIA snapshot for an element using Playwright's [`locator.ariaSnapshot`](https://playwright.dev/docs/api/class-locator#locator-aria-snapshot).
|
|
4467
|
+
* This method returns a YAML representation of the accessibility tree that can be used for assertions.
|
|
4468
|
+
* If no locator is provided, it captures the snapshot of the entire page body.
|
|
4469
|
+
*
|
|
4470
|
+
* ```js
|
|
4471
|
+
* const snapshot = await I.grabAriaSnapshot();
|
|
4472
|
+
* expect(snapshot).toContain('heading "Sign up"');
|
|
4473
|
+
*
|
|
4474
|
+
* const formSnapshot = await I.grabAriaSnapshot('#login-form');
|
|
4475
|
+
* expect(formSnapshot).toContain('textbox "Email"');
|
|
4476
|
+
* ```
|
|
4477
|
+
*
|
|
4478
|
+
* [Learn more about ARIA snapshots](https://playwright.dev/docs/aria-snapshots)
|
|
4479
|
+
* @param [locator = '//body'] - element located by CSS|XPath|strict locator. Defaults to body element.
|
|
4480
|
+
* @returns YAML representation of the accessibility tree
|
|
4481
|
+
*/
|
|
4482
|
+
grabAriaSnapshot(locator?: string | any): Promise<string>;
|
|
4450
4483
|
/**
|
|
4451
4484
|
* Saves screenshot of the specified locator to ouput folder (set in codecept.conf.ts or codecept.conf.js).
|
|
4452
4485
|
* Filename is relative to output folder.
|
|
@@ -5035,6 +5068,15 @@ declare namespace CodeceptJS {
|
|
|
5035
5068
|
*/
|
|
5036
5069
|
grabMetrics(): Promise<object[]>;
|
|
5037
5070
|
}
|
|
5071
|
+
/**
|
|
5072
|
+
* Checks if a locator is a role locator object (e.g., {role: 'button', text: 'Submit', exact: true})
|
|
5073
|
+
*/
|
|
5074
|
+
function isRoleLocatorObject(): void;
|
|
5075
|
+
/**
|
|
5076
|
+
* Handles role locator objects by converting them to Playwright's getByRole() API
|
|
5077
|
+
* Returns elements array if role locator, null otherwise
|
|
5078
|
+
*/
|
|
5079
|
+
function handleRoleLocator(): void;
|
|
5038
5080
|
/**
|
|
5039
5081
|
* Protractor helper is based on [Protractor library](http://www.protractortest.org) and used for testing web applications.
|
|
5040
5082
|
*
|
|
@@ -6356,6 +6398,11 @@ declare namespace CodeceptJS {
|
|
|
6356
6398
|
*/
|
|
6357
6399
|
setCookie(cookie: Cookie | Cookie[]): void;
|
|
6358
6400
|
}
|
|
6401
|
+
/**
|
|
6402
|
+
* Wraps error objects that don't have a proper message property
|
|
6403
|
+
* This is needed for ESM compatibility with Puppeteer error handling
|
|
6404
|
+
*/
|
|
6405
|
+
function wrapError(): void;
|
|
6359
6406
|
/**
|
|
6360
6407
|
* ## Configuration
|
|
6361
6408
|
*
|
|
@@ -6383,8 +6430,6 @@ declare namespace CodeceptJS {
|
|
|
6383
6430
|
* @property [chrome] - pass additional [Puppeteer run options](https://github.com/puppeteer/puppeteer/blob/main/docs/api/puppeteer.launchoptions.md).
|
|
6384
6431
|
* @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
6385
6432
|
*/
|
|
6386
|
-
// @ts-ignore
|
|
6387
|
-
// @ts-ignore
|
|
6388
6433
|
type PuppeteerConfig = {
|
|
6389
6434
|
url: string;
|
|
6390
6435
|
basicAuth?: any;
|
|
@@ -6986,9 +7031,13 @@ declare namespace CodeceptJS {
|
|
|
6986
7031
|
* For buttons, the "value" attribute, "name" attribute, and inner text are searched. For links, the link text is searched.
|
|
6987
7032
|
* For images, the "alt" attribute and inner text of any parent links are searched.
|
|
6988
7033
|
*
|
|
7034
|
+
* If no locator is provided, defaults to clicking the body element (`'//body'`).
|
|
7035
|
+
*
|
|
6989
7036
|
* The second parameter is a context (CSS or XPath locator) to narrow the search.
|
|
6990
7037
|
*
|
|
6991
7038
|
* ```js
|
|
7039
|
+
* // click body element (default)
|
|
7040
|
+
* I.click();
|
|
6992
7041
|
* // simple link
|
|
6993
7042
|
* I.click('Logout');
|
|
6994
7043
|
* // button of form
|
|
@@ -7002,14 +7051,14 @@ declare namespace CodeceptJS {
|
|
|
7002
7051
|
* // using strict locator
|
|
7003
7052
|
* I.click({css: 'nav a.login'});
|
|
7004
7053
|
* ```
|
|
7005
|
-
* @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
7054
|
+
* @param [locator = '//body'] - (optional, `'//body'` by default) clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
7006
7055
|
* @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
7007
7056
|
* @returns automatically synchronized promise through #recorder
|
|
7008
7057
|
*
|
|
7009
7058
|
*
|
|
7010
7059
|
* {{ react }}
|
|
7011
7060
|
*/
|
|
7012
|
-
click(locator
|
|
7061
|
+
click(locator?: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): void;
|
|
7013
7062
|
/**
|
|
7014
7063
|
* Perform an emulated click on a link or a button, given by a locator.
|
|
7015
7064
|
* Unlike normal click instead of sending native event, emulates a click with JavaScript.
|
|
@@ -7117,6 +7166,23 @@ declare namespace CodeceptJS {
|
|
|
7117
7166
|
* {{ react }}
|
|
7118
7167
|
*/
|
|
7119
7168
|
rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
|
|
7169
|
+
/**
|
|
7170
|
+
* Performs click at specific coordinates.
|
|
7171
|
+
* If locator is provided, the coordinates are relative to the element.
|
|
7172
|
+
* If locator is not provided, the coordinates are global page coordinates.
|
|
7173
|
+
*
|
|
7174
|
+
* ```js
|
|
7175
|
+
* // Click at global coordinates (100, 200)
|
|
7176
|
+
* I.clickXY(100, 200);
|
|
7177
|
+
*
|
|
7178
|
+
* // Click at coordinates (50, 30) relative to element
|
|
7179
|
+
* I.clickXY('#someElement', 50, 30);
|
|
7180
|
+
* ```
|
|
7181
|
+
* @param locator - Element to click on or X coordinate if no element.
|
|
7182
|
+
* @param [x] - X coordinate relative to element, or Y coordinate if locator is a number.
|
|
7183
|
+
* @param [y] - Y coordinate relative to element.
|
|
7184
|
+
*/
|
|
7185
|
+
clickXY(locator: CodeceptJS.LocatorOrString | number, x?: number, y?: number): Promise<void>;
|
|
7120
7186
|
/**
|
|
7121
7187
|
* Selects a checkbox or radio button.
|
|
7122
7188
|
* Element is located by label or name or CSS or XPath.
|
|
@@ -8365,8 +8431,6 @@ declare namespace CodeceptJS {
|
|
|
8365
8431
|
* @property [onResponse] - an async function which can update response object.
|
|
8366
8432
|
* @property [maxUploadFileSize] - set the max content file size in MB when performing api calls.
|
|
8367
8433
|
*/
|
|
8368
|
-
// @ts-ignore
|
|
8369
|
-
// @ts-ignore
|
|
8370
8434
|
type RESTConfig = {
|
|
8371
8435
|
endpoint?: string;
|
|
8372
8436
|
prettyPrintJson?: boolean;
|
|
@@ -9555,6 +9619,11 @@ declare namespace CodeceptJS {
|
|
|
9555
9619
|
*/
|
|
9556
9620
|
waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): void;
|
|
9557
9621
|
}
|
|
9622
|
+
/**
|
|
9623
|
+
* Wraps error objects that don't have a proper message property
|
|
9624
|
+
* This is needed for ESM compatibility with Puppeteer error handling
|
|
9625
|
+
*/
|
|
9626
|
+
function wrapError(): void;
|
|
9558
9627
|
/**
|
|
9559
9628
|
* ## Configuration
|
|
9560
9629
|
*
|
|
@@ -9582,8 +9651,6 @@ declare namespace CodeceptJS {
|
|
|
9582
9651
|
* @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
9583
9652
|
* @property [logLevel = silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
|
|
9584
9653
|
*/
|
|
9585
|
-
// @ts-ignore
|
|
9586
|
-
// @ts-ignore
|
|
9587
9654
|
type WebDriverConfig = {
|
|
9588
9655
|
url: string;
|
|
9589
9656
|
browser: string;
|
|
@@ -10043,6 +10110,11 @@ declare namespace CodeceptJS {
|
|
|
10043
10110
|
* @param locator - element located by CSS|XPath|strict locator.
|
|
10044
10111
|
*/
|
|
10045
10112
|
_locateFields(locator: CodeceptJS.LocatorOrString): void;
|
|
10113
|
+
/**
|
|
10114
|
+
* Locate elements by ARIA role using WebdriverIO accessibility selectors
|
|
10115
|
+
* @param locator - role locator object { role: string, text?: string, exact?: boolean }
|
|
10116
|
+
*/
|
|
10117
|
+
_locateByRole(locator: any): void;
|
|
10046
10118
|
/**
|
|
10047
10119
|
* Grab WebElements for given locator
|
|
10048
10120
|
* Resumes test execution, so **should be used inside an async function with `await`** operator.
|
|
@@ -10096,9 +10168,13 @@ declare namespace CodeceptJS {
|
|
|
10096
10168
|
* For buttons, the "value" attribute, "name" attribute, and inner text are searched. For links, the link text is searched.
|
|
10097
10169
|
* For images, the "alt" attribute and inner text of any parent links are searched.
|
|
10098
10170
|
*
|
|
10171
|
+
* If no locator is provided, defaults to clicking the body element (`'//body'`).
|
|
10172
|
+
*
|
|
10099
10173
|
* The second parameter is a context (CSS or XPath locator) to narrow the search.
|
|
10100
10174
|
*
|
|
10101
10175
|
* ```js
|
|
10176
|
+
* // click body element (default)
|
|
10177
|
+
* I.click();
|
|
10102
10178
|
* // simple link
|
|
10103
10179
|
* I.click('Logout');
|
|
10104
10180
|
* // button of form
|
|
@@ -10112,14 +10188,14 @@ declare namespace CodeceptJS {
|
|
|
10112
10188
|
* // using strict locator
|
|
10113
10189
|
* I.click({css: 'nav a.login'});
|
|
10114
10190
|
* ```
|
|
10115
|
-
* @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
10191
|
+
* @param [locator = '//body'] - (optional, `'//body'` by default) clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
10116
10192
|
* @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
10117
10193
|
* @returns automatically synchronized promise through #recorder
|
|
10118
10194
|
*
|
|
10119
10195
|
*
|
|
10120
10196
|
* {{ react }}
|
|
10121
10197
|
*/
|
|
10122
|
-
click(locator
|
|
10198
|
+
click(locator?: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): void;
|
|
10123
10199
|
/**
|
|
10124
10200
|
* Perform an emulated click on a link or a button, given by a locator.
|
|
10125
10201
|
* Unlike normal click instead of sending native event, emulates a click with JavaScript.
|
|
@@ -10190,6 +10266,23 @@ declare namespace CodeceptJS {
|
|
|
10190
10266
|
* {{ react }}
|
|
10191
10267
|
*/
|
|
10192
10268
|
rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
|
|
10269
|
+
/**
|
|
10270
|
+
* Performs click at specific coordinates.
|
|
10271
|
+
* If locator is provided, the coordinates are relative to the element's top-left corner.
|
|
10272
|
+
* If locator is not provided, the coordinates are relative to the body element.
|
|
10273
|
+
*
|
|
10274
|
+
* ```js
|
|
10275
|
+
* // Click at coordinates (100, 200) relative to body
|
|
10276
|
+
* I.clickXY(100, 200);
|
|
10277
|
+
*
|
|
10278
|
+
* // Click at coordinates (50, 30) relative to element's top-left corner
|
|
10279
|
+
* I.clickXY('#someElement', 50, 30);
|
|
10280
|
+
* ```
|
|
10281
|
+
* @param locator - Element to click on or X coordinate if no element.
|
|
10282
|
+
* @param [x] - X coordinate relative to element's top-left, or Y coordinate if locator is a number.
|
|
10283
|
+
* @param [y] - Y coordinate relative to element's top-left.
|
|
10284
|
+
*/
|
|
10285
|
+
clickXY(locator: CodeceptJS.LocatorOrString | number, x?: number, y?: number): Promise<void>;
|
|
10193
10286
|
/**
|
|
10194
10287
|
* Emulates right click on an element.
|
|
10195
10288
|
* Unlike normal click instead of sending native event, emulates a click with JavaScript.
|
|
@@ -11585,8 +11678,8 @@ declare namespace CodeceptJS {
|
|
|
11585
11678
|
*/
|
|
11586
11679
|
requireModules(requiringModules: string[]): void;
|
|
11587
11680
|
/**
|
|
11588
|
-
* Initialize CodeceptJS at specific
|
|
11589
|
-
*
|
|
11681
|
+
* Initialize CodeceptJS at specific dir.
|
|
11682
|
+
* Loads config, requires factory methods
|
|
11590
11683
|
*/
|
|
11591
11684
|
init(dir: string): void;
|
|
11592
11685
|
/**
|
|
@@ -11793,6 +11886,10 @@ declare namespace CodeceptJS {
|
|
|
11793
11886
|
* Get translation
|
|
11794
11887
|
*/
|
|
11795
11888
|
static translation(): void;
|
|
11889
|
+
/**
|
|
11890
|
+
* Get TypeScript file mapping for error stack fixing
|
|
11891
|
+
*/
|
|
11892
|
+
static tsFileMapping(): void;
|
|
11796
11893
|
/**
|
|
11797
11894
|
* Get Mocha instance
|
|
11798
11895
|
*/
|
|
@@ -11865,6 +11962,7 @@ declare namespace CodeceptJS {
|
|
|
11865
11962
|
*/
|
|
11866
11963
|
transpose(): void;
|
|
11867
11964
|
}
|
|
11965
|
+
function within(context: CodeceptJS.LocatorOrString, fn: (...params: any[]) => any): Promise<any> | undefined;
|
|
11868
11966
|
/**
|
|
11869
11967
|
* - Designed for use in CodeceptJS tests as a "soft assertion."
|
|
11870
11968
|
* Unlike standard assertions, it does not stop the test execution on failure.
|
|
@@ -11977,29 +12075,6 @@ declare namespace CodeceptJS {
|
|
|
11977
12075
|
*/
|
|
11978
12076
|
function cleanDispatcher(): void;
|
|
11979
12077
|
}
|
|
11980
|
-
/**
|
|
11981
|
-
* Index file for loading CodeceptJS programmatically.
|
|
11982
|
-
*
|
|
11983
|
-
* Includes Public API objects
|
|
11984
|
-
*/
|
|
11985
|
-
namespace index {
|
|
11986
|
-
var codecept: typeof CodeceptJS.Codecept;
|
|
11987
|
-
var Codecept: typeof CodeceptJS.Codecept;
|
|
11988
|
-
var output: typeof CodeceptJS.output;
|
|
11989
|
-
var container: typeof CodeceptJS.Container;
|
|
11990
|
-
var event: typeof CodeceptJS.event;
|
|
11991
|
-
var recorder: CodeceptJS.recorder;
|
|
11992
|
-
var config: typeof CodeceptJS.Config;
|
|
11993
|
-
var actor: CodeceptJS.actor;
|
|
11994
|
-
var helper: typeof CodeceptJS.Helper;
|
|
11995
|
-
var Helper: typeof CodeceptJS.Helper;
|
|
11996
|
-
var pause: typeof CodeceptJS.pause;
|
|
11997
|
-
var within: typeof CodeceptJS.within;
|
|
11998
|
-
var dataTable: typeof CodeceptJS.DataTable;
|
|
11999
|
-
var dataTableArgument: typeof CodeceptJS.DataTableArgument;
|
|
12000
|
-
var store: typeof CodeceptJS.store;
|
|
12001
|
-
var locator: typeof CodeceptJS.Locator;
|
|
12002
|
-
}
|
|
12003
12078
|
class Locator {
|
|
12004
12079
|
constructor(locator: CodeceptJS.LocatorOrString, defaultType?: string);
|
|
12005
12080
|
toString(): string;
|
|
@@ -12008,6 +12083,7 @@ declare namespace CodeceptJS {
|
|
|
12008
12083
|
isFrame(): boolean;
|
|
12009
12084
|
isCSS(): boolean;
|
|
12010
12085
|
isPlaywrightLocator(): boolean;
|
|
12086
|
+
isRole(): boolean;
|
|
12011
12087
|
isNull(): boolean;
|
|
12012
12088
|
isXPath(): boolean;
|
|
12013
12089
|
isCustom(): boolean;
|
|
@@ -12125,7 +12201,10 @@ declare namespace CodeceptJS {
|
|
|
12125
12201
|
* Print a text in console log
|
|
12126
12202
|
*/
|
|
12127
12203
|
function say(message: string, color?: string): void;
|
|
12128
|
-
|
|
12204
|
+
/**
|
|
12205
|
+
* Prints the stats of a test run to the console.
|
|
12206
|
+
*/
|
|
12207
|
+
function result(passed: number, failed: number, skipped: number, duration: number | string, failedHooks?: number): void;
|
|
12129
12208
|
}
|
|
12130
12209
|
/**
|
|
12131
12210
|
* Pauses test execution and starts interactive shell
|
|
@@ -12416,7 +12495,6 @@ declare namespace CodeceptJS {
|
|
|
12416
12495
|
type ScenarioConfigCallback = (test: CodeceptJS.Test) => {
|
|
12417
12496
|
[key: string]: any;
|
|
12418
12497
|
};
|
|
12419
|
-
function addStep(step: any, fn: any): void;
|
|
12420
12498
|
/**
|
|
12421
12499
|
* Creates a new Hook instance
|
|
12422
12500
|
* @property suite - The test suite this hook belongs to
|
|
@@ -12457,10 +12535,6 @@ declare namespace CodeceptJS {
|
|
|
12457
12535
|
*/
|
|
12458
12536
|
err: Error | null;
|
|
12459
12537
|
}
|
|
12460
|
-
/**
|
|
12461
|
-
* TODO: move to effects
|
|
12462
|
-
*/
|
|
12463
|
-
function within(context: CodeceptJS.LocatorOrString, fn: (...params: any[]) => any): Promise<any> | undefined;
|
|
12464
12538
|
/**
|
|
12465
12539
|
* This is a wrapper on top of [Detox](https://github.com/wix/Detox) library, aimied to unify testing experience for CodeceptJS framework.
|
|
12466
12540
|
* Detox provides a grey box testing for mobile applications, playing especially good for React Native apps.
|
|
@@ -13075,3 +13149,5 @@ declare var helperMethod: string;
|
|
|
13075
13149
|
*/
|
|
13076
13150
|
declare var collsapsed: boolean;
|
|
13077
13151
|
|
|
13152
|
+
declare var currentStepFile: any;
|
|
13153
|
+
|