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.
Files changed (231) hide show
  1. package/lib/api/request-hooks/assert-type.js +2 -2
  2. package/lib/api/request-hooks/hook.js +2 -2
  3. package/lib/api/request-hooks/request-logger.js +2 -2
  4. package/lib/api/skip-js-errors/index.js +62 -0
  5. package/lib/api/structure/base-unit.js +2 -2
  6. package/lib/api/structure/fixture.js +13 -13
  7. package/lib/api/structure/test.js +18 -17
  8. package/lib/api/structure/testing-unit.js +26 -16
  9. package/lib/api/test-controller/assertion.js +5 -5
  10. package/lib/api/test-controller/execution-context.js +2 -2
  11. package/lib/api/test-controller/index.js +33 -30
  12. package/lib/api/test-controller/proxy.js +2 -2
  13. package/lib/api/test-page-url.js +4 -4
  14. package/lib/api/test-run-tracker.js +2 -2
  15. package/lib/api/wrap-test-function.js +3 -3
  16. package/lib/assertions/executor.js +4 -4
  17. package/lib/assertions/get-fn.js +3 -3
  18. package/lib/browser/connection/gateway.js +18 -18
  19. package/lib/browser/connection/get-hints.js +8 -8
  20. package/lib/browser/connection/index.js +11 -11
  21. package/lib/browser/connection/remotes-queue.js +4 -4
  22. package/lib/browser/provider/built-in/dedicated/base.js +6 -6
  23. package/lib/browser/provider/built-in/dedicated/chrome/cdp-client/index.js +10 -10
  24. package/lib/browser/provider/built-in/dedicated/chrome/config.js +17 -17
  25. package/lib/browser/provider/built-in/dedicated/chrome/create-temp-profile.js +4 -4
  26. package/lib/browser/provider/built-in/dedicated/chrome/index.js +6 -6
  27. package/lib/browser/provider/built-in/dedicated/chrome/local-chrome.js +6 -6
  28. package/lib/browser/provider/built-in/dedicated/chrome/runtime-info.js +4 -4
  29. package/lib/browser/provider/built-in/dedicated/edge/runtime-info.js +2 -2
  30. package/lib/browser/provider/built-in/dedicated/firefox/config.js +8 -8
  31. package/lib/browser/provider/built-in/dedicated/firefox/create-temp-profile.js +3 -3
  32. package/lib/browser/provider/built-in/dedicated/firefox/index.js +5 -5
  33. package/lib/browser/provider/built-in/dedicated/firefox/local-firefox.js +2 -2
  34. package/lib/browser/provider/built-in/dedicated/firefox/marionette-client/index.js +7 -7
  35. package/lib/browser/provider/built-in/dedicated/firefox/runtime-info.js +3 -3
  36. package/lib/browser/provider/built-in/path.js +2 -2
  37. package/lib/browser/provider/built-in/remote.js +3 -3
  38. package/lib/browser/provider/index.js +5 -5
  39. package/lib/browser/provider/plugin-host.js +5 -6
  40. package/lib/browser/provider/pool.js +4 -4
  41. package/lib/browser/provider/utils/argument-parsing.js +3 -3
  42. package/lib/browser/provider/utils/browser-starter.js +2 -2
  43. package/lib/cli/argument-parser/index.js +52 -41
  44. package/lib/cli/argument-parser/parse-utils.js +2 -2
  45. package/lib/cli/authentication-helper.js +3 -3
  46. package/lib/cli/cli.js +8 -8
  47. package/lib/cli/correct-browsers-and-sources.js +2 -2
  48. package/lib/cli/index.js +2 -2
  49. package/lib/cli/log.js +3 -3
  50. package/lib/cli/remotes-wizard.js +3 -3
  51. package/lib/client/automation/index.js +120 -34
  52. package/lib/client/automation/index.min.js +1 -1
  53. package/lib/client/browser/idle-page/index.js +321 -317
  54. package/lib/client/browser/service-worker.js +244 -290
  55. package/lib/client/core/deps/hammerhead.js +12 -4
  56. package/lib/client/core/index.js +145 -55
  57. package/lib/client/core/index.min.js +1 -1
  58. package/lib/client/core/utils/dom.js +33 -28
  59. package/lib/client/core/utils/position.js +18 -14
  60. package/lib/client/core/utils/style.js +8 -4
  61. package/lib/client/driver/command-executors/client-functions/selector-executor/filter.js +5 -5
  62. package/lib/client/driver/command-executors/client-functions/selector-executor/utils.js +3 -3
  63. package/lib/client/driver/deps/hammerhead.js +12 -4
  64. package/lib/client/driver/deps/testcafe-core.js +12 -4
  65. package/lib/client/driver/deps/testcafe-ui.js +12 -4
  66. package/lib/client/driver/index.js +654 -630
  67. package/lib/client/driver/index.min.js +1 -1
  68. package/lib/client/driver/status.js +2 -2
  69. package/lib/client/ui/index.js +10 -8
  70. package/lib/client/ui/index.min.js +1 -1
  71. package/lib/client-functions/builder-symbol.js +1 -2
  72. package/lib/client-functions/client-function-builder.js +12 -12
  73. package/lib/client-functions/replicator.js +2 -2
  74. package/lib/client-functions/selector-api-execution-mode.js +2 -2
  75. package/lib/client-functions/selectors/add-api.js +48 -48
  76. package/lib/client-functions/selectors/selector-builder.js +17 -17
  77. package/lib/compiler/compile-client-function.js +6 -6
  78. package/lib/compiler/index.js +9 -9
  79. package/lib/compiler/test-file/api-based.js +8 -8
  80. package/lib/compiler/test-file/base.js +6 -6
  81. package/lib/compiler/test-file/exportble-lib-path.js +2 -2
  82. package/lib/compiler/test-file/formats/coffeescript/compiler.js +2 -2
  83. package/lib/compiler/test-file/formats/coffeescript/get-test-list.js +2 -2
  84. package/lib/compiler/test-file/formats/es-next/compiler.js +4 -4
  85. package/lib/compiler/test-file/formats/es-next/get-test-list.js +4 -4
  86. package/lib/compiler/test-file/formats/raw.js +2 -2
  87. package/lib/compiler/test-file/formats/typescript/compiler.js +11 -11
  88. package/lib/compiler/test-file/formats/typescript/get-test-list.js +3 -3
  89. package/lib/compiler/test-file/test-file-parser-base.js +3 -3
  90. package/lib/configuration/configuration-base.js +15 -15
  91. package/lib/configuration/interfaces.js +1 -1
  92. package/lib/configuration/skip-js-errors-option-names.js +11 -0
  93. package/lib/configuration/testcafe-configuration.js +21 -16
  94. package/lib/configuration/types.js +1 -1
  95. package/lib/configuration/typescript-configuration.js +4 -4
  96. package/lib/custom-client-scripts/assert-type.js +2 -2
  97. package/lib/custom-client-scripts/client-script.js +6 -6
  98. package/lib/custom-client-scripts/get-code.js +2 -2
  99. package/lib/custom-client-scripts/routing.js +3 -3
  100. package/lib/custom-client-scripts/utils.js +3 -3
  101. package/lib/dashboard/connector.js +4 -4
  102. package/lib/dashboard/get-default-project-link.js +2 -2
  103. package/lib/dashboard/index.js +26 -26
  104. package/lib/errors/create-stack-filter.js +2 -2
  105. package/lib/errors/error-list.js +2 -2
  106. package/lib/errors/get-callsite.js +2 -2
  107. package/lib/errors/is-internal-stack-frame.js +5 -5
  108. package/lib/errors/process-test-fn-error.js +2 -2
  109. package/lib/errors/runtime/index.js +10 -10
  110. package/lib/errors/runtime/templates.js +5 -2
  111. package/lib/errors/runtime/type-assertions.js +6 -6
  112. package/lib/errors/stack-cleaning-hook.js +2 -2
  113. package/lib/errors/test-run/formattable-adapter.js +7 -7
  114. package/lib/errors/test-run/index.js +25 -5
  115. package/lib/errors/test-run/render-error-template/index.js +6 -6
  116. package/lib/errors/test-run/render-error-template/utils.js +2 -2
  117. package/lib/errors/test-run/templates.js +40 -31
  118. package/lib/errors/test-run/utils.js +7 -7
  119. package/lib/errors/types.js +5 -1
  120. package/lib/index.js +1 -1
  121. package/lib/live/file-watcher/index.js +2 -2
  122. package/lib/live/keyboard-observer.js +3 -3
  123. package/lib/live/test-run-controller.js +3 -3
  124. package/lib/live/test-run.js +3 -2
  125. package/lib/live/test-runner.js +2 -2
  126. package/lib/load-assets.js +2 -2
  127. package/lib/notifications/add-rendered-warning.js +4 -4
  128. package/lib/notifications/debug-logger.js +6 -6
  129. package/lib/notifications/deprecated.js +2 -2
  130. package/lib/notifications/information-message.js +4 -3
  131. package/lib/proxyless/resource-injector.js +4 -4
  132. package/lib/reporter/command/command-formatter.js +4 -4
  133. package/lib/reporter/index.js +10 -10
  134. package/lib/reporter/plugin-host.js +7 -7
  135. package/lib/role/index.js +8 -8
  136. package/lib/role/role.js +2 -2
  137. package/lib/runner/bootstrapper.js +20 -20
  138. package/lib/runner/browser-job.js +3 -3
  139. package/lib/runner/browser-set.js +12 -12
  140. package/lib/runner/fixture-hook-controller.js +5 -5
  141. package/lib/runner/index.js +43 -33
  142. package/lib/runner/task/index.js +10 -6
  143. package/lib/runner/test-run-hook-controller.js +5 -5
  144. package/lib/runner/tested-app.js +7 -7
  145. package/lib/screenshots/capturer.js +17 -17
  146. package/lib/screenshots/crop.js +8 -8
  147. package/lib/screenshots/index.js +6 -10
  148. package/lib/screenshots/utils.js +4 -4
  149. package/lib/services/compiler/host.js +8 -8
  150. package/lib/services/compiler/service.js +13 -13
  151. package/lib/services/compiler/test-run-proxy.js +8 -8
  152. package/lib/services/serialization/replicator/transforms/callsite-record-transform.js +2 -2
  153. package/lib/services/serialization/replicator/transforms/command-base-trasform/command-constructors.js +2 -1
  154. package/lib/services/serialization/replicator/transforms/command-base-trasform/index.js +3 -3
  155. package/lib/services/serialization/replicator/transforms/raw-command-callsite-record-transform.js +2 -2
  156. package/lib/services/serialization/test-structure.js +4 -4
  157. package/lib/services/utils/ipc/interfaces.js +1 -3
  158. package/lib/services/utils/ipc/io.js +3 -3
  159. package/lib/services/utils/ipc/message.js +2 -2
  160. package/lib/services/utils/ipc/proxy.js +4 -4
  161. package/lib/services/utils/ipc/transport.js +2 -2
  162. package/lib/shared/errors/index.js +9 -2
  163. package/lib/shared/errors/selector-error-ctor-callback.js +7 -3
  164. package/lib/test-run/bookmark.js +1 -1
  165. package/lib/test-run/browser-manipulation-queue.js +3 -3
  166. package/lib/test-run/commands/actions.js +66 -46
  167. package/lib/test-run/commands/assertion.js +3 -3
  168. package/lib/test-run/commands/base.js +2 -2
  169. package/lib/test-run/commands/browser-manipulation.js +8 -8
  170. package/lib/test-run/commands/observation.js +4 -4
  171. package/lib/test-run/commands/options.js +27 -12
  172. package/lib/test-run/commands/type.js +2 -1
  173. package/lib/test-run/commands/utils.js +3 -2
  174. package/lib/test-run/commands/validations/argument.js +19 -10
  175. package/lib/test-run/commands/validations/factories.js +10 -2
  176. package/lib/test-run/commands/validations/initializers.js +4 -4
  177. package/lib/test-run/debug-log.js +4 -4
  178. package/lib/test-run/execute-js-expression/index.js +4 -4
  179. package/lib/test-run/index.js +48 -41
  180. package/lib/test-run/request/create-request-options.js +9 -9
  181. package/lib/test-run/request/process-response-data.js +2 -2
  182. package/lib/test-run/request/send.js +5 -5
  183. package/lib/testcafe.js +8 -4
  184. package/lib/utils/check-file-path.js +2 -2
  185. package/lib/utils/check-url.js +2 -2
  186. package/lib/utils/correct-file-path.js +4 -4
  187. package/lib/utils/delegated-api.js +1 -1
  188. package/lib/utils/detect-ffmpeg.js +3 -3
  189. package/lib/utils/diff/colors.js +2 -2
  190. package/lib/utils/diff/index.js +11 -7
  191. package/lib/utils/diff/util.js +5 -5
  192. package/lib/utils/diff.js +4 -4
  193. package/lib/utils/escape-user-agent.js +2 -2
  194. package/lib/utils/execute-fn-with-timeout.js +2 -2
  195. package/lib/utils/get-browser.js +2 -2
  196. package/lib/utils/get-filter-fn.js +4 -4
  197. package/lib/utils/get-options/base.js +2 -2
  198. package/lib/utils/get-options/compiler.js +2 -2
  199. package/lib/utils/get-options/dashboard.js +2 -2
  200. package/lib/utils/get-options/get-assertion-timeout.js +1 -1
  201. package/lib/utils/get-options/index.js +4 -2
  202. package/lib/utils/get-options/meta.js +2 -2
  203. package/lib/utils/get-options/quarantine.js +8 -6
  204. package/lib/utils/get-options/screenshot.js +2 -2
  205. package/lib/utils/get-options/skip-js-errors.js +35 -0
  206. package/lib/utils/get-options/ssl.js +6 -6
  207. package/lib/utils/get-options/video.js +2 -2
  208. package/lib/utils/is-password-input.js +1 -1
  209. package/lib/utils/log-entry.js +2 -2
  210. package/lib/utils/make-reg-exp.js +19 -6
  211. package/lib/utils/moment-loader.js +2 -2
  212. package/lib/utils/parse-file-list.js +7 -7
  213. package/lib/utils/path-pattern.js +4 -4
  214. package/lib/utils/prepare-reporters.js +2 -2
  215. package/lib/utils/prerender-callsite.js +6 -6
  216. package/lib/utils/process.js +7 -7
  217. package/lib/utils/promisified-functions.js +14 -14
  218. package/lib/utils/raw-command-callsite-record.js +2 -2
  219. package/lib/utils/resolve-path-relatively-cwd.js +2 -2
  220. package/lib/utils/string.js +3 -3
  221. package/lib/utils/temp-directory/cleanup-process/index.js +6 -6
  222. package/lib/utils/temp-directory/cleanup-process/worker.js +4 -4
  223. package/lib/utils/temp-directory/index.js +6 -6
  224. package/lib/utils/temp-directory/lockfile.js +2 -2
  225. package/lib/video-recorder/process.js +6 -6
  226. package/lib/video-recorder/recorder.js +9 -9
  227. package/lib/video-recorder/test-run-video-recorder.js +2 -2
  228. package/package.json +8 -7
  229. package/ts-defs/index.d.ts +46 -7
  230. package/ts-defs/selectors.d.ts +39 -0
  231. 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": "1.20.2-alpha.1",
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": "^3.3.3",
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": "2.0.0",
175
- "@typescript-eslint/parser": "^2.0.0",
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": "^5.0.0",
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.26.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": "^1.11.1",
234
+ "tslib": "^2.4.0",
234
235
  "uglify-js": "~3.10.4"
235
236
  }
236
237
  }
@@ -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 whether to continue running a test after a JavaScript error occurs on a page (`true`), or consider such a test failed (`false`).
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'],
@@ -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
  *