testcafe 1.20.2-alpha.1 → 2.0.0-rc.3
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/lib/api/request-hooks/assert-type.js +2 -2
- package/lib/api/request-hooks/hook.js +2 -2
- package/lib/api/request-hooks/request-logger.js +2 -2
- package/lib/api/skip-js-errors/index.js +62 -0
- package/lib/api/structure/base-unit.js +2 -2
- package/lib/api/structure/fixture.js +13 -13
- package/lib/api/structure/test.js +18 -17
- package/lib/api/structure/testing-unit.js +26 -16
- package/lib/api/test-controller/assertion.js +5 -5
- package/lib/api/test-controller/execution-context.js +2 -2
- package/lib/api/test-controller/index.js +33 -30
- package/lib/api/test-controller/proxy.js +2 -2
- package/lib/api/test-page-url.js +4 -4
- package/lib/api/test-run-tracker.js +2 -2
- package/lib/api/wrap-test-function.js +3 -3
- package/lib/assertions/executor.js +4 -4
- package/lib/assertions/get-fn.js +3 -3
- package/lib/browser/connection/gateway.js +18 -18
- package/lib/browser/connection/get-hints.js +8 -8
- package/lib/browser/connection/index.js +11 -11
- package/lib/browser/connection/remotes-queue.js +4 -4
- package/lib/browser/provider/built-in/dedicated/base.js +6 -6
- package/lib/browser/provider/built-in/dedicated/chrome/cdp-client/index.js +10 -10
- package/lib/browser/provider/built-in/dedicated/chrome/config.js +17 -17
- package/lib/browser/provider/built-in/dedicated/chrome/create-temp-profile.js +4 -4
- package/lib/browser/provider/built-in/dedicated/chrome/index.js +6 -6
- package/lib/browser/provider/built-in/dedicated/chrome/local-chrome.js +6 -6
- package/lib/browser/provider/built-in/dedicated/chrome/runtime-info.js +4 -4
- package/lib/browser/provider/built-in/dedicated/edge/runtime-info.js +2 -2
- package/lib/browser/provider/built-in/dedicated/firefox/config.js +8 -8
- package/lib/browser/provider/built-in/dedicated/firefox/create-temp-profile.js +3 -3
- package/lib/browser/provider/built-in/dedicated/firefox/index.js +5 -5
- package/lib/browser/provider/built-in/dedicated/firefox/local-firefox.js +2 -2
- package/lib/browser/provider/built-in/dedicated/firefox/marionette-client/index.js +7 -7
- package/lib/browser/provider/built-in/dedicated/firefox/runtime-info.js +3 -3
- package/lib/browser/provider/built-in/path.js +2 -2
- package/lib/browser/provider/built-in/remote.js +3 -3
- package/lib/browser/provider/index.js +5 -5
- package/lib/browser/provider/plugin-host.js +5 -6
- package/lib/browser/provider/pool.js +4 -4
- package/lib/browser/provider/utils/argument-parsing.js +3 -3
- package/lib/browser/provider/utils/browser-starter.js +2 -2
- package/lib/cli/argument-parser/index.js +52 -41
- package/lib/cli/argument-parser/parse-utils.js +2 -2
- package/lib/cli/authentication-helper.js +3 -3
- package/lib/cli/cli.js +8 -8
- package/lib/cli/correct-browsers-and-sources.js +2 -2
- package/lib/cli/index.js +2 -2
- package/lib/cli/log.js +3 -3
- package/lib/cli/remotes-wizard.js +3 -3
- package/lib/client/automation/index.js +120 -34
- package/lib/client/automation/index.min.js +1 -1
- package/lib/client/browser/idle-page/index.js +321 -317
- package/lib/client/browser/service-worker.js +244 -290
- package/lib/client/core/deps/hammerhead.js +12 -4
- package/lib/client/core/index.js +145 -55
- package/lib/client/core/index.min.js +1 -1
- package/lib/client/core/utils/dom.js +33 -28
- package/lib/client/core/utils/position.js +18 -14
- package/lib/client/core/utils/style.js +8 -4
- package/lib/client/driver/command-executors/client-functions/selector-executor/filter.js +5 -5
- package/lib/client/driver/command-executors/client-functions/selector-executor/utils.js +3 -3
- package/lib/client/driver/deps/hammerhead.js +12 -4
- package/lib/client/driver/deps/testcafe-core.js +12 -4
- package/lib/client/driver/deps/testcafe-ui.js +12 -4
- package/lib/client/driver/index.js +654 -630
- package/lib/client/driver/index.min.js +1 -1
- package/lib/client/driver/status.js +2 -2
- package/lib/client/ui/index.js +10 -8
- package/lib/client/ui/index.min.js +1 -1
- package/lib/client-functions/builder-symbol.js +1 -2
- package/lib/client-functions/client-function-builder.js +12 -12
- package/lib/client-functions/replicator.js +2 -2
- package/lib/client-functions/selector-api-execution-mode.js +2 -2
- package/lib/client-functions/selectors/add-api.js +48 -48
- package/lib/client-functions/selectors/selector-builder.js +17 -17
- package/lib/compiler/compile-client-function.js +6 -6
- package/lib/compiler/index.js +9 -9
- package/lib/compiler/test-file/api-based.js +8 -8
- package/lib/compiler/test-file/base.js +6 -6
- package/lib/compiler/test-file/exportble-lib-path.js +2 -2
- package/lib/compiler/test-file/formats/coffeescript/compiler.js +2 -2
- package/lib/compiler/test-file/formats/coffeescript/get-test-list.js +2 -2
- package/lib/compiler/test-file/formats/es-next/compiler.js +4 -4
- package/lib/compiler/test-file/formats/es-next/get-test-list.js +4 -4
- package/lib/compiler/test-file/formats/raw.js +2 -2
- package/lib/compiler/test-file/formats/typescript/compiler.js +11 -11
- package/lib/compiler/test-file/formats/typescript/get-test-list.js +3 -3
- package/lib/compiler/test-file/test-file-parser-base.js +3 -3
- package/lib/configuration/configuration-base.js +15 -15
- package/lib/configuration/interfaces.js +1 -1
- package/lib/configuration/skip-js-errors-option-names.js +11 -0
- package/lib/configuration/testcafe-configuration.js +21 -16
- package/lib/configuration/types.js +1 -1
- package/lib/configuration/typescript-configuration.js +4 -4
- package/lib/custom-client-scripts/assert-type.js +2 -2
- package/lib/custom-client-scripts/client-script.js +6 -6
- package/lib/custom-client-scripts/get-code.js +2 -2
- package/lib/custom-client-scripts/routing.js +3 -3
- package/lib/custom-client-scripts/utils.js +3 -3
- package/lib/dashboard/connector.js +4 -4
- package/lib/dashboard/get-default-project-link.js +2 -2
- package/lib/dashboard/index.js +26 -26
- package/lib/errors/create-stack-filter.js +2 -2
- package/lib/errors/error-list.js +2 -2
- package/lib/errors/get-callsite.js +2 -2
- package/lib/errors/is-internal-stack-frame.js +5 -5
- package/lib/errors/process-test-fn-error.js +2 -2
- package/lib/errors/runtime/index.js +10 -10
- package/lib/errors/runtime/templates.js +5 -2
- package/lib/errors/runtime/type-assertions.js +6 -6
- package/lib/errors/stack-cleaning-hook.js +2 -2
- package/lib/errors/test-run/formattable-adapter.js +7 -7
- package/lib/errors/test-run/index.js +25 -5
- package/lib/errors/test-run/render-error-template/index.js +6 -6
- package/lib/errors/test-run/render-error-template/utils.js +2 -2
- package/lib/errors/test-run/templates.js +40 -31
- package/lib/errors/test-run/utils.js +7 -7
- package/lib/errors/types.js +5 -1
- package/lib/index.js +1 -1
- package/lib/live/file-watcher/index.js +2 -2
- package/lib/live/keyboard-observer.js +3 -3
- package/lib/live/test-run-controller.js +3 -3
- package/lib/live/test-run.js +3 -2
- package/lib/live/test-runner.js +2 -2
- package/lib/load-assets.js +2 -2
- package/lib/notifications/add-rendered-warning.js +4 -4
- package/lib/notifications/debug-logger.js +6 -6
- package/lib/notifications/deprecated.js +2 -2
- package/lib/notifications/information-message.js +4 -3
- package/lib/proxyless/resource-injector.js +4 -4
- package/lib/reporter/command/command-formatter.js +4 -4
- package/lib/reporter/index.js +10 -10
- package/lib/reporter/plugin-host.js +7 -7
- package/lib/role/index.js +8 -8
- package/lib/role/role.js +2 -2
- package/lib/runner/bootstrapper.js +20 -20
- package/lib/runner/browser-job.js +3 -3
- package/lib/runner/browser-set.js +12 -12
- package/lib/runner/fixture-hook-controller.js +5 -5
- package/lib/runner/index.js +43 -33
- package/lib/runner/task/index.js +10 -6
- package/lib/runner/test-run-hook-controller.js +5 -5
- package/lib/runner/tested-app.js +7 -7
- package/lib/screenshots/capturer.js +17 -17
- package/lib/screenshots/crop.js +8 -8
- package/lib/screenshots/index.js +6 -10
- package/lib/screenshots/utils.js +4 -4
- package/lib/services/compiler/host.js +8 -8
- package/lib/services/compiler/service.js +13 -13
- package/lib/services/compiler/test-run-proxy.js +8 -8
- package/lib/services/serialization/replicator/transforms/callsite-record-transform.js +2 -2
- package/lib/services/serialization/replicator/transforms/command-base-trasform/command-constructors.js +2 -1
- package/lib/services/serialization/replicator/transforms/command-base-trasform/index.js +3 -3
- package/lib/services/serialization/replicator/transforms/raw-command-callsite-record-transform.js +2 -2
- package/lib/services/serialization/test-structure.js +4 -4
- package/lib/services/utils/ipc/interfaces.js +1 -3
- package/lib/services/utils/ipc/io.js +3 -3
- package/lib/services/utils/ipc/message.js +2 -2
- package/lib/services/utils/ipc/proxy.js +4 -4
- package/lib/services/utils/ipc/transport.js +2 -2
- package/lib/shared/errors/index.js +9 -2
- package/lib/shared/errors/selector-error-ctor-callback.js +7 -3
- package/lib/test-run/bookmark.js +1 -1
- package/lib/test-run/browser-manipulation-queue.js +3 -3
- package/lib/test-run/commands/actions.js +66 -46
- package/lib/test-run/commands/assertion.js +3 -3
- package/lib/test-run/commands/base.js +2 -2
- package/lib/test-run/commands/browser-manipulation.js +8 -8
- package/lib/test-run/commands/observation.js +4 -4
- package/lib/test-run/commands/options.js +27 -12
- package/lib/test-run/commands/type.js +2 -1
- package/lib/test-run/commands/utils.js +3 -2
- package/lib/test-run/commands/validations/argument.js +19 -10
- package/lib/test-run/commands/validations/factories.js +10 -2
- package/lib/test-run/commands/validations/initializers.js +4 -4
- package/lib/test-run/debug-log.js +4 -4
- package/lib/test-run/execute-js-expression/index.js +4 -4
- package/lib/test-run/index.js +48 -41
- package/lib/test-run/request/create-request-options.js +9 -9
- package/lib/test-run/request/process-response-data.js +2 -2
- package/lib/test-run/request/send.js +5 -5
- package/lib/testcafe.js +8 -4
- package/lib/utils/check-file-path.js +2 -2
- package/lib/utils/check-url.js +2 -2
- package/lib/utils/correct-file-path.js +4 -4
- package/lib/utils/delegated-api.js +1 -1
- package/lib/utils/detect-ffmpeg.js +3 -3
- package/lib/utils/diff/colors.js +2 -2
- package/lib/utils/diff/index.js +11 -7
- package/lib/utils/diff/util.js +5 -5
- package/lib/utils/diff.js +4 -4
- package/lib/utils/escape-user-agent.js +2 -2
- package/lib/utils/execute-fn-with-timeout.js +2 -2
- package/lib/utils/get-browser.js +2 -2
- package/lib/utils/get-filter-fn.js +4 -4
- package/lib/utils/get-options/base.js +2 -2
- package/lib/utils/get-options/compiler.js +2 -2
- package/lib/utils/get-options/dashboard.js +2 -2
- package/lib/utils/get-options/get-assertion-timeout.js +1 -1
- package/lib/utils/get-options/index.js +4 -2
- package/lib/utils/get-options/meta.js +2 -2
- package/lib/utils/get-options/quarantine.js +8 -6
- package/lib/utils/get-options/screenshot.js +2 -2
- package/lib/utils/get-options/skip-js-errors.js +35 -0
- package/lib/utils/get-options/ssl.js +6 -6
- package/lib/utils/get-options/video.js +2 -2
- package/lib/utils/is-password-input.js +1 -1
- package/lib/utils/log-entry.js +2 -2
- package/lib/utils/make-reg-exp.js +19 -6
- package/lib/utils/moment-loader.js +2 -2
- package/lib/utils/parse-file-list.js +7 -7
- package/lib/utils/path-pattern.js +4 -4
- package/lib/utils/prepare-reporters.js +2 -2
- package/lib/utils/prerender-callsite.js +6 -6
- package/lib/utils/process.js +7 -7
- package/lib/utils/promisified-functions.js +14 -14
- package/lib/utils/raw-command-callsite-record.js +2 -2
- package/lib/utils/resolve-path-relatively-cwd.js +2 -2
- package/lib/utils/string.js +3 -3
- package/lib/utils/temp-directory/cleanup-process/index.js +6 -6
- package/lib/utils/temp-directory/cleanup-process/worker.js +4 -4
- package/lib/utils/temp-directory/index.js +6 -6
- package/lib/utils/temp-directory/lockfile.js +2 -2
- package/lib/video-recorder/process.js +6 -6
- package/lib/video-recorder/recorder.js +9 -9
- package/lib/video-recorder/test-run-video-recorder.js +2 -2
- package/package.json +8 -7
- package/ts-defs/index.d.ts +46 -7
- package/ts-defs/selectors.d.ts +39 -0
- package/ts-defs/testcafe-scripts.d.ts +39 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "testcafe",
|
|
3
3
|
"description": "Automated browser testing for the modern web development stack.",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "2.0.0-rc.3",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Developer Express Inc.",
|
|
8
8
|
"url": "https://www.devexpress.com/"
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"time-limit-promise": "^1.0.2",
|
|
150
150
|
"tmp": "0.0.28",
|
|
151
151
|
"tree-kill": "^1.2.2",
|
|
152
|
-
"typescript": "^
|
|
152
|
+
"typescript": "^4.7.4",
|
|
153
153
|
"unquote": "^1.1.1"
|
|
154
154
|
},
|
|
155
155
|
"devDependencies": {
|
|
@@ -171,8 +171,8 @@
|
|
|
171
171
|
"@types/semver": "^7.3.4",
|
|
172
172
|
"@types/source-map-support": "^0.5.0",
|
|
173
173
|
"@types/useragent": "^2.1.1",
|
|
174
|
-
"@typescript-eslint/eslint-plugin": "
|
|
175
|
-
"@typescript-eslint/parser": "^
|
|
174
|
+
"@typescript-eslint/eslint-plugin": "^5.29.0",
|
|
175
|
+
"@typescript-eslint/parser": "^5.29.0",
|
|
176
176
|
"babel-plugin-add-module-exports": "^0.2.0",
|
|
177
177
|
"basic-auth": "^1.1.0",
|
|
178
178
|
"body-parser": "^1.17.1",
|
|
@@ -185,6 +185,7 @@
|
|
|
185
185
|
"devtools-protocol": "0.0.1030018",
|
|
186
186
|
"dom-walk": "^0.1.1",
|
|
187
187
|
"escape-string-regexp": "^4.0.0",
|
|
188
|
+
"eslint": "^7.13.0",
|
|
188
189
|
"eslint-plugin-hammerhead": "0.4.0",
|
|
189
190
|
"eslint-plugin-no-only-tests": "^2.0.1",
|
|
190
191
|
"express": "^4.13.3",
|
|
@@ -193,7 +194,7 @@
|
|
|
193
194
|
"gulp-babel": "^6.1.1",
|
|
194
195
|
"gulp-clone": "^2.0.1",
|
|
195
196
|
"gulp-data": "^1.3.1",
|
|
196
|
-
"gulp-eslint": "^
|
|
197
|
+
"gulp-eslint": "^6.0.0",
|
|
197
198
|
"gulp-gh-pages": "^0.6.0-6",
|
|
198
199
|
"gulp-git": "^2.4.2",
|
|
199
200
|
"gulp-less": "^4.0.0",
|
|
@@ -222,7 +223,7 @@
|
|
|
222
223
|
"recursive-copy": "^2.0.5",
|
|
223
224
|
"request": "^2.58.0",
|
|
224
225
|
"rollup": "2.16.1",
|
|
225
|
-
"rollup-plugin-typescript2": "^0.
|
|
226
|
+
"rollup-plugin-typescript2": "^0.32.1",
|
|
226
227
|
"run-sequence": "^1.2.2",
|
|
227
228
|
"saucelabs-connector": "^1.0.0",
|
|
228
229
|
"serve-static": "^1.10.0",
|
|
@@ -230,7 +231,7 @@
|
|
|
230
231
|
"stack-chain": "^2.0.0",
|
|
231
232
|
"strip-ansi": "^3.0.0",
|
|
232
233
|
"testcafe-browser-provider-browserstack": "^1.14.0-alpha.1",
|
|
233
|
-
"tslib": "^
|
|
234
|
+
"tslib": "^2.4.0",
|
|
234
235
|
"uglify-js": "~3.10.4"
|
|
235
236
|
}
|
|
236
237
|
}
|
package/ts-defs/index.d.ts
CHANGED
|
@@ -1577,6 +1577,13 @@ declare module 'testcafe' {
|
|
|
1577
1577
|
* @param scripts - Scripts that should be added to the tested pages.
|
|
1578
1578
|
*/
|
|
1579
1579
|
clientScripts (scripts: ClientScript | ClientScript[]): this;
|
|
1580
|
+
|
|
1581
|
+
/**
|
|
1582
|
+
* Customize the behavior of the skipJsErrors method.
|
|
1583
|
+
*
|
|
1584
|
+
* @param options - Error skipping conditions: a Boolean flag, an Object with options, or a callback function that defines custom error skipping logic.
|
|
1585
|
+
*/
|
|
1586
|
+
skipJsErrors (options?: boolean | SkipJsErrorsOptionsObject | SkipJsErrorsCallback | SkipJsErrorsCallbackWithOptionsObject): this;
|
|
1580
1587
|
}
|
|
1581
1588
|
|
|
1582
1589
|
interface TestFn {
|
|
@@ -1663,8 +1670,17 @@ declare module 'testcafe' {
|
|
|
1663
1670
|
*
|
|
1664
1671
|
*/
|
|
1665
1672
|
timeouts(testTimeouts: TestTimeouts): this;
|
|
1673
|
+
|
|
1674
|
+
/**
|
|
1675
|
+
* Customize the behavior of the skipJsErrors method.
|
|
1676
|
+
*
|
|
1677
|
+
* @param options - Error skipping conditions: a Boolean flag, an Object with options, or a callback function that defines custom error skipping logic.
|
|
1678
|
+
*/
|
|
1679
|
+
skipJsErrors (options?: boolean | SkipJsErrorsOptionsObject | SkipJsErrorsCallback | SkipJsErrorsCallbackWithOptionsObject): this;
|
|
1666
1680
|
}
|
|
1667
1681
|
|
|
1682
|
+
// //
|
|
1683
|
+
|
|
1668
1684
|
interface NativeDialogHistoryItem {
|
|
1669
1685
|
/**
|
|
1670
1686
|
* The type of the native dialog.
|
|
@@ -2189,6 +2205,13 @@ declare module 'testcafe' {
|
|
|
2189
2205
|
* @param options - options.
|
|
2190
2206
|
*/
|
|
2191
2207
|
request: Request;
|
|
2208
|
+
|
|
2209
|
+
/**
|
|
2210
|
+
* Customize the behavior of the skipJsErrors method.
|
|
2211
|
+
*
|
|
2212
|
+
* @param options - Error skipping conditions: a Boolean flag, an Object with options, or a callback function that defines custom error skipping logic.
|
|
2213
|
+
*/
|
|
2214
|
+
skipJsErrors (options?: boolean | SkipJsErrorsOptionsObject | SkipJsErrorsCallback | SkipJsErrorsCallbackWithOptionsObject): this;
|
|
2192
2215
|
}
|
|
2193
2216
|
|
|
2194
2217
|
interface TestControllerPromise<T=any> extends TestController, Promise<T> {
|
|
@@ -2359,6 +2382,22 @@ declare module 'testcafe' {
|
|
|
2359
2382
|
patch(urlOpts: RequestUrlOpts, options?: RequestOptions): RequestPromise;
|
|
2360
2383
|
}
|
|
2361
2384
|
|
|
2385
|
+
// // SkipJsErrors API
|
|
2386
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
2387
|
+
|
|
2388
|
+
type SkipJsErrorsCallback = (opts?: {message: string; stack: string; pageUrl: string }) => boolean;
|
|
2389
|
+
|
|
2390
|
+
interface SkipJsErrorsCallbackWithOptionsObject {
|
|
2391
|
+
fn: SkipJsErrorsCallback;
|
|
2392
|
+
dependencies?: { [key: string]: any };
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
interface SkipJsErrorsOptionsObject {
|
|
2396
|
+
message?: string | RegExp;
|
|
2397
|
+
stack?: string | RegExp;
|
|
2398
|
+
pageUrl?: string | RegExp;
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2362
2401
|
type TlsOptions = import('tls').TlsOptions;
|
|
2363
2402
|
|
|
2364
2403
|
interface AppOptions {
|
|
@@ -2547,9 +2586,9 @@ declare module 'testcafe' {
|
|
|
2547
2586
|
|
|
2548
2587
|
interface RunOptions {
|
|
2549
2588
|
/**
|
|
2550
|
-
* Defines
|
|
2589
|
+
* Defines the framework's response to client-side JavaScript errors. If `false` (the default value), tests fail after the website yields a client-side error. If `true`, TestCafe ignores JavaScript errors. Additional options set custom error handling criteria.
|
|
2551
2590
|
*/
|
|
2552
|
-
skipJsErrors: boolean;
|
|
2591
|
+
skipJsErrors: boolean | SkipJsErrorsOptionsObject | SkipJsErrorsCallback | SkipJsErrorsCallbackWithOptionsObject;
|
|
2553
2592
|
/**
|
|
2554
2593
|
* Defines whether to continue running a test after an uncaught error or unhandled promise rejection occurs on the server (`true`), or consider such a test failed (`false`).
|
|
2555
2594
|
*/
|
|
@@ -2734,8 +2773,8 @@ declare module 'testcafe' {
|
|
|
2734
2773
|
* @param pathPattern - The pattern to compose screenshot files' relative path and name.
|
|
2735
2774
|
*/
|
|
2736
2775
|
screenshots(
|
|
2737
|
-
path: ScreenshotsOptions['path'],
|
|
2738
|
-
takeOnFails?: ScreenshotsOptions['takeOnFails'],
|
|
2776
|
+
path: ScreenshotsOptions['path'],
|
|
2777
|
+
takeOnFails?: ScreenshotsOptions['takeOnFails'],
|
|
2739
2778
|
pathPattern?: ScreenshotsOptions['pathPattern']
|
|
2740
2779
|
): this;
|
|
2741
2780
|
|
|
@@ -2757,8 +2796,8 @@ declare module 'testcafe' {
|
|
|
2757
2796
|
* @param encodingOptions - Video encoding options
|
|
2758
2797
|
*/
|
|
2759
2798
|
video(
|
|
2760
|
-
path: VideoConfigOptions['path'],
|
|
2761
|
-
options?: VideoConfigOptions['options'],
|
|
2799
|
+
path: VideoConfigOptions['path'],
|
|
2800
|
+
options?: VideoConfigOptions['options'],
|
|
2762
2801
|
encodingOptions?: VideoConfigOptions['encodingOptions']
|
|
2763
2802
|
): this;
|
|
2764
2803
|
|
|
@@ -2834,7 +2873,7 @@ declare module 'testcafe' {
|
|
|
2834
2873
|
// NOTE: Positional arguments support is left only for backward compatibility.
|
|
2835
2874
|
// It should be removed in future TestCafe versions.
|
|
2836
2875
|
// All new APIs should be enabled trough the configuration object in the upper clause.
|
|
2837
|
-
// Please do not add new APIs here.
|
|
2876
|
+
// Please do not add new APIs here.
|
|
2838
2877
|
(
|
|
2839
2878
|
hostname?: StartOptions['hostname'],
|
|
2840
2879
|
port1?: StartOptions['port1'],
|
package/ts-defs/selectors.d.ts
CHANGED
|
@@ -1575,6 +1575,13 @@ declare module 'testcafe' {
|
|
|
1575
1575
|
* @param scripts - Scripts that should be added to the tested pages.
|
|
1576
1576
|
*/
|
|
1577
1577
|
clientScripts (scripts: ClientScript | ClientScript[]): this;
|
|
1578
|
+
|
|
1579
|
+
/**
|
|
1580
|
+
* Customize the behavior of the skipJsErrors method.
|
|
1581
|
+
*
|
|
1582
|
+
* @param options - Error skipping conditions: a Boolean flag, an Object with options, or a callback function that defines custom error skipping logic.
|
|
1583
|
+
*/
|
|
1584
|
+
skipJsErrors (options?: boolean | SkipJsErrorsOptionsObject | SkipJsErrorsCallback | SkipJsErrorsCallbackWithOptionsObject): this;
|
|
1578
1585
|
}
|
|
1579
1586
|
|
|
1580
1587
|
interface TestFn {
|
|
@@ -1661,8 +1668,17 @@ declare module 'testcafe' {
|
|
|
1661
1668
|
*
|
|
1662
1669
|
*/
|
|
1663
1670
|
timeouts(testTimeouts: TestTimeouts): this;
|
|
1671
|
+
|
|
1672
|
+
/**
|
|
1673
|
+
* Customize the behavior of the skipJsErrors method.
|
|
1674
|
+
*
|
|
1675
|
+
* @param options - Error skipping conditions: a Boolean flag, an Object with options, or a callback function that defines custom error skipping logic.
|
|
1676
|
+
*/
|
|
1677
|
+
skipJsErrors (options?: boolean | SkipJsErrorsOptionsObject | SkipJsErrorsCallback | SkipJsErrorsCallbackWithOptionsObject): this;
|
|
1664
1678
|
}
|
|
1665
1679
|
|
|
1680
|
+
// //
|
|
1681
|
+
|
|
1666
1682
|
interface NativeDialogHistoryItem {
|
|
1667
1683
|
/**
|
|
1668
1684
|
* The type of the native dialog.
|
|
@@ -2187,6 +2203,13 @@ declare module 'testcafe' {
|
|
|
2187
2203
|
* @param options - options.
|
|
2188
2204
|
*/
|
|
2189
2205
|
request: Request;
|
|
2206
|
+
|
|
2207
|
+
/**
|
|
2208
|
+
* Customize the behavior of the skipJsErrors method.
|
|
2209
|
+
*
|
|
2210
|
+
* @param options - Error skipping conditions: a Boolean flag, an Object with options, or a callback function that defines custom error skipping logic.
|
|
2211
|
+
*/
|
|
2212
|
+
skipJsErrors (options?: boolean | SkipJsErrorsOptionsObject | SkipJsErrorsCallback | SkipJsErrorsCallbackWithOptionsObject): this;
|
|
2190
2213
|
}
|
|
2191
2214
|
|
|
2192
2215
|
interface TestControllerPromise<T=any> extends TestController, Promise<T> {
|
|
@@ -2357,6 +2380,22 @@ declare module 'testcafe' {
|
|
|
2357
2380
|
patch(urlOpts: RequestUrlOpts, options?: RequestOptions): RequestPromise;
|
|
2358
2381
|
}
|
|
2359
2382
|
|
|
2383
|
+
// // SkipJsErrors API
|
|
2384
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
2385
|
+
|
|
2386
|
+
type SkipJsErrorsCallback = (opts?: {message: string; stack: string; pageUrl: string }) => boolean;
|
|
2387
|
+
|
|
2388
|
+
interface SkipJsErrorsCallbackWithOptionsObject {
|
|
2389
|
+
fn: SkipJsErrorsCallback;
|
|
2390
|
+
dependencies?: { [key: string]: any };
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
interface SkipJsErrorsOptionsObject {
|
|
2394
|
+
message?: string | RegExp;
|
|
2395
|
+
stack?: string | RegExp;
|
|
2396
|
+
pageUrl?: string | RegExp;
|
|
2397
|
+
}
|
|
2398
|
+
|
|
2360
2399
|
/**
|
|
2361
2400
|
* Creates a selector.
|
|
2362
2401
|
*
|
|
@@ -1575,6 +1575,13 @@ declare module 'testcafe' {
|
|
|
1575
1575
|
* @param scripts - Scripts that should be added to the tested pages.
|
|
1576
1576
|
*/
|
|
1577
1577
|
clientScripts (scripts: ClientScript | ClientScript[]): this;
|
|
1578
|
+
|
|
1579
|
+
/**
|
|
1580
|
+
* Customize the behavior of the skipJsErrors method.
|
|
1581
|
+
*
|
|
1582
|
+
* @param options - Error skipping conditions: a Boolean flag, an Object with options, or a callback function that defines custom error skipping logic.
|
|
1583
|
+
*/
|
|
1584
|
+
skipJsErrors (options?: boolean | SkipJsErrorsOptionsObject | SkipJsErrorsCallback | SkipJsErrorsCallbackWithOptionsObject): this;
|
|
1578
1585
|
}
|
|
1579
1586
|
|
|
1580
1587
|
interface TestFn {
|
|
@@ -1661,8 +1668,17 @@ declare module 'testcafe' {
|
|
|
1661
1668
|
*
|
|
1662
1669
|
*/
|
|
1663
1670
|
timeouts(testTimeouts: TestTimeouts): this;
|
|
1671
|
+
|
|
1672
|
+
/**
|
|
1673
|
+
* Customize the behavior of the skipJsErrors method.
|
|
1674
|
+
*
|
|
1675
|
+
* @param options - Error skipping conditions: a Boolean flag, an Object with options, or a callback function that defines custom error skipping logic.
|
|
1676
|
+
*/
|
|
1677
|
+
skipJsErrors (options?: boolean | SkipJsErrorsOptionsObject | SkipJsErrorsCallback | SkipJsErrorsCallbackWithOptionsObject): this;
|
|
1664
1678
|
}
|
|
1665
1679
|
|
|
1680
|
+
// //
|
|
1681
|
+
|
|
1666
1682
|
interface NativeDialogHistoryItem {
|
|
1667
1683
|
/**
|
|
1668
1684
|
* The type of the native dialog.
|
|
@@ -2187,6 +2203,13 @@ declare module 'testcafe' {
|
|
|
2187
2203
|
* @param options - options.
|
|
2188
2204
|
*/
|
|
2189
2205
|
request: Request;
|
|
2206
|
+
|
|
2207
|
+
/**
|
|
2208
|
+
* Customize the behavior of the skipJsErrors method.
|
|
2209
|
+
*
|
|
2210
|
+
* @param options - Error skipping conditions: a Boolean flag, an Object with options, or a callback function that defines custom error skipping logic.
|
|
2211
|
+
*/
|
|
2212
|
+
skipJsErrors (options?: boolean | SkipJsErrorsOptionsObject | SkipJsErrorsCallback | SkipJsErrorsCallbackWithOptionsObject): this;
|
|
2190
2213
|
}
|
|
2191
2214
|
|
|
2192
2215
|
interface TestControllerPromise<T=any> extends TestController, Promise<T> {
|
|
@@ -2357,6 +2380,22 @@ declare module 'testcafe' {
|
|
|
2357
2380
|
patch(urlOpts: RequestUrlOpts, options?: RequestOptions): RequestPromise;
|
|
2358
2381
|
}
|
|
2359
2382
|
|
|
2383
|
+
// // SkipJsErrors API
|
|
2384
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
2385
|
+
|
|
2386
|
+
type SkipJsErrorsCallback = (opts?: {message: string; stack: string; pageUrl: string }) => boolean;
|
|
2387
|
+
|
|
2388
|
+
interface SkipJsErrorsCallbackWithOptionsObject {
|
|
2389
|
+
fn: SkipJsErrorsCallback;
|
|
2390
|
+
dependencies?: { [key: string]: any };
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
interface SkipJsErrorsOptionsObject {
|
|
2394
|
+
message?: string | RegExp;
|
|
2395
|
+
stack?: string | RegExp;
|
|
2396
|
+
pageUrl?: string | RegExp;
|
|
2397
|
+
}
|
|
2398
|
+
|
|
2360
2399
|
/**
|
|
2361
2400
|
* Creates a selector.
|
|
2362
2401
|
*
|