webdriverio 9.1.0 → 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.
- package/build/commands/browser/execute.d.ts.map +1 -1
- package/build/commands/browser/executeAsync.d.ts.map +1 -1
- package/build/commands/browser/newWindow.d.ts.map +1 -1
- package/build/commands/browser/switchWindow.d.ts.map +1 -1
- package/build/context.d.ts +1 -0
- package/build/context.d.ts.map +1 -1
- package/build/index.js +31 -18
- package/build/shadowRoot.d.ts.map +1 -1
- package/build/utils/detectBackend.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"newWindow.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/newWindow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"newWindow.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/newWindow.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAItD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAsB,SAAS,CAC3B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,GAAG,EAAE,MAAM,EACX,EAAE,UAAe,EAAE,cAAmB,EAAE,GAAE,gBAAqB,mBAiDlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switchWindow.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/switchWindow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"switchWindow.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/switchWindow.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,YAAY,CAC9B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,EAAE,MAAM,GAAG,MAAM,mBAmD3B"}
|
package/build/context.d.ts
CHANGED
package/build/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAMA,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,kBAS7D;AAED;;;;GAIG;AACH,qBAAa,cAAc;;gBAKX,OAAO,EAAE,WAAW,CAAC,OAAO;IAoBlC,UAAU;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAMA,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,kBAS7D;AAED;;;;GAIG;AACH,qBAAa,cAAc;;gBAKX,OAAO,EAAE,WAAW,CAAC,OAAO;IAoBlC,UAAU;IAqBhB,iBAAiB,CAAE,OAAO,EAAE,MAAM;IAI5B,iBAAiB;CAM1B"}
|
package/build/index.js
CHANGED
|
@@ -3002,13 +3002,15 @@ var ContextManager = class {
|
|
|
3002
3002
|
*
|
|
3003
3003
|
* @param {local.BrowsingContextNavigationInfo} context browsing context used to navigate
|
|
3004
3004
|
*/
|
|
3005
|
-
#handleNavigationStarted(context) {
|
|
3006
|
-
this.#browser.getWindowHandle()
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3005
|
+
async #handleNavigationStarted(context) {
|
|
3006
|
+
const windowHandle = await this.#browser.getWindowHandle();
|
|
3007
|
+
if (context.context === windowHandle) {
|
|
3008
|
+
log4.info(`Update current context: ${context.context}`);
|
|
3009
|
+
this.#currentContext = context.context;
|
|
3010
|
+
}
|
|
3011
|
+
}
|
|
3012
|
+
setCurrentContext(context) {
|
|
3013
|
+
this.#currentContext = context;
|
|
3012
3014
|
}
|
|
3013
3015
|
async getCurrentContext() {
|
|
3014
3016
|
if (!this.#currentContext) {
|
|
@@ -3027,8 +3029,9 @@ async function execute(script, ...args) {
|
|
|
3027
3029
|
const browser = getBrowserObject2(this);
|
|
3028
3030
|
const contextManager2 = getContextManager(browser);
|
|
3029
3031
|
const context = await contextManager2.getCurrentContext();
|
|
3032
|
+
const userScript = typeof script === "string" ? new Function(script) : script;
|
|
3030
3033
|
const functionDeclaration = new Function(`
|
|
3031
|
-
return (${SCRIPT_PREFIX}${
|
|
3034
|
+
return (${SCRIPT_PREFIX}${userScript.toString()}${SCRIPT_SUFFIX}).apply(this, arguments);
|
|
3032
3035
|
`).toString();
|
|
3033
3036
|
const params = {
|
|
3034
3037
|
functionDeclaration,
|
|
@@ -3057,12 +3060,13 @@ async function executeAsync(script, ...args) {
|
|
|
3057
3060
|
const browser = getBrowserObject3(this);
|
|
3058
3061
|
const contextManager2 = getContextManager(browser);
|
|
3059
3062
|
const context = await contextManager2.getCurrentContext();
|
|
3063
|
+
const userScript = typeof script === "string" ? new Function(script) : script;
|
|
3060
3064
|
const functionDeclaration = new Function(`
|
|
3061
3065
|
const args = Array.from(arguments)
|
|
3062
3066
|
return new Promise(async (resolve, reject) => {
|
|
3063
3067
|
const cb = (result) => resolve(result)
|
|
3064
3068
|
try {
|
|
3065
|
-
await (${
|
|
3069
|
+
await (${userScript.toString()}).apply(this, [...args, cb])
|
|
3066
3070
|
} catch (err) {
|
|
3067
3071
|
return reject(err)
|
|
3068
3072
|
}
|
|
@@ -3532,10 +3536,10 @@ var WebDriverInterception = class _WebDriverInterception {
|
|
|
3532
3536
|
}
|
|
3533
3537
|
#matchesFilterOptions(request) {
|
|
3534
3538
|
let isRequestMatching = true;
|
|
3535
|
-
if (this.#filterOptions.method) {
|
|
3536
|
-
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();
|
|
3537
3541
|
}
|
|
3538
|
-
if (this.#filterOptions.requestHeaders) {
|
|
3542
|
+
if (isRequestMatching && this.#filterOptions.requestHeaders) {
|
|
3539
3543
|
isRequestMatching = typeof this.#filterOptions.requestHeaders === "function" ? this.#filterOptions.requestHeaders(request.request.headers.reduce((acc, { name, value }) => {
|
|
3540
3544
|
acc[name] = value.type === "string" ? value.value : Buffer.from(value.value, "base64").toString();
|
|
3541
3545
|
return acc;
|
|
@@ -3547,7 +3551,7 @@ var WebDriverInterception = class _WebDriverInterception {
|
|
|
3547
3551
|
return header.value.type === "string" ? header.value.value === value : Buffer.from(header.value.value, "base64").toString() === value;
|
|
3548
3552
|
});
|
|
3549
3553
|
}
|
|
3550
|
-
if (this.#filterOptions.responseHeaders && "response" in request) {
|
|
3554
|
+
if (isRequestMatching && this.#filterOptions.responseHeaders && "response" in request) {
|
|
3551
3555
|
isRequestMatching = typeof this.#filterOptions.responseHeaders === "function" ? this.#filterOptions.responseHeaders(request.response.headers.reduce((acc, { name, value }) => {
|
|
3552
3556
|
acc[name] = value.type === "string" ? value.value : Buffer.from(value.value, "base64").toString();
|
|
3553
3557
|
return acc;
|
|
@@ -3559,7 +3563,7 @@ var WebDriverInterception = class _WebDriverInterception {
|
|
|
3559
3563
|
return header.value.type === "string" ? header.value.value === value : Buffer.from(header.value.value, "base64").toString() === value;
|
|
3560
3564
|
});
|
|
3561
3565
|
}
|
|
3562
|
-
if (this.#filterOptions.statusCode && "response" in request) {
|
|
3566
|
+
if (isRequestMatching && this.#filterOptions.statusCode && "response" in request) {
|
|
3563
3567
|
isRequestMatching = typeof this.#filterOptions.statusCode === "function" ? this.#filterOptions.statusCode(request.response.status) : this.#filterOptions.statusCode === request.response.status;
|
|
3564
3568
|
}
|
|
3565
3569
|
return isRequestMatching;
|
|
@@ -3779,7 +3783,9 @@ async function newWindow(url6, { windowName = "", windowFeatures = "" } = {}) {
|
|
|
3779
3783
|
}
|
|
3780
3784
|
const tabsBefore = await this.getWindowHandles();
|
|
3781
3785
|
if (this.isBidi) {
|
|
3786
|
+
const contextManager2 = getContextManager(this);
|
|
3782
3787
|
const { context } = await this.browsingContextCreate({ type: "window" });
|
|
3788
|
+
contextManager2.setCurrentContext(context);
|
|
3783
3789
|
await this.browsingContextNavigate({ context, url: url6 });
|
|
3784
3790
|
} else {
|
|
3785
3791
|
await this.execute(newWindowHelper, url6, windowName, windowFeatures);
|
|
@@ -4071,8 +4077,10 @@ async function switchWindow(matcher) {
|
|
|
4071
4077
|
}
|
|
4072
4078
|
return !!target.match(matcher);
|
|
4073
4079
|
};
|
|
4080
|
+
const contextManager2 = getContextManager(this);
|
|
4074
4081
|
for (const tab of tabs) {
|
|
4075
4082
|
await this.switchToWindow(tab);
|
|
4083
|
+
contextManager2.setCurrentContext(tab);
|
|
4076
4084
|
const url6 = await this.getUrl();
|
|
4077
4085
|
if (matchesTarget(url6)) {
|
|
4078
4086
|
return tab;
|
|
@@ -4878,10 +4886,11 @@ var ShadowRootManager = class {
|
|
|
4878
4886
|
return;
|
|
4879
4887
|
}
|
|
4880
4888
|
this.#initialize = this.#browser.sessionSubscribe({
|
|
4881
|
-
events: ["log.entryAdded"]
|
|
4889
|
+
events: ["log.entryAdded", "browsingContext.navigationStarted"]
|
|
4882
4890
|
}).then(() => true, () => false);
|
|
4883
4891
|
this.#browser.on("log.entryAdded", this.handleLogEntry.bind(this));
|
|
4884
4892
|
this.#browser.on("result", this.#commandResultHandler.bind(this));
|
|
4893
|
+
this.#browser.on("browsingContext.navigationStarted", this.#handleNavigationStarted.bind(this));
|
|
4885
4894
|
browser.scriptAddPreloadScript({
|
|
4886
4895
|
functionDeclaration: customElementWrapper.toString()
|
|
4887
4896
|
});
|
|
@@ -4889,6 +4898,12 @@ var ShadowRootManager = class {
|
|
|
4889
4898
|
async initialize() {
|
|
4890
4899
|
return this.#initialize;
|
|
4891
4900
|
}
|
|
4901
|
+
/**
|
|
4902
|
+
* keep track of navigation events and remove shadow roots when they are no longer needed
|
|
4903
|
+
*/
|
|
4904
|
+
#handleNavigationStarted(context) {
|
|
4905
|
+
this.#shadowRoots.delete(context.context);
|
|
4906
|
+
}
|
|
4892
4907
|
/**
|
|
4893
4908
|
* keep track of frame depth
|
|
4894
4909
|
*/
|
|
@@ -6894,9 +6909,7 @@ var REGION_MAPPING = {
|
|
|
6894
6909
|
// default endpoint
|
|
6895
6910
|
"eu": "eu-central-1.",
|
|
6896
6911
|
"eu-central-1": "eu-central-1.",
|
|
6897
|
-
"us-east-4": "us-east-4."
|
|
6898
|
-
"apac": "apac-southeast-1.",
|
|
6899
|
-
"apac-southeast-1": "apac-southeast-1"
|
|
6912
|
+
"us-east-4": "us-east-4."
|
|
6900
6913
|
};
|
|
6901
6914
|
function getSauceEndpoint(region, { isRDC, isVisual } = {}) {
|
|
6902
6915
|
const shortRegion = REGION_MAPPING[region] ? region : "us";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadowRoot.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AMxE;;OAEG;IACH,gBAAgB,CAAE,IAAI,EAAE,cAAc,GAAG,IAAI;IAC7C;;;;;OAKG;IACH,gBAAgB,CAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,IAAI;IA6B5D,IAAI,CAAE,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAelD,cAAc,CAAE,UAAU,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAe/D,kBAAkB,IAAK,MAAM,EAAE;IAO/B,IAAI,IAAK,cAAc,EAAE;IAIzB,MAAM,CAAE,OAAO,EAAE,MAAM,GAAG,OAAO;CAcpC"}
|
|
@@ -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
|
}
|