webdriverio 8.3.11 → 8.5.1
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 +4 -33
- package/build/commands/browser/$$.d.ts.map +1 -1
- package/build/commands/browser/$$.js +4 -33
- package/build/commands/browser/$.d.ts +4 -27
- package/build/commands/browser/$.d.ts.map +1 -1
- package/build/commands/browser/$.js +4 -27
- package/build/commands/element/$$.d.ts +4 -26
- package/build/commands/element/$$.d.ts.map +1 -1
- package/build/commands/element/$$.js +4 -26
- package/build/commands/element/$.d.ts +4 -28
- package/build/commands/element/$.d.ts.map +1 -1
- package/build/commands/element/$.js +4 -28
- package/package.json +9 -9
|
@@ -16,42 +16,13 @@ import type { Selector, ElementArray } from '../../types.js';
|
|
|
16
16
|
*
|
|
17
17
|
* :::
|
|
18
18
|
*
|
|
19
|
-
* <example>
|
|
20
|
-
:index.html
|
|
21
|
-
<ul id="menu">
|
|
22
|
-
<li><a href="/">Home</a></li>
|
|
23
|
-
<li><a href="/">Developer Guide</a></li>
|
|
24
|
-
<li><a href="/">API</a></li>
|
|
25
|
-
<li><a href="/">Contribute</a></li>
|
|
26
|
-
</ul>
|
|
27
|
-
:$.js
|
|
28
|
-
it('should get text a menu link', async () => {
|
|
29
|
-
const text = await $$('#menu')[0];
|
|
30
|
-
console.log(await text.$$('li')[2].$('a').getText()); // outputs: "API"
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('should get text a menu link - JS Function', async () => {
|
|
34
|
-
const text = await $$(function() { // Arrow function is not allowed here.
|
|
35
|
-
// this is Window https://developer.mozilla.org/en-US/docs/Web/API/Window
|
|
36
|
-
// TypeScript users may do something like this
|
|
37
|
-
// return (this as Window).document.querySelectorAll('#menu')
|
|
38
|
-
return this.document.querySelectorAll('#menu'); // Element[]
|
|
39
|
-
})[0];
|
|
40
|
-
console.log(await text.$$('li')[2].$('a').getText()); // outputs: "API"
|
|
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
|
-
});
|
|
50
|
-
* </example>
|
|
51
|
-
*
|
|
52
19
|
* @alias $$
|
|
53
20
|
* @param {String|Function} selector selector or JS Function to fetch multiple elements
|
|
54
21
|
* @return {ElementArray}
|
|
22
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/example.html
|
|
23
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L6-L7
|
|
24
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L15-L24
|
|
25
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L32-L39
|
|
55
26
|
* @type utility
|
|
56
27
|
*
|
|
57
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
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,gBAAgB,CAAA;AAE5D
|
|
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,gBAAgB,CAAA;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,EAAE,CACpB,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,EAC/C,QAAQ,EAAE,QAAQ,GAAG,gBAAgB,EAAE,GAAG,WAAW,CAAC,OAAO,EAAE,GAAG,WAAW,EAAE,yBAkBlF"}
|
|
@@ -16,42 +16,13 @@ import { getElements } from '../../utils/getElementObject.js';
|
|
|
16
16
|
*
|
|
17
17
|
* :::
|
|
18
18
|
*
|
|
19
|
-
* <example>
|
|
20
|
-
:index.html
|
|
21
|
-
<ul id="menu">
|
|
22
|
-
<li><a href="/">Home</a></li>
|
|
23
|
-
<li><a href="/">Developer Guide</a></li>
|
|
24
|
-
<li><a href="/">API</a></li>
|
|
25
|
-
<li><a href="/">Contribute</a></li>
|
|
26
|
-
</ul>
|
|
27
|
-
:$.js
|
|
28
|
-
it('should get text a menu link', async () => {
|
|
29
|
-
const text = await $$('#menu')[0];
|
|
30
|
-
console.log(await text.$$('li')[2].$('a').getText()); // outputs: "API"
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('should get text a menu link - JS Function', async () => {
|
|
34
|
-
const text = await $$(function() { // Arrow function is not allowed here.
|
|
35
|
-
// this is Window https://developer.mozilla.org/en-US/docs/Web/API/Window
|
|
36
|
-
// TypeScript users may do something like this
|
|
37
|
-
// return (this as Window).document.querySelectorAll('#menu')
|
|
38
|
-
return this.document.querySelectorAll('#menu'); // Element[]
|
|
39
|
-
})[0];
|
|
40
|
-
console.log(await text.$$('li')[2].$('a').getText()); // outputs: "API"
|
|
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
|
-
});
|
|
50
|
-
* </example>
|
|
51
|
-
*
|
|
52
19
|
* @alias $$
|
|
53
20
|
* @param {String|Function} selector selector or JS Function to fetch multiple elements
|
|
54
21
|
* @return {ElementArray}
|
|
22
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/example.html
|
|
23
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L6-L7
|
|
24
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L15-L24
|
|
25
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L32-L39
|
|
55
26
|
* @type utility
|
|
56
27
|
*
|
|
57
28
|
*/
|
|
@@ -23,34 +23,7 @@ import type { Selector } from '../../types.js';
|
|
|
23
23
|
* :::
|
|
24
24
|
*
|
|
25
25
|
* <example>
|
|
26
|
-
:index.html
|
|
27
|
-
<ul id="menu">
|
|
28
|
-
<li><a href="/">Home</a></li>
|
|
29
|
-
<li><a href="/">Developer Guide</a></li>
|
|
30
|
-
<li><a href="/">API</a></li>
|
|
31
|
-
<li><a href="/">Contribute</a></li>
|
|
32
|
-
</ul>
|
|
33
26
|
:$.js
|
|
34
|
-
it('should get text a menu link', async () => {
|
|
35
|
-
const text = await $('#menu');
|
|
36
|
-
console.log(await text.$$('li')[2].$('a').getText()); // outputs: "API"
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('should get text a menu link - JS Function', async () => {
|
|
40
|
-
const text = await $(function() { // Arrow function is not allowed here.
|
|
41
|
-
// this is Window https://developer.mozilla.org/en-US/docs/Web/API/Window
|
|
42
|
-
// TypeScript users may do something like this
|
|
43
|
-
// return (this as Window).document.querySelector('#menu')
|
|
44
|
-
return this.document.querySelector('#menu'); // Element
|
|
45
|
-
});
|
|
46
|
-
console.log(await text.$$('li')[2].$('a').getText()); // outputs: "API"
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('should allow to convert protocol result of an element into a WebdriverIO element', async () => {
|
|
50
|
-
const activeElement = await browser.getActiveElement();
|
|
51
|
-
console.log(await $(activeElement).getTagName()); // outputs active element
|
|
52
|
-
});
|
|
53
|
-
|
|
54
27
|
it('should use Androids DataMatcher or ViewMatcher selector', async () => {
|
|
55
28
|
const menuItem = await $({
|
|
56
29
|
"name": "hasEntry",
|
|
@@ -70,6 +43,10 @@ import type { Selector } from '../../types.js';
|
|
|
70
43
|
* @alias $
|
|
71
44
|
* @param {String|Function|Matcher} selector selector, JS Function, or Matcher object to fetch a certain element
|
|
72
45
|
* @return {Element}
|
|
46
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/example.html
|
|
47
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L9-L10
|
|
48
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L16-L25
|
|
49
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L42-L46
|
|
73
50
|
* @type utility
|
|
74
51
|
*
|
|
75
52
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"$.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/$.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAG9C
|
|
1
|
+
{"version":3,"file":"$.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/$.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAG9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAsB,CAAC,CACnB,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,EAC/C,QAAQ,EAAE,QAAQ,GACnB,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAc9B"}
|
|
@@ -25,34 +25,7 @@ import { ELEMENT_KEY } from '../../constants.js';
|
|
|
25
25
|
* :::
|
|
26
26
|
*
|
|
27
27
|
* <example>
|
|
28
|
-
:index.html
|
|
29
|
-
<ul id="menu">
|
|
30
|
-
<li><a href="/">Home</a></li>
|
|
31
|
-
<li><a href="/">Developer Guide</a></li>
|
|
32
|
-
<li><a href="/">API</a></li>
|
|
33
|
-
<li><a href="/">Contribute</a></li>
|
|
34
|
-
</ul>
|
|
35
28
|
:$.js
|
|
36
|
-
it('should get text a menu link', async () => {
|
|
37
|
-
const text = await $('#menu');
|
|
38
|
-
console.log(await text.$$('li')[2].$('a').getText()); // outputs: "API"
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('should get text a menu link - JS Function', async () => {
|
|
42
|
-
const text = await $(function() { // Arrow function is not allowed here.
|
|
43
|
-
// this is Window https://developer.mozilla.org/en-US/docs/Web/API/Window
|
|
44
|
-
// TypeScript users may do something like this
|
|
45
|
-
// return (this as Window).document.querySelector('#menu')
|
|
46
|
-
return this.document.querySelector('#menu'); // Element
|
|
47
|
-
});
|
|
48
|
-
console.log(await text.$$('li')[2].$('a').getText()); // outputs: "API"
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('should allow to convert protocol result of an element into a WebdriverIO element', async () => {
|
|
52
|
-
const activeElement = await browser.getActiveElement();
|
|
53
|
-
console.log(await $(activeElement).getTagName()); // outputs active element
|
|
54
|
-
});
|
|
55
|
-
|
|
56
29
|
it('should use Androids DataMatcher or ViewMatcher selector', async () => {
|
|
57
30
|
const menuItem = await $({
|
|
58
31
|
"name": "hasEntry",
|
|
@@ -72,6 +45,10 @@ import { ELEMENT_KEY } from '../../constants.js';
|
|
|
72
45
|
* @alias $
|
|
73
46
|
* @param {String|Function|Matcher} selector selector, JS Function, or Matcher object to fetch a certain element
|
|
74
47
|
* @return {Element}
|
|
48
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/example.html
|
|
49
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L9-L10
|
|
50
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L16-L25
|
|
51
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L42-L46
|
|
75
52
|
* @type utility
|
|
76
53
|
*
|
|
77
54
|
*/
|
|
@@ -9,35 +9,13 @@
|
|
|
9
9
|
*
|
|
10
10
|
* :::
|
|
11
11
|
*
|
|
12
|
-
* <example>
|
|
13
|
-
:index.html
|
|
14
|
-
<ul id="menu">
|
|
15
|
-
<li><a href="/">Home</a></li>
|
|
16
|
-
<li><a href="/">Developer Guide</a></li>
|
|
17
|
-
<li><a href="/">API</a></li>
|
|
18
|
-
<li><a href="/">Contribute</a></li>
|
|
19
|
-
</ul>
|
|
20
|
-
:$.js
|
|
21
|
-
it('should get text a menu link', async () => {
|
|
22
|
-
const text = await $('#menu');
|
|
23
|
-
console.log(await text.$$('li')[2].$('a').getText()); // outputs: "API"
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('should get text a menu link - JS Function', async () => {
|
|
27
|
-
const text = await $('#menu');
|
|
28
|
-
console.log(await text.$$(function() { // Arrow function is not allowed here.
|
|
29
|
-
// this is Element https://developer.mozilla.org/en-US/docs/Web/API/Element
|
|
30
|
-
// in this particular example it is HTMLUListElement
|
|
31
|
-
// TypeScript users may do something like this
|
|
32
|
-
// return (this as Element).querySelectorAll('li')
|
|
33
|
-
return this.querySelectorAll('li'); // Element[]
|
|
34
|
-
})[2].$('a').getText()); // outputs: "API"
|
|
35
|
-
});
|
|
36
|
-
* </example>
|
|
37
|
-
*
|
|
38
12
|
* @alias $$
|
|
39
13
|
* @param {String|Function|Matcher} selector selector, JS Function, or Matcher object to fetch multiple elements
|
|
40
14
|
* @return {ElementArray}
|
|
15
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/example.html
|
|
16
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L6-L7
|
|
17
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L15-L24
|
|
18
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L32-L39
|
|
41
19
|
* @type utility
|
|
42
20
|
*
|
|
43
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"$$.d.ts","sourceRoot":"","sources":["../../../src/commands/element/$$.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"$$.d.ts","sourceRoot":"","sources":["../../../src/commands/element/$$.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,EAAE,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAClD,eAAO,MAAM,EAAE,kBAAY,CAAA"}
|
|
@@ -9,35 +9,13 @@
|
|
|
9
9
|
*
|
|
10
10
|
* :::
|
|
11
11
|
*
|
|
12
|
-
* <example>
|
|
13
|
-
:index.html
|
|
14
|
-
<ul id="menu">
|
|
15
|
-
<li><a href="/">Home</a></li>
|
|
16
|
-
<li><a href="/">Developer Guide</a></li>
|
|
17
|
-
<li><a href="/">API</a></li>
|
|
18
|
-
<li><a href="/">Contribute</a></li>
|
|
19
|
-
</ul>
|
|
20
|
-
:$.js
|
|
21
|
-
it('should get text a menu link', async () => {
|
|
22
|
-
const text = await $('#menu');
|
|
23
|
-
console.log(await text.$$('li')[2].$('a').getText()); // outputs: "API"
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('should get text a menu link - JS Function', async () => {
|
|
27
|
-
const text = await $('#menu');
|
|
28
|
-
console.log(await text.$$(function() { // Arrow function is not allowed here.
|
|
29
|
-
// this is Element https://developer.mozilla.org/en-US/docs/Web/API/Element
|
|
30
|
-
// in this particular example it is HTMLUListElement
|
|
31
|
-
// TypeScript users may do something like this
|
|
32
|
-
// return (this as Element).querySelectorAll('li')
|
|
33
|
-
return this.querySelectorAll('li'); // Element[]
|
|
34
|
-
})[2].$('a').getText()); // outputs: "API"
|
|
35
|
-
});
|
|
36
|
-
* </example>
|
|
37
|
-
*
|
|
38
12
|
* @alias $$
|
|
39
13
|
* @param {String|Function|Matcher} selector selector, JS Function, or Matcher object to fetch multiple elements
|
|
40
14
|
* @return {ElementArray}
|
|
15
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/example.html
|
|
16
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L6-L7
|
|
17
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L15-L24
|
|
18
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L32-L39
|
|
41
19
|
* @type utility
|
|
42
20
|
*
|
|
43
21
|
*/
|
|
@@ -16,35 +16,7 @@
|
|
|
16
16
|
* :::
|
|
17
17
|
*
|
|
18
18
|
* <example>
|
|
19
|
-
:index.html
|
|
20
|
-
<ul id="menu">
|
|
21
|
-
<li><a href="/">Home</a></li>
|
|
22
|
-
<li><a href="/">Developer Guide</a></li>
|
|
23
|
-
<li><a href="/">API</a></li>
|
|
24
|
-
<li><a href="/">Contribute</a></li>
|
|
25
|
-
</ul>
|
|
26
19
|
:$.js
|
|
27
|
-
it('should get text a menu link', async () => {
|
|
28
|
-
const text = await $('#menu');
|
|
29
|
-
console.log(await text.$$('li')[2].$('a').getText()); // outputs: "API"
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('should get text a menu link - JS Function', async () => {
|
|
33
|
-
const text = await $('#menu');
|
|
34
|
-
console.log(await text.$$('li')[2].$(function() { // Arrow function is not allowed here.
|
|
35
|
-
// this is Element https://developer.mozilla.org/en-US/docs/Web/API/Element
|
|
36
|
-
// in this particular example it is HTMLLIElement
|
|
37
|
-
// TypeScript users may do something like this
|
|
38
|
-
// return (this as Element).querySelector('a')
|
|
39
|
-
return this.querySelector('a'); // Element
|
|
40
|
-
}).getText()); // outputs: "API"
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('should allow to convert protocol result of an element into a WebdriverIO element', async () => {
|
|
44
|
-
const activeElement = await browser.getActiveElement();
|
|
45
|
-
console.log(await $(activeElement).getTagName()); // outputs active element
|
|
46
|
-
});
|
|
47
|
-
|
|
48
20
|
it('should use Androids DataMatcher or ViewMatcher selector', async () => {
|
|
49
21
|
const menuItem = await $({
|
|
50
22
|
"name": "hasEntry",
|
|
@@ -64,6 +36,10 @@
|
|
|
64
36
|
* @alias $
|
|
65
37
|
* @param {String|Function|Matcher} selector selector, JS Function, or Matcher object to fetch a certain element
|
|
66
38
|
* @return {Element}
|
|
39
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/example.html
|
|
40
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L9-L10
|
|
41
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L16-L25
|
|
42
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L42-L46
|
|
67
43
|
* @type utility
|
|
68
44
|
*
|
|
69
45
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"$.d.ts","sourceRoot":"","sources":["../../../src/commands/element/$.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"$.d.ts","sourceRoot":"","sources":["../../../src/commands/element/$.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,EAAE,CAAC,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,eAAO,MAAM,CAAC,iBAAW,CAAA"}
|
|
@@ -16,35 +16,7 @@
|
|
|
16
16
|
* :::
|
|
17
17
|
*
|
|
18
18
|
* <example>
|
|
19
|
-
:index.html
|
|
20
|
-
<ul id="menu">
|
|
21
|
-
<li><a href="/">Home</a></li>
|
|
22
|
-
<li><a href="/">Developer Guide</a></li>
|
|
23
|
-
<li><a href="/">API</a></li>
|
|
24
|
-
<li><a href="/">Contribute</a></li>
|
|
25
|
-
</ul>
|
|
26
19
|
:$.js
|
|
27
|
-
it('should get text a menu link', async () => {
|
|
28
|
-
const text = await $('#menu');
|
|
29
|
-
console.log(await text.$$('li')[2].$('a').getText()); // outputs: "API"
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('should get text a menu link - JS Function', async () => {
|
|
33
|
-
const text = await $('#menu');
|
|
34
|
-
console.log(await text.$$('li')[2].$(function() { // Arrow function is not allowed here.
|
|
35
|
-
// this is Element https://developer.mozilla.org/en-US/docs/Web/API/Element
|
|
36
|
-
// in this particular example it is HTMLLIElement
|
|
37
|
-
// TypeScript users may do something like this
|
|
38
|
-
// return (this as Element).querySelector('a')
|
|
39
|
-
return this.querySelector('a'); // Element
|
|
40
|
-
}).getText()); // outputs: "API"
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('should allow to convert protocol result of an element into a WebdriverIO element', async () => {
|
|
44
|
-
const activeElement = await browser.getActiveElement();
|
|
45
|
-
console.log(await $(activeElement).getTagName()); // outputs active element
|
|
46
|
-
});
|
|
47
|
-
|
|
48
20
|
it('should use Androids DataMatcher or ViewMatcher selector', async () => {
|
|
49
21
|
const menuItem = await $({
|
|
50
22
|
"name": "hasEntry",
|
|
@@ -64,6 +36,10 @@
|
|
|
64
36
|
* @alias $
|
|
65
37
|
* @param {String|Function|Matcher} selector selector, JS Function, or Matcher object to fetch a certain element
|
|
66
38
|
* @return {Element}
|
|
39
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/example.html
|
|
40
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L9-L10
|
|
41
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L16-L25
|
|
42
|
+
* @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L42-L46
|
|
67
43
|
* @type utility
|
|
68
44
|
*
|
|
69
45
|
*/
|
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.5.1",
|
|
5
5
|
"homepage": "https://webdriver.io",
|
|
6
6
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -67,30 +67,30 @@
|
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@types/node": "^18.0.0",
|
|
70
|
-
"@wdio/config": "8.
|
|
70
|
+
"@wdio/config": "8.5.1",
|
|
71
71
|
"@wdio/logger": "8.1.0",
|
|
72
72
|
"@wdio/protocols": "8.3.11",
|
|
73
73
|
"@wdio/repl": "8.1.0",
|
|
74
|
-
"@wdio/types": "8.
|
|
75
|
-
"@wdio/utils": "8.
|
|
74
|
+
"@wdio/types": "8.4.0",
|
|
75
|
+
"@wdio/utils": "8.4.0",
|
|
76
76
|
"archiver": "^5.0.0",
|
|
77
77
|
"aria-query": "^5.0.0",
|
|
78
78
|
"css-shorthand-properties": "^1.1.1",
|
|
79
79
|
"css-value": "^0.0.1",
|
|
80
|
-
"devtools": "8.
|
|
81
|
-
"devtools-protocol": "^0.0.
|
|
80
|
+
"devtools": "8.5.1",
|
|
81
|
+
"devtools-protocol": "^0.0.1109433",
|
|
82
82
|
"grapheme-splitter": "^1.0.2",
|
|
83
83
|
"import-meta-resolve": "^2.1.0",
|
|
84
84
|
"is-plain-obj": "^4.1.0",
|
|
85
85
|
"lodash.clonedeep": "^4.5.0",
|
|
86
86
|
"lodash.zip": "^4.2.0",
|
|
87
87
|
"minimatch": "^7.0.0",
|
|
88
|
-
"puppeteer-core": "19.7.
|
|
88
|
+
"puppeteer-core": "19.7.2",
|
|
89
89
|
"query-selector-shadow-dom": "^1.0.0",
|
|
90
90
|
"resq": "^1.9.1",
|
|
91
91
|
"rgb2hex": "0.2.5",
|
|
92
92
|
"serialize-error": "^8.0.0",
|
|
93
|
-
"webdriver": "8.
|
|
93
|
+
"webdriver": "8.5.1"
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "3a0fcc3875d01630da633c71560963aa5c425cef"
|
|
96
96
|
}
|