codeceptjs 3.5.4 → 3.5.5
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 +2887 -0
- package/docs/build/Appium.js +40 -1
- package/docs/build/Nightmare.js +4 -0
- package/docs/build/Playwright.js +15 -8
- package/docs/build/Protractor.js +4 -0
- package/docs/build/Puppeteer.js +17 -6
- package/docs/build/TestCafe.js +2 -0
- package/docs/build/WebDriver.js +4 -0
- package/docs/changelog.md +155 -0
- package/docs/helpers/Appium.md +37 -0
- package/docs/helpers/Nightmare.md +26 -24
- package/docs/helpers/Protractor.md +4 -2
- package/docs/helpers/Puppeteer.md +28 -26
- package/docs/helpers/TestCafe.md +16 -15
- package/docs/helpers/WebDriver.md +31 -29
- package/docs/webapi/executeAsyncScript.mustache +2 -0
- package/docs/webapi/executeScript.mustache +2 -0
- package/lib/codecept.js +1 -0
- package/lib/command/init.js +40 -4
- package/lib/command/run-workers.js +4 -0
- package/lib/command/run.js +6 -0
- package/lib/helper/Appium.js +40 -1
- package/lib/helper/Playwright.js +15 -8
- package/lib/helper/Puppeteer.js +13 -6
- package/lib/pause.js +1 -0
- package/package.json +85 -85
- package/typings/promiseBasedTypes.d.ts +18 -0
- package/typings/types.d.ts +31 -11
package/typings/types.d.ts
CHANGED
|
@@ -2075,12 +2075,14 @@ declare namespace CodeceptJS {
|
|
|
2075
2075
|
* ```
|
|
2076
2076
|
* @param fn - function to be executed in browser context.
|
|
2077
2077
|
* @param args - to be passed to function.
|
|
2078
|
+
* @returns script return value
|
|
2079
|
+
*
|
|
2078
2080
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2079
2081
|
*
|
|
2080
2082
|
*
|
|
2081
2083
|
* Wrapper for synchronous [evaluate](https://github.com/segmentio/nightmare#evaluatefn-arg1-arg2)
|
|
2082
2084
|
*/
|
|
2083
|
-
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]):
|
|
2085
|
+
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
2084
2086
|
/**
|
|
2085
2087
|
* Executes async script on page.
|
|
2086
2088
|
* Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
@@ -2104,13 +2106,15 @@ declare namespace CodeceptJS {
|
|
|
2104
2106
|
* ```
|
|
2105
2107
|
* @param fn - function to be executed in browser context.
|
|
2106
2108
|
* @param args - to be passed to function.
|
|
2109
|
+
* @returns script return value
|
|
2110
|
+
*
|
|
2107
2111
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2108
2112
|
*
|
|
2109
2113
|
*
|
|
2110
2114
|
* Wrapper for asynchronous [evaluate](https://github.com/segmentio/nightmare#evaluatefn-arg1-arg2).
|
|
2111
2115
|
* Unlike NightmareJS implementation calling `done` will return its first argument.
|
|
2112
2116
|
*/
|
|
2113
|
-
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]):
|
|
2117
|
+
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
2114
2118
|
/**
|
|
2115
2119
|
* Resize the current window to provided width and height.
|
|
2116
2120
|
* First parameter can be set to `maximize`.
|
|
@@ -5648,9 +5652,11 @@ declare namespace CodeceptJS {
|
|
|
5648
5652
|
* ```
|
|
5649
5653
|
* @param fn - function to be executed in browser context.
|
|
5650
5654
|
* @param args - to be passed to function.
|
|
5655
|
+
* @returns script return value
|
|
5656
|
+
*
|
|
5651
5657
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
5652
5658
|
*/
|
|
5653
|
-
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]):
|
|
5659
|
+
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
5654
5660
|
/**
|
|
5655
5661
|
* Executes async script on page.
|
|
5656
5662
|
* Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
@@ -5674,9 +5680,11 @@ declare namespace CodeceptJS {
|
|
|
5674
5680
|
* ```
|
|
5675
5681
|
* @param fn - function to be executed in browser context.
|
|
5676
5682
|
* @param args - to be passed to function.
|
|
5683
|
+
* @returns script return value
|
|
5684
|
+
*
|
|
5677
5685
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
5678
5686
|
*/
|
|
5679
|
-
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]):
|
|
5687
|
+
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
5680
5688
|
/**
|
|
5681
5689
|
* Checks that current url contains a provided fragment.
|
|
5682
5690
|
*
|
|
@@ -7446,12 +7454,14 @@ declare namespace CodeceptJS {
|
|
|
7446
7454
|
* ```
|
|
7447
7455
|
* @param fn - function to be executed in browser context.
|
|
7448
7456
|
* @param args - to be passed to function.
|
|
7457
|
+
* @returns script return value
|
|
7458
|
+
*
|
|
7449
7459
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
7450
7460
|
*
|
|
7451
7461
|
*
|
|
7452
7462
|
* If a function returns a Promise It will wait for it resolution.
|
|
7453
7463
|
*/
|
|
7454
|
-
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]):
|
|
7464
|
+
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
7455
7465
|
/**
|
|
7456
7466
|
* Executes async script on page.
|
|
7457
7467
|
* Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
@@ -7475,12 +7485,14 @@ declare namespace CodeceptJS {
|
|
|
7475
7485
|
* ```
|
|
7476
7486
|
* @param fn - function to be executed in browser context.
|
|
7477
7487
|
* @param args - to be passed to function.
|
|
7488
|
+
* @returns script return value
|
|
7489
|
+
*
|
|
7478
7490
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
7479
7491
|
*
|
|
7480
7492
|
*
|
|
7481
7493
|
* Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
|
|
7482
7494
|
*/
|
|
7483
|
-
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]):
|
|
7495
|
+
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
7484
7496
|
/**
|
|
7485
7497
|
* Retrieves all texts from an element located by CSS or XPath and returns it to test.
|
|
7486
7498
|
* Resumes test execution, so **should be used inside async with `await`** operator.
|
|
@@ -8748,12 +8760,14 @@ declare namespace CodeceptJS {
|
|
|
8748
8760
|
* ```
|
|
8749
8761
|
* @param fn - function to be executed in browser context.
|
|
8750
8762
|
* @param args - to be passed to function.
|
|
8763
|
+
* @returns script return value
|
|
8764
|
+
*
|
|
8751
8765
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
8752
8766
|
*
|
|
8753
8767
|
*
|
|
8754
8768
|
* If a function returns a Promise It will wait for its resolution.
|
|
8755
8769
|
*/
|
|
8756
|
-
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]):
|
|
8770
|
+
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
8757
8771
|
/**
|
|
8758
8772
|
* Retrieves all texts from an element located by CSS or XPath and returns it to test.
|
|
8759
8773
|
* Resumes test execution, so **should be used inside async with `await`** operator.
|
|
@@ -10276,13 +10290,15 @@ declare namespace CodeceptJS {
|
|
|
10276
10290
|
* ```
|
|
10277
10291
|
* @param fn - function to be executed in browser context.
|
|
10278
10292
|
* @param args - to be passed to function.
|
|
10293
|
+
* @returns script return value
|
|
10294
|
+
*
|
|
10279
10295
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
10280
10296
|
*
|
|
10281
10297
|
*
|
|
10282
10298
|
*
|
|
10283
10299
|
* Wraps [execute](http://webdriver.io/api/protocol/execute.html) command.
|
|
10284
10300
|
*/
|
|
10285
|
-
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]):
|
|
10301
|
+
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
10286
10302
|
/**
|
|
10287
10303
|
* Executes async script on page.
|
|
10288
10304
|
* Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
@@ -10306,9 +10322,11 @@ declare namespace CodeceptJS {
|
|
|
10306
10322
|
* ```
|
|
10307
10323
|
* @param fn - function to be executed in browser context.
|
|
10308
10324
|
* @param args - to be passed to function.
|
|
10325
|
+
* @returns script return value
|
|
10326
|
+
*
|
|
10309
10327
|
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
10310
10328
|
*/
|
|
10311
|
-
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]):
|
|
10329
|
+
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
10312
10330
|
/**
|
|
10313
10331
|
* Scroll element into viewport.
|
|
10314
10332
|
*
|
|
@@ -11075,7 +11093,7 @@ declare namespace CodeceptJS {
|
|
|
11075
11093
|
/**
|
|
11076
11094
|
* Run a specific test or all loaded tests.
|
|
11077
11095
|
*/
|
|
11078
|
-
run(test?: string): void
|
|
11096
|
+
run(test?: string): Promise<void>;
|
|
11079
11097
|
}
|
|
11080
11098
|
/**
|
|
11081
11099
|
* Current configuration
|
|
@@ -11449,7 +11467,9 @@ declare namespace CodeceptJS {
|
|
|
11449
11467
|
/**
|
|
11450
11468
|
* Pauses test execution and starts interactive shell
|
|
11451
11469
|
*/
|
|
11452
|
-
function pause(
|
|
11470
|
+
function pause(passedObject?: {
|
|
11471
|
+
[key: string]: any;
|
|
11472
|
+
}): void;
|
|
11453
11473
|
/**
|
|
11454
11474
|
* Singleton object to record all test steps as promises and run them in chain.
|
|
11455
11475
|
*/
|