webdriverio 9.21.0 → 9.22.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/commands/element/getHTML.d.ts +1 -1
- package/build/commands/element/isDisplayed.d.ts.map +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +59 -37
- package/build/node.js +53 -31
- package/build/scripts/isElementClickable.js +0 -1
- package/build/scripts/isElementDisplayed.d.ts.map +1 -1
- package/build/scripts/isElementDisplayed.js +3 -4
- package/build/utils/actions/base.d.ts.map +1 -1
- package/build/utils/interception/index.d.ts.map +1 -1
- package/build/utils/interception/utils.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -55,7 +55,7 @@ import type { CheerioAPI } from 'cheerio';
|
|
|
55
55
|
* @param {boolean=} options.pierceShadowRoot if true it includes content of the shadow roots of all web components in the DOM (default: `true`)
|
|
56
56
|
* @param {boolean=} options.removeCommentNodes if true it removes all comment nodes from the HTML, e.g. `<!--?lit$206212805$--><!--?lit$206212805$-->` (default: `true`)
|
|
57
57
|
* @param {boolean=} options.prettify if true, the html output will be prettified (default: `true`)
|
|
58
|
-
* @return {Promise
|
|
58
|
+
* @return {Promise} the HTML of the specified element (as a string)
|
|
59
59
|
* @uses action/selectorExecute
|
|
60
60
|
* @type property
|
|
61
61
|
*
|
|
@@ -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":[],"m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AG,OAAO,CAAC,WAAW,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAW,YAAY,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,KAAK,cAAc,MAAM,WAAW,CAAA;AAGhD,OAAO,wBAAwB,MAAM,+BAA+B,CAAA;AAQpE,OAAO,KAAK,EAAE,aAAa,EAAwB,MAAM,YAAY,CAAA;AAIrE,cAAc,YAAY,CAAA;AAC1B,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAc,CAAA;AAC9B,eAAO,MAAM,kBAAkB,iCAA2B,CAAA;AAE1D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,GACf,QAAQ,YAAY,CAAC,iBAAiB,EACtC,iBAAiB,CAAC,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,iBAAiB,KAAK,cAAc,CAAC,MAAM,KACnH,OAAO,CAAC,WAAW,CAAC,OAAO,CAqC7B,CAAA;AAED,eAAO,MAAM,MAAM,GAAmB,eAAe,aAAa,KAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CA+B/F,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,WAAW,GACpB,QAAQ,YAAY,CAAC,gCAAgC,EACrD,yBAAwB;IAAE,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAAO,KAC7D,OAAO,CAAC,WAAW,CAAC,kBAAkB,CA0ExC,CAAA"}
|
package/build/index.js
CHANGED
|
@@ -459,7 +459,9 @@ async function $(selector) {
|
|
|
459
459
|
|
|
460
460
|
// src/utils/actions/base.ts
|
|
461
461
|
import { ELEMENT_KEY as ELEMENT_KEY3 } from "webdriver";
|
|
462
|
-
var
|
|
462
|
+
var keyActionIds = 0;
|
|
463
|
+
var pointerActionIds = 0;
|
|
464
|
+
var wheelActionIds = 0;
|
|
463
465
|
var _id, _type, _parameters, _instance;
|
|
464
466
|
var BaseAction = class {
|
|
465
467
|
constructor(instance, type, params) {
|
|
@@ -470,7 +472,23 @@ var BaseAction = class {
|
|
|
470
472
|
__privateAdd(this, _instance);
|
|
471
473
|
__publicField(this, "sequence", []);
|
|
472
474
|
__privateSet(this, _instance, instance);
|
|
473
|
-
|
|
475
|
+
if (params == null ? void 0 : params.id) {
|
|
476
|
+
__privateSet(this, _id, params.id);
|
|
477
|
+
} else {
|
|
478
|
+
switch (type) {
|
|
479
|
+
case "key":
|
|
480
|
+
__privateSet(this, _id, "key".concat(++keyActionIds));
|
|
481
|
+
break;
|
|
482
|
+
case "pointer":
|
|
483
|
+
__privateSet(this, _id, "pointer".concat(++pointerActionIds));
|
|
484
|
+
break;
|
|
485
|
+
case "wheel":
|
|
486
|
+
__privateSet(this, _id, "wheel".concat(++wheelActionIds));
|
|
487
|
+
break;
|
|
488
|
+
default:
|
|
489
|
+
__privateSet(this, _id, "action".concat(type));
|
|
490
|
+
}
|
|
491
|
+
}
|
|
474
492
|
__privateSet(this, _type, type);
|
|
475
493
|
__privateSet(this, _parameters, (params == null ? void 0 : params.parameters) || {});
|
|
476
494
|
}
|
|
@@ -3782,13 +3800,14 @@ function parseOverwrite(overwrite, request) {
|
|
|
3782
3800
|
return result;
|
|
3783
3801
|
}
|
|
3784
3802
|
function getPatternParam(pattern, key) {
|
|
3785
|
-
|
|
3803
|
+
const value = pattern[key];
|
|
3804
|
+
if (value === "*" || value.includes("*")) {
|
|
3786
3805
|
return;
|
|
3787
3806
|
}
|
|
3788
3807
|
if (key === "port" && pattern.port === "") {
|
|
3789
3808
|
return pattern.protocol === "https" ? "443" : "80";
|
|
3790
3809
|
}
|
|
3791
|
-
return
|
|
3810
|
+
return value;
|
|
3792
3811
|
}
|
|
3793
3812
|
|
|
3794
3813
|
// src/utils/interception/index.ts
|
|
@@ -4045,7 +4064,13 @@ addEventHandler_fn = function(event, handler) {
|
|
|
4045
4064
|
handlers == null ? void 0 : handlers.push(handler);
|
|
4046
4065
|
};
|
|
4047
4066
|
handleBeforeRequestSent_fn = function(request) {
|
|
4067
|
+
var _a;
|
|
4048
4068
|
if (!__privateMethod(this, _WebDriverInterception_instances, isRequestMatching_fn).call(this, request)) {
|
|
4069
|
+
if ((_a = request.intercepts) == null ? void 0 : _a.includes(__privateGet(this, _mockId))) {
|
|
4070
|
+
return __privateGet(this, _browser4).networkContinueRequest({
|
|
4071
|
+
request: request.request.request
|
|
4072
|
+
});
|
|
4073
|
+
}
|
|
4049
4074
|
return;
|
|
4050
4075
|
}
|
|
4051
4076
|
if (!__privateMethod(this, _WebDriverInterception_instances, matchesFilterOptions_fn).call(this, request)) {
|
|
@@ -4073,7 +4098,13 @@ handleBeforeRequestSent_fn = function(request) {
|
|
|
4073
4098
|
});
|
|
4074
4099
|
};
|
|
4075
4100
|
handleResponseStarted_fn = function(request) {
|
|
4101
|
+
var _a;
|
|
4076
4102
|
if (!__privateMethod(this, _WebDriverInterception_instances, isRequestMatching_fn).call(this, request)) {
|
|
4103
|
+
if ((_a = request.intercepts) == null ? void 0 : _a.includes(__privateGet(this, _mockId))) {
|
|
4104
|
+
return __privateGet(this, _browser4).networkProvideResponse({
|
|
4105
|
+
request: request.request.request
|
|
4106
|
+
}).catch(__privateMethod(this, _WebDriverInterception_instances, handleNetworkProvideResponseError_fn));
|
|
4107
|
+
}
|
|
4077
4108
|
return;
|
|
4078
4109
|
}
|
|
4079
4110
|
if (!__privateMethod(this, _WebDriverInterception_instances, matchesFilterOptions_fn).call(this, request)) {
|
|
@@ -6124,7 +6155,6 @@ async function getCurrentContexts({
|
|
|
6124
6155
|
isAndroidWebviewVisible,
|
|
6125
6156
|
returnAndroidDescriptionData
|
|
6126
6157
|
}) {
|
|
6127
|
-
var _a;
|
|
6128
6158
|
const contexts = await browser.execute("mobile: getContexts");
|
|
6129
6159
|
if (browser.isIOS) {
|
|
6130
6160
|
return contexts;
|
|
@@ -6140,10 +6170,12 @@ async function getCurrentContexts({
|
|
|
6140
6170
|
isAttachedAndVisible: isAndroidWebviewVisible,
|
|
6141
6171
|
packageName
|
|
6142
6172
|
});
|
|
6143
|
-
const
|
|
6144
|
-
isPackageNameMissing =
|
|
6145
|
-
const
|
|
6146
|
-
const
|
|
6173
|
+
const matchingContexts = parsedContexts.filter((context) => context.packageName === packageName);
|
|
6174
|
+
isPackageNameMissing = matchingContexts.length === 0;
|
|
6175
|
+
const hasAndroidWebviewData = matchingContexts.some((context) => Boolean(context.androidWebviewData));
|
|
6176
|
+
const isAndroidWebviewDataMissing = matchingContexts.length > 0 && !hasAndroidWebviewData;
|
|
6177
|
+
const hasNonEmptyAndroidWebviewData = matchingContexts.some((context) => context.androidWebviewData && !context.androidWebviewData.empty);
|
|
6178
|
+
const isAndroidWebviewDataEmpty = matchingContexts.length > 0 && hasAndroidWebviewData && !hasNonEmptyAndroidWebviewData;
|
|
6147
6179
|
if (packageName === CHROME_PACKAGE_NAME) {
|
|
6148
6180
|
return parsedContexts;
|
|
6149
6181
|
}
|
|
@@ -6587,7 +6619,7 @@ async function getShorthandPropertyCSSValue(options) {
|
|
|
6587
6619
|
return mergeEqualSymmetricalValue(cssValues2);
|
|
6588
6620
|
}
|
|
6589
6621
|
const cssValues = await Promise.all(
|
|
6590
|
-
properties.map((prop) =>
|
|
6622
|
+
properties.map((prop) => this.getElementCSSValue(this.elementId, prop))
|
|
6591
6623
|
);
|
|
6592
6624
|
return mergeEqualSymmetricalValue(cssValues);
|
|
6593
6625
|
}
|
|
@@ -6602,7 +6634,7 @@ async function getPropertyCSSValue(options) {
|
|
|
6602
6634
|
}
|
|
6603
6635
|
);
|
|
6604
6636
|
}
|
|
6605
|
-
return await
|
|
6637
|
+
return await this.getElementCSSValue(this.elementId, cssProperty);
|
|
6606
6638
|
}
|
|
6607
6639
|
function getShorthandProperties(cssProperty) {
|
|
6608
6640
|
return cssShorthandProps.expand(cssProperty);
|
|
@@ -6638,23 +6670,6 @@ async function getPseudoElementCSSValue(elem, options) {
|
|
|
6638
6670
|
);
|
|
6639
6671
|
return cssValue2;
|
|
6640
6672
|
}
|
|
6641
|
-
async function getComputedStyleProperty(elem, cssProperty) {
|
|
6642
|
-
const browser = getBrowserObject19(elem);
|
|
6643
|
-
const cssValue2 = await browser.execute(
|
|
6644
|
-
(elem2, cssProperty2) => {
|
|
6645
|
-
if (!elem2) {
|
|
6646
|
-
return "";
|
|
6647
|
-
}
|
|
6648
|
-
if (typeof elem2.isConnected === "boolean" && !elem2.isConnected) {
|
|
6649
|
-
throw new Error("stale element reference: element is not attached to the page document");
|
|
6650
|
-
}
|
|
6651
|
-
return window.getComputedStyle(elem2)[cssProperty2];
|
|
6652
|
-
},
|
|
6653
|
-
elem,
|
|
6654
|
-
cssProperty
|
|
6655
|
-
);
|
|
6656
|
-
return cssValue2;
|
|
6657
|
-
}
|
|
6658
6673
|
|
|
6659
6674
|
// src/commands/element/getComputedRole.ts
|
|
6660
6675
|
function getComputedRole() {
|
|
@@ -6948,7 +6963,6 @@ function isElementClickable(elem) {
|
|
|
6948
6963
|
}
|
|
6949
6964
|
function getViewportScrollPositions() {
|
|
6950
6965
|
return {
|
|
6951
|
-
// Cross-browser compatibility
|
|
6952
6966
|
x: window.scrollX !== null && window.scrollX !== void 0 ? window.scrollX : window.pageXOffset,
|
|
6953
6967
|
y: window.scrollY !== null && window.scrollY !== void 0 ? window.scrollY : window.pageYOffset
|
|
6954
6968
|
};
|
|
@@ -7104,8 +7118,7 @@ function isElementDisplayed(element) {
|
|
|
7104
7118
|
}
|
|
7105
7119
|
return isElementInsideShadowRoot(element2.parentNode);
|
|
7106
7120
|
}
|
|
7107
|
-
if (!isElementInsideShadowRoot(element) &&
|
|
7108
|
-
(typeof document.contains === "function" ? !document.contains(element) : !document.body.contains(element))) {
|
|
7121
|
+
if (!isElementInsideShadowRoot(element) && (typeof document.contains === "function" ? !document.contains(element) : !document.body.contains(element))) {
|
|
7109
7122
|
return false;
|
|
7110
7123
|
}
|
|
7111
7124
|
switch (element.tagName.toUpperCase()) {
|
|
@@ -7126,8 +7139,8 @@ function isElementDisplayed(element) {
|
|
|
7126
7139
|
return false;
|
|
7127
7140
|
}
|
|
7128
7141
|
break;
|
|
7129
|
-
|
|
7130
|
-
|
|
7142
|
+
case "MAP":
|
|
7143
|
+
break;
|
|
7131
7144
|
default:
|
|
7132
7145
|
break;
|
|
7133
7146
|
}
|
|
@@ -7196,10 +7209,18 @@ async function isDisplayed(commandParams = DEFAULT_PARAMS) {
|
|
|
7196
7209
|
}
|
|
7197
7210
|
return result;
|
|
7198
7211
|
}),
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7212
|
+
browser.execute(function(elem) {
|
|
7213
|
+
var _a;
|
|
7214
|
+
try {
|
|
7215
|
+
const style = window.getComputedStyle(elem);
|
|
7216
|
+
return { value: (_a = style == null ? void 0 : style.display) != null ? _a : "" };
|
|
7217
|
+
} catch {
|
|
7218
|
+
if (typeof elem.isConnected === "boolean" && !elem.isConnected) {
|
|
7219
|
+
throw new Error("stale element reference: element is not attached to the page document");
|
|
7220
|
+
}
|
|
7221
|
+
return { value: "" };
|
|
7222
|
+
}
|
|
7223
|
+
}, this)
|
|
7203
7224
|
]);
|
|
7204
7225
|
const hasDisplayContentsCSSProperty = displayProperty.value === "contents";
|
|
7205
7226
|
const shouldRecheckContentVisibility = !hadToFallback && hasDisplayContentsCSSProperty;
|
|
@@ -9228,6 +9249,7 @@ var attach = async function(attachOptions) {
|
|
|
9228
9249
|
const params = {
|
|
9229
9250
|
automationProtocol: "webdriver",
|
|
9230
9251
|
...detectBackend(attachOptions.options),
|
|
9252
|
+
...attachOptions.options,
|
|
9231
9253
|
...attachOptions,
|
|
9232
9254
|
capabilities: attachOptions.capabilities || {},
|
|
9233
9255
|
requestedCapabilities: attachOptions.requestedCapabilities || {}
|
package/build/node.js
CHANGED
|
@@ -1038,12 +1038,30 @@ async function $(selector) {
|
|
|
1038
1038
|
|
|
1039
1039
|
// src/utils/actions/base.ts
|
|
1040
1040
|
import { ELEMENT_KEY as ELEMENT_KEY3 } from "webdriver";
|
|
1041
|
-
var
|
|
1041
|
+
var keyActionIds = 0;
|
|
1042
|
+
var pointerActionIds = 0;
|
|
1043
|
+
var wheelActionIds = 0;
|
|
1042
1044
|
var BaseAction = class {
|
|
1043
1045
|
constructor(instance, type, params) {
|
|
1044
1046
|
this.instance = instance;
|
|
1045
1047
|
this.#instance = instance;
|
|
1046
|
-
|
|
1048
|
+
if (params?.id) {
|
|
1049
|
+
this.#id = params.id;
|
|
1050
|
+
} else {
|
|
1051
|
+
switch (type) {
|
|
1052
|
+
case "key":
|
|
1053
|
+
this.#id = `key${++keyActionIds}`;
|
|
1054
|
+
break;
|
|
1055
|
+
case "pointer":
|
|
1056
|
+
this.#id = `pointer${++pointerActionIds}`;
|
|
1057
|
+
break;
|
|
1058
|
+
case "wheel":
|
|
1059
|
+
this.#id = `wheel${++wheelActionIds}`;
|
|
1060
|
+
break;
|
|
1061
|
+
default:
|
|
1062
|
+
this.#id = `action${type}`;
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1047
1065
|
this.#type = type;
|
|
1048
1066
|
this.#parameters = params?.parameters || {};
|
|
1049
1067
|
}
|
|
@@ -3968,13 +3986,14 @@ function parseOverwrite(overwrite, request) {
|
|
|
3968
3986
|
return result;
|
|
3969
3987
|
}
|
|
3970
3988
|
function getPatternParam(pattern, key) {
|
|
3971
|
-
|
|
3989
|
+
const value = pattern[key];
|
|
3990
|
+
if (value === "*" || value.includes("*")) {
|
|
3972
3991
|
return;
|
|
3973
3992
|
}
|
|
3974
3993
|
if (key === "port" && pattern.port === "") {
|
|
3975
3994
|
return pattern.protocol === "https" ? "443" : "80";
|
|
3976
3995
|
}
|
|
3977
|
-
return
|
|
3996
|
+
return value;
|
|
3978
3997
|
}
|
|
3979
3998
|
|
|
3980
3999
|
// src/utils/interception/index.ts
|
|
@@ -4042,6 +4061,11 @@ var WebDriverInterception = class _WebDriverInterception {
|
|
|
4042
4061
|
}
|
|
4043
4062
|
#handleBeforeRequestSent(request) {
|
|
4044
4063
|
if (!this.#isRequestMatching(request)) {
|
|
4064
|
+
if (request.intercepts?.includes(this.#mockId)) {
|
|
4065
|
+
return this.#browser.networkContinueRequest({
|
|
4066
|
+
request: request.request.request
|
|
4067
|
+
});
|
|
4068
|
+
}
|
|
4045
4069
|
return;
|
|
4046
4070
|
}
|
|
4047
4071
|
if (!this.#matchesFilterOptions(request)) {
|
|
@@ -4070,6 +4094,11 @@ var WebDriverInterception = class _WebDriverInterception {
|
|
|
4070
4094
|
}
|
|
4071
4095
|
#handleResponseStarted(request) {
|
|
4072
4096
|
if (!this.#isRequestMatching(request)) {
|
|
4097
|
+
if (request.intercepts?.includes(this.#mockId)) {
|
|
4098
|
+
return this.#browser.networkProvideResponse({
|
|
4099
|
+
request: request.request.request
|
|
4100
|
+
}).catch(this.#handleNetworkProvideResponseError);
|
|
4101
|
+
}
|
|
4073
4102
|
return;
|
|
4074
4103
|
}
|
|
4075
4104
|
if (!this.#matchesFilterOptions(request)) {
|
|
@@ -6185,10 +6214,12 @@ async function getCurrentContexts({
|
|
|
6185
6214
|
isAttachedAndVisible: isAndroidWebviewVisible,
|
|
6186
6215
|
packageName
|
|
6187
6216
|
});
|
|
6188
|
-
const
|
|
6189
|
-
isPackageNameMissing =
|
|
6190
|
-
const
|
|
6191
|
-
const
|
|
6217
|
+
const matchingContexts = parsedContexts.filter((context) => context.packageName === packageName);
|
|
6218
|
+
isPackageNameMissing = matchingContexts.length === 0;
|
|
6219
|
+
const hasAndroidWebviewData = matchingContexts.some((context) => Boolean(context.androidWebviewData));
|
|
6220
|
+
const isAndroidWebviewDataMissing = matchingContexts.length > 0 && !hasAndroidWebviewData;
|
|
6221
|
+
const hasNonEmptyAndroidWebviewData = matchingContexts.some((context) => context.androidWebviewData && !context.androidWebviewData.empty);
|
|
6222
|
+
const isAndroidWebviewDataEmpty = matchingContexts.length > 0 && hasAndroidWebviewData && !hasNonEmptyAndroidWebviewData;
|
|
6192
6223
|
if (packageName === CHROME_PACKAGE_NAME) {
|
|
6193
6224
|
return parsedContexts;
|
|
6194
6225
|
}
|
|
@@ -6630,7 +6661,7 @@ async function getShorthandPropertyCSSValue(options) {
|
|
|
6630
6661
|
return mergeEqualSymmetricalValue(cssValues2);
|
|
6631
6662
|
}
|
|
6632
6663
|
const cssValues = await Promise.all(
|
|
6633
|
-
properties.map((prop) =>
|
|
6664
|
+
properties.map((prop) => this.getElementCSSValue(this.elementId, prop))
|
|
6634
6665
|
);
|
|
6635
6666
|
return mergeEqualSymmetricalValue(cssValues);
|
|
6636
6667
|
}
|
|
@@ -6645,7 +6676,7 @@ async function getPropertyCSSValue(options) {
|
|
|
6645
6676
|
}
|
|
6646
6677
|
);
|
|
6647
6678
|
}
|
|
6648
|
-
return await
|
|
6679
|
+
return await this.getElementCSSValue(this.elementId, cssProperty);
|
|
6649
6680
|
}
|
|
6650
6681
|
function getShorthandProperties(cssProperty) {
|
|
6651
6682
|
return cssShorthandProps.expand(cssProperty);
|
|
@@ -6681,23 +6712,6 @@ async function getPseudoElementCSSValue(elem, options) {
|
|
|
6681
6712
|
);
|
|
6682
6713
|
return cssValue2;
|
|
6683
6714
|
}
|
|
6684
|
-
async function getComputedStyleProperty(elem, cssProperty) {
|
|
6685
|
-
const browser = getBrowserObject20(elem);
|
|
6686
|
-
const cssValue2 = await browser.execute(
|
|
6687
|
-
(elem2, cssProperty2) => {
|
|
6688
|
-
if (!elem2) {
|
|
6689
|
-
return "";
|
|
6690
|
-
}
|
|
6691
|
-
if (typeof elem2.isConnected === "boolean" && !elem2.isConnected) {
|
|
6692
|
-
throw new Error("stale element reference: element is not attached to the page document");
|
|
6693
|
-
}
|
|
6694
|
-
return window.getComputedStyle(elem2)[cssProperty2];
|
|
6695
|
-
},
|
|
6696
|
-
elem,
|
|
6697
|
-
cssProperty
|
|
6698
|
-
);
|
|
6699
|
-
return cssValue2;
|
|
6700
|
-
}
|
|
6701
6715
|
|
|
6702
6716
|
// src/commands/element/getComputedRole.ts
|
|
6703
6717
|
function getComputedRole() {
|
|
@@ -6924,10 +6938,17 @@ async function isDisplayed(commandParams = DEFAULT_PARAMS) {
|
|
|
6924
6938
|
}
|
|
6925
6939
|
return result;
|
|
6926
6940
|
}),
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
6941
|
+
browser.execute(function(elem) {
|
|
6942
|
+
try {
|
|
6943
|
+
const style = window.getComputedStyle(elem);
|
|
6944
|
+
return { value: style?.display ?? "" };
|
|
6945
|
+
} catch {
|
|
6946
|
+
if (typeof elem.isConnected === "boolean" && !elem.isConnected) {
|
|
6947
|
+
throw new Error("stale element reference: element is not attached to the page document");
|
|
6948
|
+
}
|
|
6949
|
+
return { value: "" };
|
|
6950
|
+
}
|
|
6951
|
+
}, this)
|
|
6931
6952
|
]);
|
|
6932
6953
|
const hasDisplayContentsCSSProperty = displayProperty.value === "contents";
|
|
6933
6954
|
const shouldRecheckContentVisibility = !hadToFallback && hasDisplayContentsCSSProperty;
|
|
@@ -8912,6 +8933,7 @@ var attach = async function(attachOptions) {
|
|
|
8912
8933
|
const params = {
|
|
8913
8934
|
automationProtocol: "webdriver",
|
|
8914
8935
|
...detectBackend(attachOptions.options),
|
|
8936
|
+
...attachOptions.options,
|
|
8915
8937
|
...attachOptions,
|
|
8916
8938
|
capabilities: attachOptions.capabilities || {},
|
|
8917
8939
|
requestedCapabilities: attachOptions.requestedCapabilities || {}
|
|
@@ -87,7 +87,6 @@ function isElementClickable(elem) {
|
|
|
87
87
|
}
|
|
88
88
|
function getViewportScrollPositions() {
|
|
89
89
|
return {
|
|
90
|
-
// Cross-browser compatibility
|
|
91
90
|
x: window.scrollX !== null && window.scrollX !== void 0 ? window.scrollX : window.pageXOffset,
|
|
92
91
|
y: window.scrollY !== null && window.scrollY !== void 0 ? window.scrollY : window.pageYOffset
|
|
93
92
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isElementDisplayed.d.ts","sourceRoot":"","sources":["../../src/scripts/isElementDisplayed.ts"],"names":[],"mappings":"AAyBA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAE,OAAO,EAAE,OAAO,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"isElementDisplayed.d.ts","sourceRoot":"","sources":["../../src/scripts/isElementDisplayed.ts"],"names":[],"mappings":"AAyBA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAsPrE"}
|
|
@@ -116,8 +116,7 @@ function isElementDisplayed(element) {
|
|
|
116
116
|
}
|
|
117
117
|
return isElementInsideShadowRoot(element2.parentNode);
|
|
118
118
|
}
|
|
119
|
-
if (!isElementInsideShadowRoot(element) &&
|
|
120
|
-
(typeof document.contains === "function" ? !document.contains(element) : !document.body.contains(element))) {
|
|
119
|
+
if (!isElementInsideShadowRoot(element) && (typeof document.contains === "function" ? !document.contains(element) : !document.body.contains(element))) {
|
|
121
120
|
return false;
|
|
122
121
|
}
|
|
123
122
|
switch (element.tagName.toUpperCase()) {
|
|
@@ -138,8 +137,8 @@ function isElementDisplayed(element) {
|
|
|
138
137
|
return false;
|
|
139
138
|
}
|
|
140
139
|
break;
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
case "MAP":
|
|
141
|
+
break;
|
|
143
142
|
default:
|
|
144
143
|
break;
|
|
145
144
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/base.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAEvD,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,CAAA;AACpD,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,KAAK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U;;IAQvB,SAAS,CAAC,QAAQ,EAAE,WAAW,CAAC,OAAO;IAH3C,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAK;gBAGrB,QAAQ,EAAE,WAAW,CAAC,OAAO,EACvC,IAAI,EAAE,UAAU,EAChB,MAAM,CAAC,EAAE,gBAAgB;IA+B7B,MAAM;;;;;;IASN;;;OAGG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM;IAKtB;;;OAGG;IACG,OAAO,CAAC,WAAW,UAAQ;CAiCpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/interception/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAKhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAMpD,KAAK,WAAW,GAAG,MAAM,GAAG,cAAc,GAAG,MAAM,CAAA;AAOnD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAqB;;gBAclC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,iBAAiB,EAChC,OAAO,EAAE,WAAW,CAAC,OAAO;WAcnB,QAAQ,CACjB,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,iBAAiB,EAChC,OAAO,EAAE,WAAW,CAAC,OAAO;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/interception/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAA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
|
"description": "Next-gen browser and mobile automation test framework for Node.js",
|
|
4
|
-
"version": "9.
|
|
4
|
+
"version": "9.22.0",
|
|
5
5
|
"homepage": "https://webdriver.io",
|
|
6
6
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -77,12 +77,12 @@
|
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@types/node": "^20.11.30",
|
|
79
79
|
"@types/sinonjs__fake-timers": "^8.1.5",
|
|
80
|
-
"@wdio/config": "9.
|
|
80
|
+
"@wdio/config": "9.22.0",
|
|
81
81
|
"@wdio/logger": "9.18.0",
|
|
82
82
|
"@wdio/protocols": "9.16.2",
|
|
83
83
|
"@wdio/repl": "9.16.2",
|
|
84
84
|
"@wdio/types": "9.20.0",
|
|
85
|
-
"@wdio/utils": "9.
|
|
85
|
+
"@wdio/utils": "9.22.0",
|
|
86
86
|
"archiver": "^7.0.1",
|
|
87
87
|
"aria-query": "^5.3.0",
|
|
88
88
|
"cheerio": "^1.0.0-rc.12",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"rgb2hex": "0.2.5",
|
|
100
100
|
"serialize-error": "^12.0.0",
|
|
101
101
|
"urlpattern-polyfill": "^10.0.0",
|
|
102
|
-
"webdriver": "9.
|
|
102
|
+
"webdriver": "9.22.0"
|
|
103
103
|
},
|
|
104
104
|
"peerDependencies": {
|
|
105
105
|
"puppeteer-core": ">=22.x || <=24.x"
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
"optional": true
|
|
110
110
|
}
|
|
111
111
|
},
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "1c858cd9cfb667283c325c4ac722a0227138acc0"
|
|
113
113
|
}
|