webdriverio 9.1.1 → 9.1.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/execute.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAsB,OAAO,CAAC,WAAW,EAAE,cAAc,SAAS,GAAG,EAAE,EACnE,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,EAC1D,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,SAAS,EAAE,cAAc,KAAK,WAAW,CAAC,EAChE,GAAG,IAAI,EAAE,cAAc,GACxB,OAAO,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/execute.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAsB,OAAO,CAAC,WAAW,EAAE,cAAc,SAAS,GAAG,EAAE,EACnE,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,EAC1D,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,SAAS,EAAE,cAAc,KAAK,WAAW,CAAC,EAChE,GAAG,IAAI,EAAE,cAAc,GACxB,OAAO,CAAC,WAAW,CAAC,CAqCtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeAsync.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/executeAsync.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAsB,YAAY,CAAC,WAAW,EAAE,cAAc,SAAS,GAAG,EAAE,EACxE,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,EAC1D,MAAM,EACF,MAAM,GACN,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC,EACjG,GAAG,IAAI,EAAE,cAAc,GACxB,OAAO,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"executeAsync.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/executeAsync.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAsB,YAAY,CAAC,WAAW,EAAE,cAAc,SAAS,GAAG,EAAE,EACxE,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,EAC1D,MAAM,EACF,MAAM,GACN,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC,EACjG,GAAG,IAAI,EAAE,cAAc,GACxB,OAAO,CAAC,WAAW,CAAC,CA6CtB"}
|
package/build/index.js
CHANGED
|
@@ -3029,8 +3029,9 @@ async function execute(script, ...args) {
|
|
|
3029
3029
|
const browser = getBrowserObject2(this);
|
|
3030
3030
|
const contextManager2 = getContextManager(browser);
|
|
3031
3031
|
const context = await contextManager2.getCurrentContext();
|
|
3032
|
+
const userScript = typeof script === "string" ? new Function(script) : script;
|
|
3032
3033
|
const functionDeclaration = new Function(`
|
|
3033
|
-
return (${SCRIPT_PREFIX}${
|
|
3034
|
+
return (${SCRIPT_PREFIX}${userScript.toString()}${SCRIPT_SUFFIX}).apply(this, arguments);
|
|
3034
3035
|
`).toString();
|
|
3035
3036
|
const params = {
|
|
3036
3037
|
functionDeclaration,
|
|
@@ -3059,12 +3060,13 @@ async function executeAsync(script, ...args) {
|
|
|
3059
3060
|
const browser = getBrowserObject3(this);
|
|
3060
3061
|
const contextManager2 = getContextManager(browser);
|
|
3061
3062
|
const context = await contextManager2.getCurrentContext();
|
|
3063
|
+
const userScript = typeof script === "string" ? new Function(script) : script;
|
|
3062
3064
|
const functionDeclaration = new Function(`
|
|
3063
3065
|
const args = Array.from(arguments)
|
|
3064
3066
|
return new Promise(async (resolve, reject) => {
|
|
3065
3067
|
const cb = (result) => resolve(result)
|
|
3066
3068
|
try {
|
|
3067
|
-
await (${
|
|
3069
|
+
await (${userScript.toString()}).apply(this, [...args, cb])
|
|
3068
3070
|
} catch (err) {
|
|
3069
3071
|
return reject(err)
|
|
3070
3072
|
}
|
|
@@ -3534,10 +3536,10 @@ var WebDriverInterception = class _WebDriverInterception {
|
|
|
3534
3536
|
}
|
|
3535
3537
|
#matchesFilterOptions(request) {
|
|
3536
3538
|
let isRequestMatching = true;
|
|
3537
|
-
if (this.#filterOptions.method) {
|
|
3538
|
-
isRequestMatching = typeof this.#filterOptions.method === "function" ? this.#filterOptions.method(request.request.method) : this.#filterOptions.method === request.request.method;
|
|
3539
|
+
if (isRequestMatching && this.#filterOptions.method) {
|
|
3540
|
+
isRequestMatching = typeof this.#filterOptions.method === "function" ? this.#filterOptions.method(request.request.method) : this.#filterOptions.method.toLowerCase() === request.request.method.toLowerCase();
|
|
3539
3541
|
}
|
|
3540
|
-
if (this.#filterOptions.requestHeaders) {
|
|
3542
|
+
if (isRequestMatching && this.#filterOptions.requestHeaders) {
|
|
3541
3543
|
isRequestMatching = typeof this.#filterOptions.requestHeaders === "function" ? this.#filterOptions.requestHeaders(request.request.headers.reduce((acc, { name, value }) => {
|
|
3542
3544
|
acc[name] = value.type === "string" ? value.value : Buffer.from(value.value, "base64").toString();
|
|
3543
3545
|
return acc;
|
|
@@ -3549,7 +3551,7 @@ var WebDriverInterception = class _WebDriverInterception {
|
|
|
3549
3551
|
return header.value.type === "string" ? header.value.value === value : Buffer.from(header.value.value, "base64").toString() === value;
|
|
3550
3552
|
});
|
|
3551
3553
|
}
|
|
3552
|
-
if (this.#filterOptions.responseHeaders && "response" in request) {
|
|
3554
|
+
if (isRequestMatching && this.#filterOptions.responseHeaders && "response" in request) {
|
|
3553
3555
|
isRequestMatching = typeof this.#filterOptions.responseHeaders === "function" ? this.#filterOptions.responseHeaders(request.response.headers.reduce((acc, { name, value }) => {
|
|
3554
3556
|
acc[name] = value.type === "string" ? value.value : Buffer.from(value.value, "base64").toString();
|
|
3555
3557
|
return acc;
|
|
@@ -3561,7 +3563,7 @@ var WebDriverInterception = class _WebDriverInterception {
|
|
|
3561
3563
|
return header.value.type === "string" ? header.value.value === value : Buffer.from(header.value.value, "base64").toString() === value;
|
|
3562
3564
|
});
|
|
3563
3565
|
}
|
|
3564
|
-
if (this.#filterOptions.statusCode && "response" in request) {
|
|
3566
|
+
if (isRequestMatching && this.#filterOptions.statusCode && "response" in request) {
|
|
3565
3567
|
isRequestMatching = typeof this.#filterOptions.statusCode === "function" ? this.#filterOptions.statusCode(request.response.status) : this.#filterOptions.statusCode === request.response.status;
|
|
3566
3568
|
}
|
|
3567
3569
|
return isRequestMatching;
|
|
@@ -6907,9 +6909,7 @@ var REGION_MAPPING = {
|
|
|
6907
6909
|
// default endpoint
|
|
6908
6910
|
"eu": "eu-central-1.",
|
|
6909
6911
|
"eu-central-1": "eu-central-1.",
|
|
6910
|
-
"us-east-4": "us-east-4."
|
|
6911
|
-
"apac": "apac-southeast-1.",
|
|
6912
|
-
"apac-southeast-1": "apac-southeast-1"
|
|
6912
|
+
"us-east-4": "us-east-4."
|
|
6913
6913
|
};
|
|
6914
6914
|
function getSauceEndpoint(region, { isRDC, isVisual } = {}) {
|
|
6915
6915
|
const shortRegion = REGION_MAPPING[region] ? region : "us";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detectBackend.d.ts","sourceRoot":"","sources":["../../src/utils/detectBackend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"detectBackend.d.ts","sourceRoot":"","sources":["../../src/utils/detectBackend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAexD,UAAU,qBAAqB;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAA;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,YAAY,CAAC,+BAA+B,CAAA;CAC9D;AAgBD;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,OAAO,GAAE,qBAA0B;;;;;EAkGxE"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webdriverio",
|
|
3
3
|
"description": "Next-gen browser and mobile automation test framework for Node.js",
|
|
4
|
-
"version": "9.1.
|
|
4
|
+
"version": "9.1.2",
|
|
5
5
|
"homepage": "https://webdriver.io",
|
|
6
6
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -76,12 +76,12 @@
|
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@types/node": "^20.11.30",
|
|
78
78
|
"@types/sinonjs__fake-timers": "^8.1.5",
|
|
79
|
-
"@wdio/config": "9.1.
|
|
79
|
+
"@wdio/config": "9.1.2",
|
|
80
80
|
"@wdio/logger": "9.1.0",
|
|
81
81
|
"@wdio/protocols": "9.0.8",
|
|
82
82
|
"@wdio/repl": "9.0.8",
|
|
83
|
-
"@wdio/types": "9.1.
|
|
84
|
-
"@wdio/utils": "9.1.
|
|
83
|
+
"@wdio/types": "9.1.2",
|
|
84
|
+
"@wdio/utils": "9.1.2",
|
|
85
85
|
"archiver": "^7.0.1",
|
|
86
86
|
"aria-query": "^5.3.0",
|
|
87
87
|
"cheerio": "^1.0.0-rc.12",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"rgb2hex": "0.2.5",
|
|
101
101
|
"serialize-error": "^11.0.3",
|
|
102
102
|
"urlpattern-polyfill": "^10.0.0",
|
|
103
|
-
"webdriver": "9.1.
|
|
103
|
+
"webdriver": "9.1.2"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
106
|
"puppeteer-core": "^22.3.0"
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"optional": true
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "e009b5102f9f98b99fa62df870ce7f3f5bc1b99a"
|
|
114
114
|
}
|