webdriverio 8.16.20 → 8.17.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/browser/uploadFile.d.ts.map +1 -1
- package/build/commands/element/isDisplayed.d.ts.map +1 -1
- package/build/middlewares.d.ts.map +1 -1
- package/build/utils/actions/key.d.ts.map +1 -1
- package/build/utils/findStrategy.d.ts.map +1 -1
- package/build/utils/findStrategy.js +12 -3
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploadFile.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/uploadFile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uploadFile.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/uploadFile.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,UAAU,CAC5B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CA6BjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isDisplayed.d.ts","sourceRoot":"","sources":["../../../src/commands/element/isDisplayed.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isDisplayed.d.ts","sourceRoot":"","sources":["../../../src/commands/element/isDisplayed.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAsB,WAAW,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,oBAgC3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middlewares.d.ts","sourceRoot":"","sources":["../src/middlewares.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"middlewares.d.ts","sourceRoot":"","sources":["../src/middlewares.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,OAAQ,QAAQ,mBAAmB,MAAM,aAAa,QAAQ,YACvC,mBAAmB,WAAW,GAAG,EAAE,QAsCzF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,gBACd,QAAQ,mBACN,MAAM,YAAY,OAAO,QAU3C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/key.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/key.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,UAAU,MAAM,WAAW,CAAA;AAGlC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,UAAU;;gBAChC,QAAQ,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,gBAAgB;IA4BrE;;;OAGG;IACH,EAAE,CAAE,KAAK,EAAE,MAAM;IAKjB;;;OAGG;IACH,IAAI,CAAE,KAAK,EAAE,MAAM;CAItB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findStrategy.d.ts","sourceRoot":"","sources":["../../src/utils/findStrategy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"findStrategy.d.ts","sourceRoot":"","sources":["../../src/utils/findStrategy.ts"],"names":[],"mappings":"AA8BA,KAAK,gBAAgB,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AA4F/D,eAAO,MAAM,YAAY,aAAuB,gBAAgB,UAAU,OAAO,aAAa,OAAO;;;CA8LpG,CAAA"}
|
|
@@ -16,6 +16,8 @@ const XPATH_SELECTOR_REGEXP = [
|
|
|
16
16
|
/(?:(\.|#)(-?[_a-zA-Z]+[_a-zA-Z0-9-]*))?/,
|
|
17
17
|
// optional [attribute-name="attribute-selector"]
|
|
18
18
|
/(?:\[(-?[_a-zA-Z]+[_a-zA-Z0-9-]*)(?:=(?:"|')([a-zA-z0-9\-_. ]+)(?:"|'))?\])?/,
|
|
19
|
+
// optional case insensitive
|
|
20
|
+
/(\.)?/,
|
|
19
21
|
// *=query or =query
|
|
20
22
|
/(\*)?=(.+)$/,
|
|
21
23
|
];
|
|
@@ -239,7 +241,7 @@ export const findStrategy = function (selector, isW3C, isMobile) {
|
|
|
239
241
|
}
|
|
240
242
|
const PREFIX_NAME = { '.': 'class', '#': 'id' };
|
|
241
243
|
const conditions = [];
|
|
242
|
-
const [tag, prefix, name, attrName, attrValue, partial, query] = match.slice(1);
|
|
244
|
+
const [tag, prefix, name, attrName, attrValue, insensitive, partial, query] = match.slice(1);
|
|
243
245
|
if (prefix) {
|
|
244
246
|
if (prefix === '.') {
|
|
245
247
|
// trick to match a class name exactly
|
|
@@ -255,12 +257,19 @@ export const findStrategy = function (selector, isW3C, isMobile) {
|
|
|
255
257
|
: `@${attrName}`);
|
|
256
258
|
}
|
|
257
259
|
const partialNot = ` and not(${`.//${tag || '*'}${conditions.length ? `[${conditions.join(' and ')}]` : ''}`})`;
|
|
258
|
-
|
|
260
|
+
if (insensitive) {
|
|
261
|
+
conditions.push(partial
|
|
262
|
+
? `contains(translate(., "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz"), "${query.toLowerCase()}")${partialNot}`
|
|
263
|
+
: `normalize-space(translate(text(), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz")) = "${query.toLowerCase()}"`);
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
conditions.push(partial ? `contains(., "${query}")${partialNot}` : `normalize-space(text()) = "${query}"`);
|
|
267
|
+
}
|
|
259
268
|
const getValue = () => `.//${tag || '*'}[${conditions.join(' and ')}]`;
|
|
260
269
|
value = getValue();
|
|
261
270
|
if (!partial) {
|
|
262
271
|
conditions.pop();
|
|
263
|
-
conditions.push(`not(${value})`, `normalize-space() = "${query}"`);
|
|
272
|
+
conditions.push(`not(${value})`, `normalize-space() = "${insensitive ? query.toLowerCase() : query}"`);
|
|
264
273
|
value = value + ' | ' + getValue();
|
|
265
274
|
}
|
|
266
275
|
break;
|
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": "8.
|
|
4
|
+
"version": "8.17.0",
|
|
5
5
|
"homepage": "https://webdriver.io",
|
|
6
6
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -68,17 +68,17 @@
|
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@types/node": "^20.1.0",
|
|
71
|
-
"@wdio/config": "8.
|
|
71
|
+
"@wdio/config": "8.17.0",
|
|
72
72
|
"@wdio/logger": "8.16.17",
|
|
73
73
|
"@wdio/protocols": "8.16.5",
|
|
74
74
|
"@wdio/repl": "8.10.1",
|
|
75
|
-
"@wdio/types": "8.
|
|
76
|
-
"@wdio/utils": "8.
|
|
75
|
+
"@wdio/types": "8.17.0",
|
|
76
|
+
"@wdio/utils": "8.17.0",
|
|
77
77
|
"archiver": "^6.0.0",
|
|
78
78
|
"aria-query": "^5.0.0",
|
|
79
79
|
"css-shorthand-properties": "^1.1.1",
|
|
80
80
|
"css-value": "^0.0.1",
|
|
81
|
-
"devtools-protocol": "^0.0.
|
|
81
|
+
"devtools-protocol": "^0.0.1206220",
|
|
82
82
|
"grapheme-splitter": "^1.0.2",
|
|
83
83
|
"import-meta-resolve": "^3.0.0",
|
|
84
84
|
"is-plain-obj": "^4.1.0",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"resq": "^1.9.1",
|
|
91
91
|
"rgb2hex": "0.2.5",
|
|
92
92
|
"serialize-error": "^11.0.1",
|
|
93
|
-
"webdriver": "8.
|
|
93
|
+
"webdriver": "8.17.0"
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|
|
96
96
|
"devtools": "^8.14.0"
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"optional": true
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "f7fe9474c580fc2003f6abca130e44ed025b1bd5"
|
|
104
104
|
}
|