webdriverio 9.7.3 → 9.8.0
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/index.js +17 -16
- package/build/node.js +17 -16
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -3141,24 +3141,25 @@ var _ContextManager = class _ContextManager extends SessionManager {
|
|
|
3141
3141
|
return;
|
|
3142
3142
|
}
|
|
3143
3143
|
__privateGet(this, _browser3).on("command", __privateMethod(this, _ContextManager_instances, onCommand_fn2).bind(this));
|
|
3144
|
-
__privateGet(this, _browser3).sessionSubscribe({
|
|
3145
|
-
events: ["browsingContext.navigationStarted"]
|
|
3146
|
-
});
|
|
3147
|
-
__privateGet(this, _browser3).on("browsingContext.navigationStarted", async (nav) => {
|
|
3148
|
-
if (!__privateGet(this, _currentContext) || nav.context === __privateGet(this, _currentContext)) {
|
|
3149
|
-
return;
|
|
3150
|
-
}
|
|
3151
|
-
const { contexts } = await __privateGet(this, _browser3).browsingContextGetTree({});
|
|
3152
|
-
const hasContext = this.findContext(__privateGet(this, _currentContext), contexts, "byContextId");
|
|
3153
|
-
const newContext = contexts.find((context) => context.context === nav.context);
|
|
3154
|
-
if (!hasContext && newContext) {
|
|
3155
|
-
this.setCurrentContext(newContext.context);
|
|
3156
|
-
__privateGet(this, _browser3).switchToWindow(__privateGet(this, _currentContext));
|
|
3157
|
-
return;
|
|
3158
|
-
}
|
|
3159
|
-
});
|
|
3160
3144
|
if (__privateGet(this, _browser3).isMobile) {
|
|
3161
3145
|
__privateGet(this, _browser3).on("result", __privateMethod(this, _ContextManager_instances, onCommandResultMobile_fn).bind(this));
|
|
3146
|
+
} else {
|
|
3147
|
+
__privateGet(this, _browser3).sessionSubscribe({
|
|
3148
|
+
events: ["browsingContext.navigationStarted"]
|
|
3149
|
+
});
|
|
3150
|
+
__privateGet(this, _browser3).on("browsingContext.navigationStarted", async (nav) => {
|
|
3151
|
+
if (!__privateGet(this, _currentContext) || nav.context === __privateGet(this, _currentContext)) {
|
|
3152
|
+
return;
|
|
3153
|
+
}
|
|
3154
|
+
const { contexts } = await __privateGet(this, _browser3).browsingContextGetTree({});
|
|
3155
|
+
const hasContext = this.findContext(__privateGet(this, _currentContext), contexts, "byContextId");
|
|
3156
|
+
const newContext = contexts.find((context) => context.context === nav.context);
|
|
3157
|
+
if (!hasContext && newContext) {
|
|
3158
|
+
this.setCurrentContext(newContext.context);
|
|
3159
|
+
__privateGet(this, _browser3).switchToWindow(__privateGet(this, _currentContext));
|
|
3160
|
+
return;
|
|
3161
|
+
}
|
|
3162
|
+
});
|
|
3162
3163
|
}
|
|
3163
3164
|
}
|
|
3164
3165
|
removeListeners() {
|
package/build/node.js
CHANGED
|
@@ -267,24 +267,25 @@ var ContextManager = class _ContextManager extends SessionManager {
|
|
|
267
267
|
return;
|
|
268
268
|
}
|
|
269
269
|
this.#browser.on("command", this.#onCommand.bind(this));
|
|
270
|
-
this.#browser.sessionSubscribe({
|
|
271
|
-
events: ["browsingContext.navigationStarted"]
|
|
272
|
-
});
|
|
273
|
-
this.#browser.on("browsingContext.navigationStarted", async (nav) => {
|
|
274
|
-
if (!this.#currentContext || nav.context === this.#currentContext) {
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
const { contexts } = await this.#browser.browsingContextGetTree({});
|
|
278
|
-
const hasContext = this.findContext(this.#currentContext, contexts, "byContextId");
|
|
279
|
-
const newContext = contexts.find((context) => context.context === nav.context);
|
|
280
|
-
if (!hasContext && newContext) {
|
|
281
|
-
this.setCurrentContext(newContext.context);
|
|
282
|
-
this.#browser.switchToWindow(this.#currentContext);
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
270
|
if (this.#browser.isMobile) {
|
|
287
271
|
this.#browser.on("result", this.#onCommandResultMobile.bind(this));
|
|
272
|
+
} else {
|
|
273
|
+
this.#browser.sessionSubscribe({
|
|
274
|
+
events: ["browsingContext.navigationStarted"]
|
|
275
|
+
});
|
|
276
|
+
this.#browser.on("browsingContext.navigationStarted", async (nav) => {
|
|
277
|
+
if (!this.#currentContext || nav.context === this.#currentContext) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
const { contexts } = await this.#browser.browsingContextGetTree({});
|
|
281
|
+
const hasContext = this.findContext(this.#currentContext, contexts, "byContextId");
|
|
282
|
+
const newContext = contexts.find((context) => context.context === nav.context);
|
|
283
|
+
if (!hasContext && newContext) {
|
|
284
|
+
this.setCurrentContext(newContext.context);
|
|
285
|
+
this.#browser.switchToWindow(this.#currentContext);
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
});
|
|
288
289
|
}
|
|
289
290
|
}
|
|
290
291
|
removeListeners() {
|
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.
|
|
4
|
+
"version": "9.8.0",
|
|
5
5
|
"homepage": "https://webdriver.io",
|
|
6
6
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
"optional": true
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "ddd40bedd26a3fc1917a84ffc79a3e8ed0d5e68c"
|
|
115
115
|
}
|