codeceptjs 4.2.0-beta.3 → 4.2.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/README.md +3 -1
- package/docs/alternative-browsers.md +15 -10
- package/docs/continuous-integration.md +14 -14
- package/docs/helpers/Obscura.md +41 -16
- package/docs/installation.md +35 -0
- package/docs/mcp.md +1 -1
- package/docs/migration-4.md +2 -2
- package/docs/parallel.md +1 -1
- package/lib/helper/Appium.js +23 -0
- package/lib/helper/CDPBrowser.js +84 -0
- package/lib/helper/Obscura.js +25 -2
- package/lib/helper/Playwright.js +55 -4
- package/lib/helper/Puppeteer.js +60 -3
- package/lib/helper/WebDriver.js +43 -0
- package/lib/helper/extras/clipboard.js +31 -0
- package/lib/plugin/retryFailedStep.js +7 -2
- package/package.json +2 -2
- package/typings/promiseBasedTypes.d.ts +248 -2
- package/typings/types.d.ts +261 -2
package/typings/types.d.ts
CHANGED
|
@@ -770,6 +770,36 @@ declare namespace CodeceptJS {
|
|
|
770
770
|
* @returns Appium: support both Android and iOS
|
|
771
771
|
*/
|
|
772
772
|
closeApp(): Promise<void>;
|
|
773
|
+
/**
|
|
774
|
+
* Clears the system clipboard.
|
|
775
|
+
*
|
|
776
|
+
* ```js
|
|
777
|
+
* I.clearClipboard();
|
|
778
|
+
* I.seeClipboardEquals('');
|
|
779
|
+
* ```
|
|
780
|
+
* @returns automatically synchronized promise through #recorder
|
|
781
|
+
*
|
|
782
|
+
*
|
|
783
|
+
* Appium: support both Android and iOS
|
|
784
|
+
*/
|
|
785
|
+
clearClipboard(): void;
|
|
786
|
+
/**
|
|
787
|
+
* Grabs the text content of the system clipboard and returns it to test.
|
|
788
|
+
* Resumes test execution, so **should be used inside async function with `await`** operator.
|
|
789
|
+
*
|
|
790
|
+
* ```js
|
|
791
|
+
* I.click('Copy to clipboard');
|
|
792
|
+
* let url = await I.grabFromClipboard();
|
|
793
|
+
* ```
|
|
794
|
+
*
|
|
795
|
+
* Reading the clipboard requires a secure context (`https` or `localhost`) and is supported
|
|
796
|
+
* in Chromium-based browsers, where read access is granted automatically.
|
|
797
|
+
* @returns the system clipboard contents.
|
|
798
|
+
*
|
|
799
|
+
*
|
|
800
|
+
* Appium: support both Android and iOS
|
|
801
|
+
*/
|
|
802
|
+
grabFromClipboard(): Promise<string>;
|
|
773
803
|
/**
|
|
774
804
|
* Appends text to a input field or textarea.
|
|
775
805
|
* Field is located by name, label, CSS or XPath
|
|
@@ -2193,6 +2223,56 @@ declare namespace CodeceptJS {
|
|
|
2193
2223
|
* @param [name = null] - (optional, `null` by default) cookie name
|
|
2194
2224
|
*/
|
|
2195
2225
|
clearCookie(name?: string | null): Promise<void>;
|
|
2226
|
+
/**
|
|
2227
|
+
* Checks that the system clipboard contains the given text.
|
|
2228
|
+
*
|
|
2229
|
+
* ```js
|
|
2230
|
+
* I.click('Copy to clipboard');
|
|
2231
|
+
* I.seeInClipboard('https://codecept.io');
|
|
2232
|
+
* ```
|
|
2233
|
+
*
|
|
2234
|
+
* Reading the clipboard requires a secure context (`https` or `localhost`).
|
|
2235
|
+
* @param text - value to check.
|
|
2236
|
+
*/
|
|
2237
|
+
seeInClipboard(text: string): Promise<void>;
|
|
2238
|
+
/**
|
|
2239
|
+
* Checks that the system clipboard is equal to the given text.
|
|
2240
|
+
*
|
|
2241
|
+
* ```js
|
|
2242
|
+
* I.click('Copy to clipboard');
|
|
2243
|
+
* I.seeClipboardEquals('https://codecept.io');
|
|
2244
|
+
* ```
|
|
2245
|
+
*
|
|
2246
|
+
* Reading the clipboard requires a secure context (`https` or `localhost`).
|
|
2247
|
+
* @param text - value to check.
|
|
2248
|
+
*/
|
|
2249
|
+
seeClipboardEquals(text: string): Promise<void>;
|
|
2250
|
+
/**
|
|
2251
|
+
* Clears the system clipboard.
|
|
2252
|
+
*
|
|
2253
|
+
* ```js
|
|
2254
|
+
* I.clearClipboard();
|
|
2255
|
+
* I.seeClipboardEquals('');
|
|
2256
|
+
* ```
|
|
2257
|
+
*/
|
|
2258
|
+
clearClipboard(): Promise<void>;
|
|
2259
|
+
/**
|
|
2260
|
+
* Grabs the text content of the system clipboard.
|
|
2261
|
+
* Resumes test execution, so **should be used inside async function with `await`** operator.
|
|
2262
|
+
*
|
|
2263
|
+
* ```js
|
|
2264
|
+
* I.click('Copy to clipboard');
|
|
2265
|
+
* const url = await I.grabFromClipboard();
|
|
2266
|
+
* ```
|
|
2267
|
+
* @returns the system clipboard contents.
|
|
2268
|
+
*/
|
|
2269
|
+
grabFromClipboard(): Promise<string>;
|
|
2270
|
+
/**
|
|
2271
|
+
* Brings the current target to front and grants it clipboard read/write access, so
|
|
2272
|
+
* `navigator.clipboard` does not reject with a permission or focus error. Failures are ignored:
|
|
2273
|
+
* a browser without `Browser.grantPermissions` surfaces its own error from the read instead.
|
|
2274
|
+
*/
|
|
2275
|
+
protected _grantClipboardAccess(): void;
|
|
2196
2276
|
/**
|
|
2197
2277
|
* Saves a screenshot to the output folder (set in codecept.conf.ts or codecept.conf.js).
|
|
2198
2278
|
* Filename is relative to the output folder.
|
|
@@ -3456,6 +3536,17 @@ declare namespace CodeceptJS {
|
|
|
3456
3536
|
* elements works, it only pins the config presets Obscura requires and manages the `obscura serve`
|
|
3457
3537
|
* process lifecycle, the same way Playwright manages its own browser process.
|
|
3458
3538
|
*
|
|
3539
|
+
* > Obscura support is experimental in CodeceptJS 4.2. Pin the browser version in CI and keep a
|
|
3540
|
+
* > Playwright/WebDriver job for browser-compatibility coverage.
|
|
3541
|
+
*
|
|
3542
|
+
* ## Compatibility
|
|
3543
|
+
*
|
|
3544
|
+
* | CodeceptJS | Recommended Obscura | Notes |
|
|
3545
|
+
* | --- | --- | --- |
|
|
3546
|
+
* | 4.2.x | 0.2.2 | Version used by the CodeceptJS Obscura CI workflow |
|
|
3547
|
+
* | 4.2.x | 0.2.x | Supported; capabilities are detected at runtime |
|
|
3548
|
+
* | 4.2.x | 0.1.x / `-no-render` | DOM-only mode; no layout, visibility assertions, or screenshots |
|
|
3549
|
+
*
|
|
3459
3550
|
* ## Modes
|
|
3460
3551
|
*
|
|
3461
3552
|
* - **ATTACH** — `endpoint` is set explicitly in the config. The helper only connects to it; it
|
|
@@ -3473,8 +3564,20 @@ declare namespace CodeceptJS {
|
|
|
3473
3564
|
*
|
|
3474
3565
|
* ## Install
|
|
3475
3566
|
*
|
|
3476
|
-
* Download a release
|
|
3477
|
-
*
|
|
3567
|
+
* Download a release archive from [Obscura releases](https://github.com/h4ckf0r0day/obscura/releases).
|
|
3568
|
+
* CodeceptJS 4.2 is tested with Obscura 0.2.2. Rendering archives are available for:
|
|
3569
|
+
*
|
|
3570
|
+
* | platform | archive |
|
|
3571
|
+
* | --- | --- |
|
|
3572
|
+
* | Linux x64 | `obscura-x86_64-linux.tar.gz` |
|
|
3573
|
+
* | Linux ARM64 | `obscura-aarch64-linux.tar.gz` |
|
|
3574
|
+
* | macOS Intel | `obscura-x86_64-macos.tar.gz` |
|
|
3575
|
+
* | macOS Apple Silicon | `obscura-aarch64-macos.tar.gz` |
|
|
3576
|
+
* | Windows x64 | `obscura-x86_64-windows.zip` |
|
|
3577
|
+
*
|
|
3578
|
+
* Extract the archive and put `obscura` (`obscura.exe` on Windows) on your `PATH`, or point
|
|
3579
|
+
* `binaryPath`/`OBSCURA_PATH` at it. The helper then launches and tears it down automatically.
|
|
3580
|
+
* For example, on Linux x64:
|
|
3478
3581
|
*
|
|
3479
3582
|
* ```sh
|
|
3480
3583
|
* curl -sL https://github.com/h4ckf0r0day/obscura/releases/download/v0.2.2/obscura-x86_64-linux.tar.gz | tar xz
|
|
@@ -5173,6 +5276,58 @@ declare namespace CodeceptJS {
|
|
|
5173
5276
|
* @param [cookie = null] - (optional, `null` by default) cookie name
|
|
5174
5277
|
*/
|
|
5175
5278
|
clearCookie(cookie?: string): void;
|
|
5279
|
+
/**
|
|
5280
|
+
* Checks that the system clipboard contains the given text.
|
|
5281
|
+
*
|
|
5282
|
+
* ```js
|
|
5283
|
+
* I.click('Copy to clipboard');
|
|
5284
|
+
* I.seeInClipboard('https://codecept.io');
|
|
5285
|
+
* ```
|
|
5286
|
+
*
|
|
5287
|
+
* Reading the clipboard requires a secure context (`https` or `localhost`) and is supported
|
|
5288
|
+
* in Chromium-based browsers, where read access is granted automatically.
|
|
5289
|
+
* @param text - value to check.
|
|
5290
|
+
* @returns automatically synchronized promise through #recorder
|
|
5291
|
+
*/
|
|
5292
|
+
seeInClipboard(text: string): void;
|
|
5293
|
+
/**
|
|
5294
|
+
* Checks that the system clipboard is equal to the given text.
|
|
5295
|
+
*
|
|
5296
|
+
* ```js
|
|
5297
|
+
* I.click('Copy to clipboard');
|
|
5298
|
+
* I.seeClipboardEquals('https://codecept.io');
|
|
5299
|
+
* ```
|
|
5300
|
+
*
|
|
5301
|
+
* Reading the clipboard requires a secure context (`https` or `localhost`) and is supported
|
|
5302
|
+
* in Chromium-based browsers, where read access is granted automatically.
|
|
5303
|
+
* @param text - value to check.
|
|
5304
|
+
* @returns automatically synchronized promise through #recorder
|
|
5305
|
+
*/
|
|
5306
|
+
seeClipboardEquals(text: string): void;
|
|
5307
|
+
/**
|
|
5308
|
+
* Grabs the text content of the system clipboard and returns it to test.
|
|
5309
|
+
* Resumes test execution, so **should be used inside async function with `await`** operator.
|
|
5310
|
+
*
|
|
5311
|
+
* ```js
|
|
5312
|
+
* I.click('Copy to clipboard');
|
|
5313
|
+
* let url = await I.grabFromClipboard();
|
|
5314
|
+
* ```
|
|
5315
|
+
*
|
|
5316
|
+
* Reading the clipboard requires a secure context (`https` or `localhost`) and is supported
|
|
5317
|
+
* in Chromium-based browsers, where read access is granted automatically.
|
|
5318
|
+
* @returns the system clipboard contents.
|
|
5319
|
+
*/
|
|
5320
|
+
grabFromClipboard(): Promise<string>;
|
|
5321
|
+
/**
|
|
5322
|
+
* Clears the system clipboard.
|
|
5323
|
+
*
|
|
5324
|
+
* ```js
|
|
5325
|
+
* I.clearClipboard();
|
|
5326
|
+
* I.seeClipboardEquals('');
|
|
5327
|
+
* ```
|
|
5328
|
+
* @returns automatically synchronized promise through #recorder
|
|
5329
|
+
*/
|
|
5330
|
+
clearClipboard(): void;
|
|
5176
5331
|
/**
|
|
5177
5332
|
* Executes a script on the page:
|
|
5178
5333
|
*
|
|
@@ -7343,6 +7498,58 @@ declare namespace CodeceptJS {
|
|
|
7343
7498
|
* @param [cookie = null] - (optional, `null` by default) cookie name
|
|
7344
7499
|
*/
|
|
7345
7500
|
clearCookie(cookie?: string): void;
|
|
7501
|
+
/**
|
|
7502
|
+
* Checks that the system clipboard contains the given text.
|
|
7503
|
+
*
|
|
7504
|
+
* ```js
|
|
7505
|
+
* I.click('Copy to clipboard');
|
|
7506
|
+
* I.seeInClipboard('https://codecept.io');
|
|
7507
|
+
* ```
|
|
7508
|
+
*
|
|
7509
|
+
* Reading the clipboard requires a secure context (`https` or `localhost`) and is supported
|
|
7510
|
+
* in Chromium-based browsers, where read access is granted automatically.
|
|
7511
|
+
* @param text - value to check.
|
|
7512
|
+
* @returns automatically synchronized promise through #recorder
|
|
7513
|
+
*/
|
|
7514
|
+
seeInClipboard(text: string): void;
|
|
7515
|
+
/**
|
|
7516
|
+
* Checks that the system clipboard is equal to the given text.
|
|
7517
|
+
*
|
|
7518
|
+
* ```js
|
|
7519
|
+
* I.click('Copy to clipboard');
|
|
7520
|
+
* I.seeClipboardEquals('https://codecept.io');
|
|
7521
|
+
* ```
|
|
7522
|
+
*
|
|
7523
|
+
* Reading the clipboard requires a secure context (`https` or `localhost`) and is supported
|
|
7524
|
+
* in Chromium-based browsers, where read access is granted automatically.
|
|
7525
|
+
* @param text - value to check.
|
|
7526
|
+
* @returns automatically synchronized promise through #recorder
|
|
7527
|
+
*/
|
|
7528
|
+
seeClipboardEquals(text: string): void;
|
|
7529
|
+
/**
|
|
7530
|
+
* Grabs the text content of the system clipboard and returns it to test.
|
|
7531
|
+
* Resumes test execution, so **should be used inside async function with `await`** operator.
|
|
7532
|
+
*
|
|
7533
|
+
* ```js
|
|
7534
|
+
* I.click('Copy to clipboard');
|
|
7535
|
+
* let url = await I.grabFromClipboard();
|
|
7536
|
+
* ```
|
|
7537
|
+
*
|
|
7538
|
+
* Reading the clipboard requires a secure context (`https` or `localhost`) and is supported
|
|
7539
|
+
* in Chromium-based browsers, where read access is granted automatically.
|
|
7540
|
+
* @returns the system clipboard contents.
|
|
7541
|
+
*/
|
|
7542
|
+
grabFromClipboard(): Promise<string>;
|
|
7543
|
+
/**
|
|
7544
|
+
* Clears the system clipboard.
|
|
7545
|
+
*
|
|
7546
|
+
* ```js
|
|
7547
|
+
* I.clearClipboard();
|
|
7548
|
+
* I.seeClipboardEquals('');
|
|
7549
|
+
* ```
|
|
7550
|
+
* @returns automatically synchronized promise through #recorder
|
|
7551
|
+
*/
|
|
7552
|
+
clearClipboard(): void;
|
|
7346
7553
|
/**
|
|
7347
7554
|
* If a function returns a Promise, tt will wait for its resolution.
|
|
7348
7555
|
*
|
|
@@ -9738,6 +9945,58 @@ declare namespace CodeceptJS {
|
|
|
9738
9945
|
* @returns attribute value
|
|
9739
9946
|
*/
|
|
9740
9947
|
grabCookie(name?: string): any;
|
|
9948
|
+
/**
|
|
9949
|
+
* Checks that the system clipboard contains the given text.
|
|
9950
|
+
*
|
|
9951
|
+
* ```js
|
|
9952
|
+
* I.click('Copy to clipboard');
|
|
9953
|
+
* I.seeInClipboard('https://codecept.io');
|
|
9954
|
+
* ```
|
|
9955
|
+
*
|
|
9956
|
+
* Reading the clipboard requires a secure context (`https` or `localhost`) and is supported
|
|
9957
|
+
* in Chromium-based browsers, where read access is granted automatically.
|
|
9958
|
+
* @param text - value to check.
|
|
9959
|
+
* @returns automatically synchronized promise through #recorder
|
|
9960
|
+
*/
|
|
9961
|
+
seeInClipboard(text: string): void;
|
|
9962
|
+
/**
|
|
9963
|
+
* Checks that the system clipboard is equal to the given text.
|
|
9964
|
+
*
|
|
9965
|
+
* ```js
|
|
9966
|
+
* I.click('Copy to clipboard');
|
|
9967
|
+
* I.seeClipboardEquals('https://codecept.io');
|
|
9968
|
+
* ```
|
|
9969
|
+
*
|
|
9970
|
+
* Reading the clipboard requires a secure context (`https` or `localhost`) and is supported
|
|
9971
|
+
* in Chromium-based browsers, where read access is granted automatically.
|
|
9972
|
+
* @param text - value to check.
|
|
9973
|
+
* @returns automatically synchronized promise through #recorder
|
|
9974
|
+
*/
|
|
9975
|
+
seeClipboardEquals(text: string): void;
|
|
9976
|
+
/**
|
|
9977
|
+
* Grabs the text content of the system clipboard and returns it to test.
|
|
9978
|
+
* Resumes test execution, so **should be used inside async function with `await`** operator.
|
|
9979
|
+
*
|
|
9980
|
+
* ```js
|
|
9981
|
+
* I.click('Copy to clipboard');
|
|
9982
|
+
* let url = await I.grabFromClipboard();
|
|
9983
|
+
* ```
|
|
9984
|
+
*
|
|
9985
|
+
* Reading the clipboard requires a secure context (`https` or `localhost`) and is supported
|
|
9986
|
+
* in Chromium-based browsers, where read access is granted automatically.
|
|
9987
|
+
* @returns the system clipboard contents.
|
|
9988
|
+
*/
|
|
9989
|
+
grabFromClipboard(): Promise<string>;
|
|
9990
|
+
/**
|
|
9991
|
+
* Clears the system clipboard.
|
|
9992
|
+
*
|
|
9993
|
+
* ```js
|
|
9994
|
+
* I.clearClipboard();
|
|
9995
|
+
* I.seeClipboardEquals('');
|
|
9996
|
+
* ```
|
|
9997
|
+
* @returns automatically synchronized promise through #recorder
|
|
9998
|
+
*/
|
|
9999
|
+
clearClipboard(): void;
|
|
9741
10000
|
/**
|
|
9742
10001
|
* Waits for the specified cookie in the cookies.
|
|
9743
10002
|
*
|