webdriverio 7.21.0 → 7.24.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/$$.d.ts +10 -1
- package/build/commands/browser/$$.d.ts.map +1 -1
- package/build/commands/browser/$$.js +11 -1
- package/build/commands/browser/custom$.d.ts +1 -1
- package/build/commands/browser/custom$.js +1 -1
- package/build/commands/element/isClickable.d.ts.map +1 -1
- package/build/commands/element/isClickable.js +3 -0
- package/build/commands/element/isEqual.d.ts.map +1 -1
- package/build/commands/element/isEqual.js +4 -1
- package/build/constants.d.ts +1 -0
- package/build/constants.d.ts.map +1 -1
- package/build/constants.js +2 -1
- package/build/scripts/isElementDisplayed.js +1 -1
- package/build/utils/findStrategy.d.ts.map +1 -1
- package/build/utils/findStrategy.js +40 -1
- package/build/utils/getElementObject.d.ts +1 -1
- package/build/utils/getElementObject.d.ts.map +1 -1
- package/build/utils/getElementObject.js +9 -1
- package/build/utils/index.d.ts +1 -1
- package/build/utils/index.d.ts.map +1 -1
- package/build/utils/index.js +7 -1
- package/package.json +10 -10
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ElementReference } from '@wdio/protocols';
|
|
1
2
|
import type { Selector, ElementArray } from '../../types';
|
|
2
3
|
/**
|
|
3
4
|
* The `$$` command is a short way to call the [`findElements`](/docs/api/webdriver#findelements) command in order
|
|
@@ -38,6 +39,14 @@ import type { Selector, ElementArray } from '../../types';
|
|
|
38
39
|
})[0];
|
|
39
40
|
console.log(await text.$$('li')[2].$('a').getText()); // outputs: "API"
|
|
40
41
|
});
|
|
42
|
+
|
|
43
|
+
it('can create element array out of single elements', async () => {
|
|
44
|
+
const red = await $('.red');
|
|
45
|
+
const green = await $('.green');
|
|
46
|
+
const elems = $$([red, green]);
|
|
47
|
+
console.log(await elems.map((e) => e.getAttribute('class')));
|
|
48
|
+
// returns "[ 'box red ui-droppable', 'box green' ]"
|
|
49
|
+
});
|
|
41
50
|
* </example>
|
|
42
51
|
*
|
|
43
52
|
* @alias $$
|
|
@@ -46,5 +55,5 @@ import type { Selector, ElementArray } from '../../types';
|
|
|
46
55
|
* @type utility
|
|
47
56
|
*
|
|
48
57
|
*/
|
|
49
|
-
export default function $$(this: WebdriverIO.Browser | WebdriverIO.Element, selector: Selector): Promise<ElementArray>;
|
|
58
|
+
export default function $$(this: WebdriverIO.Browser | WebdriverIO.Element, selector: Selector | ElementReference[] | WebdriverIO.Element[]): Promise<ElementArray>;
|
|
50
59
|
//# sourceMappingURL=$$.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"$$.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/$$.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"$$.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/$$.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAIvD,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,wBAA8B,EAAE,CAC5B,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,EAC/C,QAAQ,EAAE,QAAQ,GAAG,gBAAgB,EAAE,GAAG,WAAW,CAAC,OAAO,EAAE,yBAOlE"}
|
|
@@ -41,6 +41,14 @@ const getElementObject_1 = require("../../utils/getElementObject");
|
|
|
41
41
|
})[0];
|
|
42
42
|
console.log(await text.$$('li')[2].$('a').getText()); // outputs: "API"
|
|
43
43
|
});
|
|
44
|
+
|
|
45
|
+
it('can create element array out of single elements', async () => {
|
|
46
|
+
const red = await $('.red');
|
|
47
|
+
const green = await $('.green');
|
|
48
|
+
const elems = $$([red, green]);
|
|
49
|
+
console.log(await elems.map((e) => e.getAttribute('class')));
|
|
50
|
+
// returns "[ 'box red ui-droppable', 'box green' ]"
|
|
51
|
+
});
|
|
44
52
|
* </example>
|
|
45
53
|
*
|
|
46
54
|
* @alias $$
|
|
@@ -50,7 +58,9 @@ const getElementObject_1 = require("../../utils/getElementObject");
|
|
|
50
58
|
*
|
|
51
59
|
*/
|
|
52
60
|
async function $$(selector) {
|
|
53
|
-
const res =
|
|
61
|
+
const res = Array.isArray(selector)
|
|
62
|
+
? selector
|
|
63
|
+
: await utils_1.findElements.call(this, selector);
|
|
54
64
|
const elements = await getElementObject_1.getElements.call(this, selector, res);
|
|
55
65
|
return (0, utils_1.enhanceElementsArray)(elements, this, selector);
|
|
56
66
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
:example.js
|
|
7
7
|
it('should fetch the project title', async () => {
|
|
8
8
|
await browser.url('https://webdriver.io')
|
|
9
|
-
|
|
9
|
+
browser.addLocatorStrategy('myStrat', (selector) => {
|
|
10
10
|
return document.querySelectorAll(selector)
|
|
11
11
|
})
|
|
12
12
|
|
|
@@ -10,7 +10,7 @@ const constants_1 = require("../../constants");
|
|
|
10
10
|
:example.js
|
|
11
11
|
it('should fetch the project title', async () => {
|
|
12
12
|
await browser.url('https://webdriver.io')
|
|
13
|
-
|
|
13
|
+
browser.addLocatorStrategy('myStrat', (selector) => {
|
|
14
14
|
return document.querySelectorAll(selector)
|
|
15
15
|
})
|
|
16
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isClickable.d.ts","sourceRoot":"","sources":["../../../src/commands/element/isClickable.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAA8B,WAAW,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"isClickable.d.ts","sourceRoot":"","sources":["../../../src/commands/element/isClickable.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAA8B,WAAW,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,oBAcnE"}
|
|
@@ -48,6 +48,9 @@ async function isClickable() {
|
|
|
48
48
|
if (!await this.isDisplayed()) {
|
|
49
49
|
return false;
|
|
50
50
|
}
|
|
51
|
+
if (this.isMobile && await this.getContext() === 'NATIVE_APP') {
|
|
52
|
+
throw new Error('Method not supported in mobile native environment. It is unlikely that you need to use this command.');
|
|
53
|
+
}
|
|
51
54
|
const browser = (0, utils_1.getBrowserObject)(this);
|
|
52
55
|
return browser.execute(isElementClickable_1.default, {
|
|
53
56
|
[constants_1.ELEMENT_KEY]: this.elementId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isEqual.d.ts","sourceRoot":"","sources":["../../../src/commands/element/isEqual.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAA8B,OAAO,CACjC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,EAAE,EAAE,WAAW,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"isEqual.d.ts","sourceRoot":"","sources":["../../../src/commands/element/isEqual.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAA8B,OAAO,CACjC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,EAAE,EAAE,WAAW,CAAC,OAAO,oBA4B1B"}
|
|
@@ -33,7 +33,10 @@ async function isEqual(el) {
|
|
|
33
33
|
// mobile native
|
|
34
34
|
if (browser.isMobile) {
|
|
35
35
|
const context = await browser.getContext();
|
|
36
|
-
|
|
36
|
+
const contextId = typeof context === 'string'
|
|
37
|
+
? context
|
|
38
|
+
: context === null || context === void 0 ? void 0 : context.id;
|
|
39
|
+
if (contextId && contextId.toLowerCase().includes('native')) {
|
|
37
40
|
return this.elementId === el.elementId;
|
|
38
41
|
}
|
|
39
42
|
}
|
package/build/constants.d.ts
CHANGED
|
@@ -10,5 +10,6 @@ export declare const DRIVER_DEFAULT_ENDPOINT: {
|
|
|
10
10
|
};
|
|
11
11
|
export declare const FF_REMOTE_DEBUG_ARG = "-remote-debugging-port";
|
|
12
12
|
export declare const DEEP_SELECTOR = ">>>";
|
|
13
|
+
export declare const ARIA_SELECTOR = "aria/";
|
|
13
14
|
export declare const ERROR_REASON: string[];
|
|
14
15
|
//# sourceMappingURL=constants.d.ts.map
|
package/build/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAqC,MAAM,aAAa,CAAA;AA4B7E,eAAO,MAAM,WAAW,wCAAwC,CAAA;AAEhE,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,CAuQtF,CAAA;AAED,eAAO,MAAM,uBAAuB,UAA0E,CAAA;AAE9G,eAAO,MAAM,uBAAuB;;;;;CAKnC,CAAA;AAED,eAAO,MAAM,mBAAmB,2BAA2B,CAAA;AAC3D,eAAO,MAAM,aAAa,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAqC,MAAM,aAAa,CAAA;AA4B7E,eAAO,MAAM,WAAW,wCAAwC,CAAA;AAEhE,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,CAuQtF,CAAA;AAED,eAAO,MAAM,uBAAuB,UAA0E,CAAA;AAE9G,eAAO,MAAM,uBAAuB;;;;;CAKnC,CAAA;AAED,eAAO,MAAM,mBAAmB,2BAA2B,CAAA;AAC3D,eAAO,MAAM,aAAa,QAAQ,CAAA;AAClC,eAAO,MAAM,aAAa,UAAU,CAAA;AAEpC,eAAO,MAAM,YAAY,UAKxB,CAAA"}
|
package/build/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ERROR_REASON = exports.DEEP_SELECTOR = exports.FF_REMOTE_DEBUG_ARG = exports.DRIVER_DEFAULT_ENDPOINT = exports.W3C_SELECTOR_STRATEGIES = exports.WDIO_DEFAULTS = exports.ELEMENT_KEY = void 0;
|
|
3
|
+
exports.ERROR_REASON = exports.ARIA_SELECTOR = exports.DEEP_SELECTOR = exports.FF_REMOTE_DEBUG_ARG = exports.DRIVER_DEFAULT_ENDPOINT = exports.W3C_SELECTOR_STRATEGIES = exports.WDIO_DEFAULTS = exports.ELEMENT_KEY = void 0;
|
|
4
4
|
/* istanbul ignore next */
|
|
5
5
|
const HOOK_DEFINITION = {
|
|
6
6
|
type: 'object',
|
|
@@ -279,6 +279,7 @@ exports.DRIVER_DEFAULT_ENDPOINT = {
|
|
|
279
279
|
};
|
|
280
280
|
exports.FF_REMOTE_DEBUG_ARG = '-remote-debugging-port';
|
|
281
281
|
exports.DEEP_SELECTOR = '>>>';
|
|
282
|
+
exports.ARIA_SELECTOR = 'aria/';
|
|
282
283
|
exports.ERROR_REASON = [
|
|
283
284
|
'Failed', 'Aborted', 'TimedOut', 'AccessDenied', 'ConnectionClosed',
|
|
284
285
|
'ConnectionReset', 'ConnectionRefused', 'ConnectionAborted',
|
|
@@ -70,7 +70,7 @@ function isElementDisplayed(element) {
|
|
|
70
70
|
// if document-fragment, skip it and use element.host instead. This happens
|
|
71
71
|
// when the element is inside a shadow root.
|
|
72
72
|
// window.getComputedStyle errors on document-fragment.
|
|
73
|
-
if (element instanceof
|
|
73
|
+
if (element instanceof ShadowRoot) {
|
|
74
74
|
element = element.host;
|
|
75
75
|
}
|
|
76
76
|
let computedStyle = window.getComputedStyle(element);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findStrategy.d.ts","sourceRoot":"","sources":["../../src/utils/findStrategy.ts"],"names":[],"mappings":"AA4BA,aAAK,gBAAgB,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"findStrategy.d.ts","sourceRoot":"","sources":["../../src/utils/findStrategy.ts"],"names":[],"mappings":"AA4BA,aAAK,gBAAgB,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AA2F/D,eAAO,MAAM,YAAY,aAAuB,gBAAgB,UAAU,OAAO,aAAa,OAAO;;;CAuKpG,CAAA"}
|
|
@@ -71,6 +71,10 @@ const defineStrategy = function (selector) {
|
|
|
71
71
|
if (stringSelector.startsWith(constants_1.DEEP_SELECTOR)) {
|
|
72
72
|
return 'shadow';
|
|
73
73
|
}
|
|
74
|
+
// use aria selector
|
|
75
|
+
if (stringSelector.startsWith(constants_1.ARIA_SELECTOR)) {
|
|
76
|
+
return 'aria';
|
|
77
|
+
}
|
|
74
78
|
// Recursive element search using the UiAutomator library (Android only)
|
|
75
79
|
if (stringSelector.startsWith('android=')) {
|
|
76
80
|
return '-android uiautomator';
|
|
@@ -121,7 +125,7 @@ const findStrategy = function (selector, isW3C, isMobile) {
|
|
|
121
125
|
// user has specified locator strategy directly
|
|
122
126
|
case 'directly': {
|
|
123
127
|
const match = stringSelector.match(DIRECT_SELECTOR_REGEXP);
|
|
124
|
-
if (!match
|
|
128
|
+
if (!match) {
|
|
125
129
|
throw new Error('InvalidSelectorStrategy'); // ToDo: move error to wdio-error package
|
|
126
130
|
}
|
|
127
131
|
using = match[1];
|
|
@@ -151,6 +155,41 @@ const findStrategy = function (selector, isW3C, isMobile) {
|
|
|
151
155
|
using = 'shadow';
|
|
152
156
|
value = stringSelector.slice(constants_1.DEEP_SELECTOR.length);
|
|
153
157
|
break;
|
|
158
|
+
case 'aria': {
|
|
159
|
+
const label = stringSelector.slice(constants_1.ARIA_SELECTOR.length);
|
|
160
|
+
const conditions = [
|
|
161
|
+
// aria label is recevied by other element with aria-labelledBy
|
|
162
|
+
// https://www.w3.org/TR/accname-1.1/#step2B
|
|
163
|
+
`.//*[@aria-labelledby=(//*[normalize-space() = "${label}"]/@id)]`,
|
|
164
|
+
// aria label is recevied by other element with aria-labelledBy
|
|
165
|
+
// https://www.w3.org/TR/accname-1.1/#step2B
|
|
166
|
+
`.//*[@aria-describedby=(//*[normalize-space() = "${label}"]/@id)]`,
|
|
167
|
+
// element has direct aria label
|
|
168
|
+
// https://www.w3.org/TR/accname-1.1/#step2C
|
|
169
|
+
`.//*[@aria-label = "${label}"]`,
|
|
170
|
+
// inputs with a label
|
|
171
|
+
// https://www.w3.org/TR/accname-1.1/#step2D
|
|
172
|
+
`.//input[@id = (//label[normalize-space() = "${label}"]/@for)]`,
|
|
173
|
+
// aria label is received by an input placeholder
|
|
174
|
+
// https://www.w3.org/TR/accname-1.1/#step2D
|
|
175
|
+
`.//input[@placeholder="${label}"]`,
|
|
176
|
+
// aria label is received by an input placeholder
|
|
177
|
+
// https://www.w3.org/TR/accname-1.1/#step2D
|
|
178
|
+
`.//input[@aria-placeholder="${label}"]`,
|
|
179
|
+
// aria label is received by its title attribute
|
|
180
|
+
// https://www.w3.org/TR/accname-1.1/#step2D
|
|
181
|
+
`.//*[@title="${label}"]`,
|
|
182
|
+
// images with an alt tag
|
|
183
|
+
// https://www.w3.org/TR/accname-1.1/#step2D
|
|
184
|
+
`.//img[@alt="${label}"]`,
|
|
185
|
+
// aria label is received from element content
|
|
186
|
+
// https://www.w3.org/TR/accname-1.1/#step2G
|
|
187
|
+
`.//*[normalize-space() = "${label}"]`
|
|
188
|
+
];
|
|
189
|
+
using = 'xpath';
|
|
190
|
+
value = `(${conditions.join(' | ')})[1]`;
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
154
193
|
case '-android uiautomator': {
|
|
155
194
|
using = '-android uiautomator';
|
|
156
195
|
value = stringSelector.slice(8);
|
|
@@ -13,5 +13,5 @@ export declare const getElement: (this: WebdriverIO.Browser | WebdriverIO.Elemen
|
|
|
13
13
|
* @param {Object} res findElements response
|
|
14
14
|
* @return {Array} array of WDIO elements
|
|
15
15
|
*/
|
|
16
|
-
export declare const getElements: (this: WebdriverIO.Browser | WebdriverIO.Element, selector: Selector, elemResponse: ElementReference[], isReactElement?: boolean) => ElementArray;
|
|
16
|
+
export declare const getElements: (this: WebdriverIO.Browser | WebdriverIO.Element, selector: Selector | ElementReference[] | WebdriverIO.Element[], elemResponse: ElementReference[], isReactElement?: boolean) => ElementArray;
|
|
17
17
|
//# sourceMappingURL=getElementObject.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getElementObject.d.ts","sourceRoot":"","sources":["../../src/utils/getElementObject.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAKvD,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,SACb,YAAY,OAAO,GAAG,mBAAmB,aACpC,QAAQ,QACb,gBAAgB,GAAG,KAAK,+BAE/B,mBA8CF,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,SACd,YAAY,OAAO,GAAG,mBAAmB,YACrC,QAAQ,
|
|
1
|
+
{"version":3,"file":"getElementObject.d.ts","sourceRoot":"","sources":["../../src/utils/getElementObject.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAKvD,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,SACb,YAAY,OAAO,GAAG,mBAAmB,aACpC,QAAQ,QACb,gBAAgB,GAAG,KAAK,+BAE/B,mBA8CF,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,SACd,YAAY,OAAO,GAAG,mBAAmB,YACrC,QAAQ,GAAG,gBAAgB,EAAE,GAAG,mBAAmB,EAAE,gBACjD,gBAAgB,EAAE,+BAEjC,YAwDF,CAAA"}
|
|
@@ -70,6 +70,12 @@ const getElements = function getElements(selector, elemResponse, isReactElement
|
|
|
70
70
|
...(0, _1.getPrototype)('element')
|
|
71
71
|
};
|
|
72
72
|
const elements = elemResponse.map((res, i) => {
|
|
73
|
+
/**
|
|
74
|
+
* if we already deal with an element, just return it
|
|
75
|
+
*/
|
|
76
|
+
if (res.selector) {
|
|
77
|
+
return res;
|
|
78
|
+
}
|
|
73
79
|
propertiesObject.scope = { value: 'element' };
|
|
74
80
|
const element = (0, utils_1.webdriverMonad)(this.options, (client) => {
|
|
75
81
|
const elementId = (0, _1.getElementFromResponse)(res);
|
|
@@ -87,7 +93,9 @@ const getElements = function getElements(selector, elemResponse, isReactElement
|
|
|
87
93
|
else {
|
|
88
94
|
client.error = res;
|
|
89
95
|
}
|
|
90
|
-
client.selector = selector
|
|
96
|
+
client.selector = Array.isArray(selector)
|
|
97
|
+
? selector[i].selector
|
|
98
|
+
: selector;
|
|
91
99
|
client.parent = this;
|
|
92
100
|
client.index = i;
|
|
93
101
|
client.emit = this.emit.bind(this);
|
package/build/utils/index.d.ts
CHANGED
|
@@ -79,7 +79,7 @@ export declare function addLocatorStrategyHandler(scope: WebdriverIO.Browser | W
|
|
|
79
79
|
* @param {Array} props additional properties required to fetch elements again
|
|
80
80
|
* @returns {object[]} elements
|
|
81
81
|
*/
|
|
82
|
-
export declare const enhanceElementsArray: (elements: ElementArray, parent: WebdriverIO.Browser | WebdriverIO.Element, selector: Selector, foundWith?: string, props?: any[]) => ElementArray;
|
|
82
|
+
export declare const enhanceElementsArray: (elements: ElementArray, parent: WebdriverIO.Browser | WebdriverIO.Element, selector: Selector | ElementReference[] | WebdriverIO.Element[], foundWith?: string, props?: any[]) => ElementArray;
|
|
83
83
|
/**
|
|
84
84
|
* is protocol stub
|
|
85
85
|
* @param {string} automationProtocol
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,aAAa,CAAA;AAKxD,OAAO,KAAK,EAAE,YAAY,EAAmB,QAAQ,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAA;AAsBjH;;GAEG;AACH,eAAO,MAAM,YAAY,UAAW,SAAS,GAAG,SAAS,uCAmBxD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,QAAS,gBAAgB,QAuB3D,CAAA;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,CAGtG;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAE,KAAK,EAAE,GAAG,EAAE,kBAAkB,UAAO,YA0B3E;AAWD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,kBAkDvE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CACxB,KAAK,EAAE,MAAM,EACb,UAAU,UAAQ,YAKrB;AAkBD;;GAEG;AACH,wBAAsB,WAAW,CAC7B,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,EAC/C,QAAQ,EAAE,QAAQ,qCAmDrB;AAED;;GAEG;AACH,wBAAsB,YAAY,CAC9B,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,EAC/C,QAAQ,EAAE,QAAQ,+BAgDrB;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,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,UAOjG;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,aACnB,YAAY,UACd,YAAY,OAAO,GAAG,mBAAmB,YACvC,QAAQ,GAAG,gBAAgB,EAAE,GAAG,mBAAmB,EAAE,8BAExD,GAAG,EAAE,iBAcf,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,wBAAyB,MAAM,YAA6C,CAAA;AAE/F,eAAO,MAAM,qBAAqB,WAAkB,mBAAmB,GAAG,QAAQ,UAAU,wCAmE3F,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,WAAkB,mBAAmB,GAAG,QAAQ,UAAU,uBAAuB,QAAQ,kBAAkB,kBAIzI,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,SACvB,OAAO,MAAM,EAAE,MAAM,CAAC,SACrB,OAAO,MAAM,EAAE,MAAM,CAAC,YAShC,CAAA"}
|
package/build/utils/index.js
CHANGED
|
@@ -446,8 +446,14 @@ exports.addLocatorStrategyHandler = addLocatorStrategyHandler;
|
|
|
446
446
|
* @returns {object[]} elements
|
|
447
447
|
*/
|
|
448
448
|
const enhanceElementsArray = (elements, parent, selector, foundWith = '$$', props = []) => {
|
|
449
|
+
/**
|
|
450
|
+
* if we have an element collection, e.g. `const elems = $$([elemA, elemB])`
|
|
451
|
+
* we cna't assign a common selector to the element array
|
|
452
|
+
*/
|
|
453
|
+
if (!Array.isArray(selector)) {
|
|
454
|
+
elements.selector = selector;
|
|
455
|
+
}
|
|
449
456
|
elements.parent = parent;
|
|
450
|
-
elements.selector = selector;
|
|
451
457
|
elements.foundWith = foundWith;
|
|
452
458
|
elements.props = props;
|
|
453
459
|
return elements;
|
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": "7.
|
|
4
|
+
"version": "7.24.0",
|
|
5
5
|
"homepage": "https://webdriver.io",
|
|
6
6
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -57,18 +57,18 @@
|
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@types/aria-query": "^5.0.0",
|
|
59
59
|
"@types/node": "^18.0.0",
|
|
60
|
-
"@wdio/config": "7.
|
|
60
|
+
"@wdio/config": "7.24.0",
|
|
61
61
|
"@wdio/logger": "7.19.0",
|
|
62
|
-
"@wdio/protocols": "7.
|
|
63
|
-
"@wdio/repl": "7.
|
|
64
|
-
"@wdio/types": "7.
|
|
65
|
-
"@wdio/utils": "7.
|
|
62
|
+
"@wdio/protocols": "7.22.0",
|
|
63
|
+
"@wdio/repl": "7.24.0",
|
|
64
|
+
"@wdio/types": "7.24.0",
|
|
65
|
+
"@wdio/utils": "7.24.0",
|
|
66
66
|
"archiver": "^5.0.0",
|
|
67
67
|
"aria-query": "^5.0.0",
|
|
68
68
|
"css-shorthand-properties": "^1.1.1",
|
|
69
69
|
"css-value": "^0.0.1",
|
|
70
|
-
"devtools": "7.
|
|
71
|
-
"devtools-protocol": "^0.0.
|
|
70
|
+
"devtools": "7.24.0",
|
|
71
|
+
"devtools-protocol": "^0.0.1040073",
|
|
72
72
|
"fs-extra": "^10.0.0",
|
|
73
73
|
"grapheme-splitter": "^1.0.2",
|
|
74
74
|
"lodash.clonedeep": "^4.5.0",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"resq": "^1.9.1",
|
|
82
82
|
"rgb2hex": "0.2.5",
|
|
83
83
|
"serialize-error": "^8.0.0",
|
|
84
|
-
"webdriver": "7.
|
|
84
|
+
"webdriver": "7.24.0"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "cf88ab19bcd0d097ebf00fb812fcbfd1caef9705"
|
|
87
87
|
}
|