webdriverio 9.9.1 → 9.9.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.
|
@@ -3,10 +3,43 @@ type WaitState = 'none' | 'interactive' | 'networkIdle' | 'complete';
|
|
|
3
3
|
*
|
|
4
4
|
* The `url` command loads an URL in the browser. If a baseUrl is specified in the config,
|
|
5
5
|
* it will be prepended to the url parameter using node's url.resolve() method. Calling
|
|
6
|
-
* `browser.url('...')` with the same url as last time will trigger a page reload.
|
|
6
|
+
* `browser.url('...')` with the same url as last time will trigger a page reload. However,
|
|
7
|
+
* if the url contains a hash, the browser will not trigger a new navigation and the user
|
|
8
|
+
* has to [refresh](/docs/api/webdriver#refresh) the page to trigger one.
|
|
7
9
|
*
|
|
8
10
|
* The command returns an `WebdriverIO.Request` object that contains information about the
|
|
9
|
-
* request and response data of the page load
|
|
11
|
+
* request and response data of the page load:
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* interface WebdriverIO.Request {
|
|
15
|
+
* id?: string
|
|
16
|
+
* url: string
|
|
17
|
+
* timestamp: number
|
|
18
|
+
* navigation?: string
|
|
19
|
+
* redirectChain?: string[],
|
|
20
|
+
* headers: Record<string, string>
|
|
21
|
+
* cookies?: NetworkCookie[]
|
|
22
|
+
* \/**
|
|
23
|
+
* * Error message if request failed
|
|
24
|
+
* *\/
|
|
25
|
+
* error?: string
|
|
26
|
+
* response?: {
|
|
27
|
+
* fromCache: boolean
|
|
28
|
+
* headers: Record<string, string>
|
|
29
|
+
* mimeType: string
|
|
30
|
+
* status: number
|
|
31
|
+
* },
|
|
32
|
+
* /**
|
|
33
|
+
* * List of all requests that were made due to the main request.
|
|
34
|
+
* * Note: the list may be incomplete and does not contain request that were
|
|
35
|
+
* * made after the command has finished.
|
|
36
|
+
* *
|
|
37
|
+
* * The property will be undefined if the request is not a document request
|
|
38
|
+
* * that was initiated by the browser.
|
|
39
|
+
* *\/
|
|
40
|
+
* children?: Request[]
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
10
43
|
*
|
|
11
44
|
* The command supports the following options:
|
|
12
45
|
*
|
|
@@ -45,6 +78,8 @@ type WaitState = 'none' | 'interactive' | 'networkIdle' | 'complete';
|
|
|
45
78
|
const request = await browser.url('https://webdriver.io');
|
|
46
79
|
// log url
|
|
47
80
|
console.log(request.url); // outputs: "https://webdriver.io"
|
|
81
|
+
console.log(request.response?.status); // outputs: 200
|
|
82
|
+
console.log(request.response?.headers); // outputs: { 'content-type': 'text/html; charset=UTF-8' }
|
|
48
83
|
|
|
49
84
|
:baseUrlResolutions.js
|
|
50
85
|
// With a base URL of http://example.com/site, the following url parameters resolve as such:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/url.ts"],"names":[],"mappings":"AAKA,KAAK,SAAS,GAAG,MAAM,GAAG,aAAa,GAAG,aAAa,GAAG,UAAU,CAAA;AAKpE
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/url.ts"],"names":[],"mappings":"AAKA,KAAK,SAAS,GAAG,MAAM,GAAG,aAAa,GAAG,aAAa,GAAG,UAAU,CAAA;AAKpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsIG;AACH,wBAAsB,GAAG,CACrB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,iBAAsB,GAChC,OAAO,CAAC,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC,CA6HrC;AAED,UAAU,iBAAiB;IACvB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC;;;OAGG;IACH,IAAI,CAAC,EAAE;QACH,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;KACf,CAAA;IACD;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,OAAO,CAAA;CAC/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isDisplayed.d.ts","sourceRoot":"","sources":["../../../src/commands/element/isDisplayed.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AAEH,wBAAsB,WAAW,CAC7B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,aAAa,GAAE,iBAAkC,
|
|
1
|
+
{"version":3,"file":"isDisplayed.d.ts","sourceRoot":"","sources":["../../../src/commands/element/isDisplayed.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AAEH,wBAAsB,WAAW,CAC7B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,aAAa,GAAE,iBAAkC,oBAgEpD;AASD,UAAU,iBAAiB;IACvB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC/B"}
|
package/build/index.js
CHANGED
|
@@ -4664,12 +4664,14 @@ var _NetworkManager = class _NetworkManager extends SessionManager {
|
|
|
4664
4664
|
__privateSet(this, _initialize3, __privateGet(this, _browser7).sessionSubscribe({
|
|
4665
4665
|
events: [
|
|
4666
4666
|
"browsingContext.navigationStarted",
|
|
4667
|
+
"browsingContext.fragmentNavigated",
|
|
4667
4668
|
"network.responseCompleted",
|
|
4668
4669
|
"network.beforeRequestSent",
|
|
4669
4670
|
"network.fetchError"
|
|
4670
4671
|
]
|
|
4671
4672
|
}).then(() => true, () => false));
|
|
4672
4673
|
__privateGet(this, _browser7).on("browsingContext.navigationStarted", __privateMethod(this, _NetworkManager_instances, navigationStarted_fn).bind(this));
|
|
4674
|
+
__privateGet(this, _browser7).on("browsingContext.fragmentNavigated", __privateMethod(this, _NetworkManager_instances, navigationStarted_fn).bind(this));
|
|
4673
4675
|
__privateGet(this, _browser7).on("network.responseCompleted", __privateMethod(this, _NetworkManager_instances, responseCompleted_fn).bind(this));
|
|
4674
4676
|
__privateGet(this, _browser7).on("network.beforeRequestSent", __privateMethod(this, _NetworkManager_instances, beforeRequestSent_fn).bind(this));
|
|
4675
4677
|
__privateGet(this, _browser7).on("network.fetchError", __privateMethod(this, _NetworkManager_instances, fetchError_fn).bind(this));
|
|
@@ -4677,6 +4679,7 @@ var _NetworkManager = class _NetworkManager extends SessionManager {
|
|
|
4677
4679
|
removeListeners() {
|
|
4678
4680
|
super.removeListeners();
|
|
4679
4681
|
__privateGet(this, _browser7).off("browsingContext.navigationStarted", __privateMethod(this, _NetworkManager_instances, navigationStarted_fn).bind(this));
|
|
4682
|
+
__privateGet(this, _browser7).off("browsingContext.fragmentNavigated", __privateMethod(this, _NetworkManager_instances, navigationStarted_fn).bind(this));
|
|
4680
4683
|
__privateGet(this, _browser7).off("network.responseCompleted", __privateMethod(this, _NetworkManager_instances, responseCompleted_fn).bind(this));
|
|
4681
4684
|
__privateGet(this, _browser7).off("network.beforeRequestSent", __privateMethod(this, _NetworkManager_instances, beforeRequestSent_fn).bind(this));
|
|
4682
4685
|
__privateGet(this, _browser7).off("network.fetchError", __privateMethod(this, _NetworkManager_instances, fetchError_fn).bind(this));
|
|
@@ -6929,8 +6932,7 @@ async function isDisplayed(commandParams = DEFAULT_PARAMS) {
|
|
|
6929
6932
|
if (!await hasElementId(this)) {
|
|
6930
6933
|
return false;
|
|
6931
6934
|
}
|
|
6932
|
-
|
|
6933
|
-
if (browser2.isMobile && isNativeApplication) {
|
|
6935
|
+
if (browser2.isMobile && browser2.isNativeContext) {
|
|
6934
6936
|
if (commandParams == null ? void 0 : commandParams.withinViewport) {
|
|
6935
6937
|
throw new Error(
|
|
6936
6938
|
"Cannot determine element visibility within viewport for native mobile apps as it is not feasible to determine full vertical and horizontal application bounds. In most cases a basic visibility check should suffice."
|
package/build/node.js
CHANGED
|
@@ -4701,12 +4701,14 @@ var NetworkManager = class _NetworkManager extends SessionManager {
|
|
|
4701
4701
|
this.#initialize = this.#browser.sessionSubscribe({
|
|
4702
4702
|
events: [
|
|
4703
4703
|
"browsingContext.navigationStarted",
|
|
4704
|
+
"browsingContext.fragmentNavigated",
|
|
4704
4705
|
"network.responseCompleted",
|
|
4705
4706
|
"network.beforeRequestSent",
|
|
4706
4707
|
"network.fetchError"
|
|
4707
4708
|
]
|
|
4708
4709
|
}).then(() => true, () => false);
|
|
4709
4710
|
this.#browser.on("browsingContext.navigationStarted", this.#navigationStarted.bind(this));
|
|
4711
|
+
this.#browser.on("browsingContext.fragmentNavigated", this.#navigationStarted.bind(this));
|
|
4710
4712
|
this.#browser.on("network.responseCompleted", this.#responseCompleted.bind(this));
|
|
4711
4713
|
this.#browser.on("network.beforeRequestSent", this.#beforeRequestSent.bind(this));
|
|
4712
4714
|
this.#browser.on("network.fetchError", this.#fetchError.bind(this));
|
|
@@ -4714,6 +4716,7 @@ var NetworkManager = class _NetworkManager extends SessionManager {
|
|
|
4714
4716
|
removeListeners() {
|
|
4715
4717
|
super.removeListeners();
|
|
4716
4718
|
this.#browser.off("browsingContext.navigationStarted", this.#navigationStarted.bind(this));
|
|
4719
|
+
this.#browser.off("browsingContext.fragmentNavigated", this.#navigationStarted.bind(this));
|
|
4717
4720
|
this.#browser.off("network.responseCompleted", this.#responseCompleted.bind(this));
|
|
4718
4721
|
this.#browser.off("network.beforeRequestSent", this.#beforeRequestSent.bind(this));
|
|
4719
4722
|
this.#browser.off("network.fetchError", this.#fetchError.bind(this));
|
|
@@ -6654,8 +6657,7 @@ async function isDisplayed(commandParams = DEFAULT_PARAMS) {
|
|
|
6654
6657
|
if (!await hasElementId(this)) {
|
|
6655
6658
|
return false;
|
|
6656
6659
|
}
|
|
6657
|
-
|
|
6658
|
-
if (browser2.isMobile && isNativeApplication) {
|
|
6660
|
+
if (browser2.isMobile && browser2.isNativeContext) {
|
|
6659
6661
|
if (commandParams?.withinViewport) {
|
|
6660
6662
|
throw new Error(
|
|
6661
6663
|
"Cannot determine element visibility within viewport for native mobile apps as it is not feasible to determine full vertical and horizontal application bounds. In most cases a basic visibility check should suffice."
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"networkManager.d.ts","sourceRoot":"","sources":["../../src/session/networkManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,kBAE7D;AAMD;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,cAAc;;gBAMlC,OAAO,EAAE,WAAW,CAAC,OAAO;
|
|
1
|
+
{"version":3,"file":"networkManager.d.ts","sourceRoot":"","sources":["../../src/session/networkManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,kBAE7D;AAMD;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,cAAc;;gBAMlC,OAAO,EAAE,WAAW,CAAC,OAAO;IA+BxC,eAAe,IAAI,IAAI;IASjB,UAAU;IA+JhB,sBAAsB,CAAC,YAAY,EAAE,MAAM;IAI3C;;;;OAIG;IACH,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,EAAE;CAqBlE"}
|
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.9.
|
|
4
|
+
"version": "9.9.3",
|
|
5
5
|
"homepage": "https://webdriver.io",
|
|
6
6
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
"optional": true
|
|
110
110
|
}
|
|
111
111
|
},
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "8908cc4e3cd75e85bf47692477fc5c0ab58f9168"
|
|
113
113
|
}
|