@badisi/wdio-harness 3.1.6 → 4.0.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.
|
@@ -43,7 +43,7 @@ export class WebdriverIOHarnessEnvironment extends HarnessEnvironment {
|
|
|
43
43
|
/** Gets a list of all elements matching the given selector under this environment's root element. */
|
|
44
44
|
async getAllRawElements(selector) {
|
|
45
45
|
log.info(`${magenta('GET_ALL_RAW_ELEMENTS')} ${green(selector.toString())}`);
|
|
46
|
-
return [...(await this.rawRootElement.$$(selector))];
|
|
46
|
+
return [...(await this.rawRootElement.$$(selector).getElements())];
|
|
47
47
|
}
|
|
48
48
|
/** Gets the root element for the document. */
|
|
49
49
|
getDocumentRoot() {
|
|
@@ -203,7 +203,7 @@ export class WebdriverIOTestElement {
|
|
|
203
203
|
/** Selects the options at the specified indexes inside of a native `select` element. */
|
|
204
204
|
async selectOptions(...optionIndexes) {
|
|
205
205
|
this.logAction('SELECT_OPTIONS', `[${optionIndexes.join(', ')}]`);
|
|
206
|
-
const options = await this.hostElement.$$('option');
|
|
206
|
+
const options = await this.hostElement.$$('option').getElements();
|
|
207
207
|
const indexes = new Set(optionIndexes); // Convert to a set to remove duplicates.
|
|
208
208
|
if (options.length && indexes.size) {
|
|
209
209
|
// Reset the value so all the selected states are cleared. We can
|
package/index.js
CHANGED
|
@@ -31,7 +31,7 @@ export const getHarness = async (query, element) => {
|
|
|
31
31
|
* @return An HarnessLoader instance for the current HTML document, rooted at the document's root element
|
|
32
32
|
*/
|
|
33
33
|
export const createHarnessEnvironment = async (rootElement) => {
|
|
34
|
-
return WebdriverIOHarnessEnvironment.loader(rootElement
|
|
34
|
+
return WebdriverIOHarnessEnvironment.loader(rootElement ?? await $('//body').getElement());
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
37
|
* Returns a promise that resolves when the application is "stable".
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@badisi/wdio-harness",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "WebdriverIO support for Angular component test harnesses.",
|
|
5
5
|
"homepage": "https://github.com/badisi/wdio-harness",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@angular/cdk": ">= 13 < 18",
|
|
43
|
-
"@wdio/logger": ">=
|
|
44
|
-
"webdriverio": ">=
|
|
43
|
+
"@wdio/logger": ">= 9 < 10",
|
|
44
|
+
"webdriverio": ">= 9 < 10"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@colors/colors": "^1.6.0"
|