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/lib/client/core/index.js
CHANGED
|
@@ -108,7 +108,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
108
108
|
44: 188,
|
|
109
109
|
45: browserUtils.isFirefox ? 173 : 189,
|
|
110
110
|
46: 190,
|
|
111
|
-
47: 191,
|
|
111
|
+
47: 191, // /
|
|
112
112
|
},
|
|
113
113
|
symbolKeysCharCodes: {
|
|
114
114
|
109: 45,
|
|
@@ -226,12 +226,12 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
226
226
|
return RequestBarrier;
|
|
227
227
|
}());
|
|
228
228
|
|
|
229
|
-
|
|
229
|
+
/******************************************************************************
|
|
230
230
|
Copyright (c) Microsoft Corporation.
|
|
231
|
-
|
|
231
|
+
|
|
232
232
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
233
233
|
purpose with or without fee is hereby granted.
|
|
234
|
-
|
|
234
|
+
|
|
235
235
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
236
236
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
237
237
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
@@ -241,24 +241,26 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
241
241
|
PERFORMANCE OF THIS SOFTWARE.
|
|
242
242
|
***************************************************************************** */
|
|
243
243
|
/* global Reflect, Promise */
|
|
244
|
-
|
|
245
|
-
var extendStatics = function(d, b) {
|
|
244
|
+
var extendStatics = function (d, b) {
|
|
246
245
|
extendStatics = Object.setPrototypeOf ||
|
|
247
246
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
248
|
-
function (d, b) { for (var p in b)
|
|
247
|
+
function (d, b) { for (var p in b)
|
|
248
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
249
|
+
d[p] = b[p]; };
|
|
249
250
|
return extendStatics(d, b);
|
|
250
251
|
};
|
|
251
|
-
|
|
252
252
|
function __extends(d, b) {
|
|
253
|
+
if (typeof b !== "function" && b !== null)
|
|
254
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
253
255
|
extendStatics(d, b);
|
|
254
256
|
function __() { this.constructor = d; }
|
|
255
257
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
256
258
|
}
|
|
257
|
-
|
|
258
259
|
function __rest(s, e) {
|
|
259
260
|
var t = {};
|
|
260
|
-
for (var p in s)
|
|
261
|
-
|
|
261
|
+
for (var p in s)
|
|
262
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
263
|
+
t[p] = s[p];
|
|
262
264
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
263
265
|
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
264
266
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
@@ -266,51 +268,104 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
266
268
|
}
|
|
267
269
|
return t;
|
|
268
270
|
}
|
|
269
|
-
|
|
270
271
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
271
272
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
272
273
|
return new (P || (P = Promise$5))(function (resolve, reject) {
|
|
273
|
-
function fulfilled(value) { try {
|
|
274
|
-
|
|
274
|
+
function fulfilled(value) { try {
|
|
275
|
+
step(generator.next(value));
|
|
276
|
+
}
|
|
277
|
+
catch (e) {
|
|
278
|
+
reject(e);
|
|
279
|
+
} }
|
|
280
|
+
function rejected(value) { try {
|
|
281
|
+
step(generator["throw"](value));
|
|
282
|
+
}
|
|
283
|
+
catch (e) {
|
|
284
|
+
reject(e);
|
|
285
|
+
} }
|
|
275
286
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
276
287
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
277
288
|
});
|
|
278
289
|
}
|
|
279
|
-
|
|
280
290
|
function __generator(thisArg, body) {
|
|
281
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1)
|
|
282
|
-
|
|
291
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
292
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
293
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
283
294
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
284
295
|
function step(op) {
|
|
285
|
-
if (f)
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
296
|
+
if (f)
|
|
297
|
+
throw new TypeError("Generator is already executing.");
|
|
298
|
+
while (_)
|
|
299
|
+
try {
|
|
300
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
301
|
+
return t;
|
|
302
|
+
if (y = 0, t)
|
|
303
|
+
op = [op[0] & 2, t.value];
|
|
304
|
+
switch (op[0]) {
|
|
305
|
+
case 0:
|
|
306
|
+
case 1:
|
|
307
|
+
t = op;
|
|
308
|
+
break;
|
|
309
|
+
case 4:
|
|
310
|
+
_.label++;
|
|
311
|
+
return { value: op[1], done: false };
|
|
312
|
+
case 5:
|
|
313
|
+
_.label++;
|
|
314
|
+
y = op[1];
|
|
315
|
+
op = [0];
|
|
316
|
+
continue;
|
|
317
|
+
case 7:
|
|
318
|
+
op = _.ops.pop();
|
|
319
|
+
_.trys.pop();
|
|
320
|
+
continue;
|
|
321
|
+
default:
|
|
322
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
323
|
+
_ = 0;
|
|
324
|
+
continue;
|
|
325
|
+
}
|
|
326
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
327
|
+
_.label = op[1];
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
331
|
+
_.label = t[1];
|
|
332
|
+
t = op;
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
335
|
+
if (t && _.label < t[2]) {
|
|
336
|
+
_.label = t[2];
|
|
337
|
+
_.ops.push(op);
|
|
338
|
+
break;
|
|
339
|
+
}
|
|
340
|
+
if (t[2])
|
|
341
|
+
_.ops.pop();
|
|
342
|
+
_.trys.pop();
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
345
|
+
op = body.call(thisArg, _);
|
|
346
|
+
}
|
|
347
|
+
catch (e) {
|
|
348
|
+
op = [6, e];
|
|
349
|
+
y = 0;
|
|
301
350
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
351
|
+
finally {
|
|
352
|
+
f = t = 0;
|
|
353
|
+
}
|
|
354
|
+
if (op[0] & 5)
|
|
355
|
+
throw op[1];
|
|
356
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
function __spreadArray(to, from, pack) {
|
|
360
|
+
if (pack || arguments.length === 2)
|
|
361
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
362
|
+
if (ar || !(i in from)) {
|
|
363
|
+
if (!ar)
|
|
364
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
365
|
+
ar[i] = from[i];
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
314
369
|
}
|
|
315
370
|
|
|
316
371
|
// @ts-ignore
|
|
@@ -564,7 +619,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
564
619
|
args[_i - 1] = arguments[_i];
|
|
565
620
|
}
|
|
566
621
|
if (hammerhead.nativeMethods.arrayFrom)
|
|
567
|
-
return hammerhead.nativeMethods.arrayFrom.apply(hammerhead.nativeMethods,
|
|
622
|
+
return hammerhead.nativeMethods.arrayFrom.apply(hammerhead.nativeMethods, __spreadArray([arg], args, false));
|
|
568
623
|
// NOTE: this logic is for IE
|
|
569
624
|
var arr = [];
|
|
570
625
|
var length = arg.length;
|
|
@@ -884,7 +939,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
884
939
|
res.push('<');
|
|
885
940
|
res.push(getTagName(el));
|
|
886
941
|
for (var attr in attributes) {
|
|
887
|
-
if (attributes.hasOwnProperty(attr)) {
|
|
942
|
+
if (attributes.hasOwnProperty(attr)) { //eslint-disable-line no-prototype-builtins
|
|
888
943
|
var val = el[attributes[attr]];
|
|
889
944
|
if (val)
|
|
890
945
|
res.push(' ' + attr + '="' + val + '"');
|
|
@@ -1252,7 +1307,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
1252
1307
|
// NOTE: we use a flag to confirm file download because if unload
|
|
1253
1308
|
// is raised the browser can respond with an empty string
|
|
1254
1309
|
if (!fileDownloadingHandled)
|
|
1255
|
-
return new Promise$2(function () { });
|
|
1310
|
+
return new Promise$2(function () { }); // eslint-disable-line @typescript-eslint/no-empty-function
|
|
1256
1311
|
});
|
|
1257
1312
|
}
|
|
1258
1313
|
// API
|
|
@@ -3195,6 +3250,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
3195
3250
|
requestRuntimeError: 'E1073',
|
|
3196
3251
|
requestCannotResolveTestRun: 'E1074',
|
|
3197
3252
|
relativeBaseUrl: 'E1075',
|
|
3253
|
+
invalidSkipJsErrorsOption: 'E1076',
|
|
3198
3254
|
};
|
|
3199
3255
|
|
|
3200
3256
|
var BrowserConnectionErrorHint;
|
|
@@ -3205,6 +3261,39 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
3205
3261
|
})(BrowserConnectionErrorHint || (BrowserConnectionErrorHint = {}));
|
|
3206
3262
|
var BrowserConnectionErrorHint$1 = BrowserConnectionErrorHint;
|
|
3207
3263
|
|
|
3264
|
+
var DEFAULT_CONCATENATED_VALUES = {
|
|
3265
|
+
SEPARATOR: ', ',
|
|
3266
|
+
QUOTE_CHAR: '"',
|
|
3267
|
+
};
|
|
3268
|
+
function getDisplayedItemText(item, quote) {
|
|
3269
|
+
return "".concat(quote).concat(item).concat(quote);
|
|
3270
|
+
}
|
|
3271
|
+
function getConcatenatedValuesString(array, separator, quoteChar) {
|
|
3272
|
+
if (separator === void 0) { separator = DEFAULT_CONCATENATED_VALUES.SEPARATOR; }
|
|
3273
|
+
if (quoteChar === void 0) { quoteChar = DEFAULT_CONCATENATED_VALUES.QUOTE_CHAR; }
|
|
3274
|
+
var clonedArray = __spreadArray([], array, true);
|
|
3275
|
+
if (separator === '\n')
|
|
3276
|
+
return clonedArray.map(function (item) { return getDisplayedItemText(item, quoteChar); }).join(separator);
|
|
3277
|
+
else if (clonedArray.length === 1)
|
|
3278
|
+
return getDisplayedItemText(clonedArray[0], quoteChar);
|
|
3279
|
+
else if (clonedArray.length === 2) {
|
|
3280
|
+
var item1 = array[0];
|
|
3281
|
+
var item2 = array[1];
|
|
3282
|
+
return "".concat(getDisplayedItemText(item1, quoteChar), " and ").concat(getDisplayedItemText(item2, quoteChar));
|
|
3283
|
+
}
|
|
3284
|
+
var lastItem = clonedArray.pop();
|
|
3285
|
+
var otherItemString = clonedArray.map(function (item) { return getDisplayedItemText(item, quoteChar); }).join(separator);
|
|
3286
|
+
return "".concat(otherItemString, ", and ").concat(getDisplayedItemText(lastItem, quoteChar));
|
|
3287
|
+
}
|
|
3288
|
+
|
|
3289
|
+
var SKIP_JS_ERRORS_OPTION_NAMES;
|
|
3290
|
+
(function (SKIP_JS_ERRORS_OPTION_NAMES) {
|
|
3291
|
+
SKIP_JS_ERRORS_OPTION_NAMES["message"] = "message";
|
|
3292
|
+
SKIP_JS_ERRORS_OPTION_NAMES["stack"] = "stack";
|
|
3293
|
+
SKIP_JS_ERRORS_OPTION_NAMES["pageUrl"] = "pageUrl";
|
|
3294
|
+
})(SKIP_JS_ERRORS_OPTION_NAMES || (SKIP_JS_ERRORS_OPTION_NAMES = {}));
|
|
3295
|
+
var SKIP_JS_ERRORS_OPTION_NAMES$1 = SKIP_JS_ERRORS_OPTION_NAMES;
|
|
3296
|
+
|
|
3208
3297
|
// -------------------------------------------------------------
|
|
3209
3298
|
// WARNING: this file is used by both the client and the server.
|
|
3210
3299
|
// Do not use any browser or node-specific API!
|
|
@@ -3229,10 +3318,10 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
3229
3318
|
'Check patterns for errors:\n\n' +
|
|
3230
3319
|
'{sourceList}\n\n' +
|
|
3231
3320
|
'or launch TestCafe from a different directory.\n' +
|
|
3232
|
-
|
|
3321
|
+
"For more information on how to specify test locations, see ".concat(DOCUMENTATION_LINKS.TEST_SOURCE_PARAMETER, "."),
|
|
3233
3322
|
_a[RUNTIME_ERRORS.noTestsToRun] = "Source files do not contain valid 'fixture' and 'test' declarations.",
|
|
3234
3323
|
_a[RUNTIME_ERRORS.noTestsToRunDueFiltering] = 'No tests match your filter.\n' +
|
|
3235
|
-
|
|
3324
|
+
"See ".concat(DOCUMENTATION_LINKS.FILTER_SETTINGS, "."),
|
|
3236
3325
|
_a[RUNTIME_ERRORS.cannotFindReporterForAlias] = 'The "{name}" reporter does not exist. Check the reporter parameter for errors.',
|
|
3237
3326
|
_a[RUNTIME_ERRORS.multipleSameStreamReporters] = 'Reporters cannot share output streams. The following reporters interfere with one another: "{reporters}".',
|
|
3238
3327
|
_a[RUNTIME_ERRORS.optionValueIsNotValidRegExp] = 'The "{optionName}" option does not contain a valid regular expression.',
|
|
@@ -3303,7 +3392,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
3303
3392
|
'You can launch the browser in headless mode. ' +
|
|
3304
3393
|
'If you use a portable browser executable, ' +
|
|
3305
3394
|
"specify the browser alias before the path instead of the 'path' prefix. " +
|
|
3306
|
-
|
|
3395
|
+
"For more information, see ".concat(DOCUMENTATION_LINKS.HEADLESS_MODE),
|
|
3307
3396
|
_a[RUNTIME_ERRORS.uncaughtErrorInReporter] = 'The "{methodName}" method of the "{reporterName}" reporter produced an uncaught error. Error details:\n{originalError}',
|
|
3308
3397
|
_a[RUNTIME_ERRORS.roleInitializedWithRelativeUrl] = 'You cannot specify relative login page URLs in the Role constructor. Use an absolute URL.',
|
|
3309
3398
|
_a[RUNTIME_ERRORS.typeScriptCompilerLoadingError] = 'Cannot load the TypeScript compiler.\n{originErrorMessage}.',
|
|
@@ -3320,7 +3409,8 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
3320
3409
|
_a[RUNTIME_ERRORS.dashboardTokenInJSON] = 'Insecure token declaration: cannot declare a Dashboard token in a JSON configuration file. Use a JavaScript configuration file, or declare a Dashboard token with one of the following: the CLI, the Test Runner API, the TESTCAFE_DASHBOARD_TOKEN environment variable.',
|
|
3321
3410
|
_a[RUNTIME_ERRORS.relativeBaseUrl] = 'The value of the baseUrl argument cannot be relative: "{baseUrl}"',
|
|
3322
3411
|
_a[RUNTIME_ERRORS.requestUrlInvalidValueError] = 'Requested url isn\'t valid ({actualValue}).',
|
|
3323
|
-
_a[RUNTIME_ERRORS.requestRuntimeError] = '
|
|
3412
|
+
_a[RUNTIME_ERRORS.requestRuntimeError] = 'The request was interrupted by an error:\n{message}',
|
|
3413
|
+
_a[RUNTIME_ERRORS.invalidSkipJsErrorsOption] = "The \"{optionName}\" option does not exist. Use the following options to configure skipJsErrors: ".concat(getConcatenatedValuesString(Object.keys(SKIP_JS_ERRORS_OPTION_NAMES$1))),
|
|
3324
3414
|
_a);
|
|
3325
3415
|
|
|
3326
3416
|
var timeLimitedPromiseTimeoutExpiredTemplate = TEMPLATES[RUNTIME_ERRORS.timeLimitedPromiseTimeoutExpired];
|
|
@@ -3569,7 +3659,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
3569
3659
|
if (!(i < MAX_STATUS_RETRY)) return [3 /*break*/, 5];
|
|
3570
3660
|
return [4 /*yield*/, tryGetStatus.apply(void 0, args)];
|
|
3571
3661
|
case 2:
|
|
3572
|
-
(_a = _b.sent(),
|
|
3662
|
+
(_a = _b.sent(), error = _a.error, result = __rest(_a, ["error"]));
|
|
3573
3663
|
if (!error)
|
|
3574
3664
|
return [2 /*return*/, result];
|
|
3575
3665
|
return [4 /*yield*/, delay$1(STATUS_RETRY_DELAY)];
|
|
@@ -3618,13 +3708,13 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
3618
3708
|
function setActiveWindowId(activeWindowIdUrl, createXHR, windowId) {
|
|
3619
3709
|
return sendXHR(activeWindowIdUrl, createXHR, {
|
|
3620
3710
|
method: 'POST',
|
|
3621
|
-
data: JSON.stringify({ windowId: windowId }),
|
|
3711
|
+
data: JSON.stringify({ windowId: windowId }), //eslint-disable-line no-restricted-globals
|
|
3622
3712
|
});
|
|
3623
3713
|
}
|
|
3624
3714
|
function closeWindow(closeWindowUrl, createXHR, windowId) {
|
|
3625
3715
|
return sendXHR(closeWindowUrl, createXHR, {
|
|
3626
3716
|
method: 'POST',
|
|
3627
|
-
data: JSON.stringify({ windowId: windowId }),
|
|
3717
|
+
data: JSON.stringify({ windowId: windowId }), //eslint-disable-line no-restricted-globals
|
|
3628
3718
|
});
|
|
3629
3719
|
}
|
|
3630
3720
|
|