diff --git a/package-lock.json b/package-lock.json index 6baadb5..a63be4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17658,8 +17658,8 @@ }, "peerDependencies": { "@angular/cdk": ">= 13 < 18", - "@wdio/logger": ">= 8 < 9", - "webdriverio": ">= 8 < 9" + "@wdio/logger": ">= 9 < 10", + "webdriverio": ">= 9 < 10" } }, "projects/tests-app": {}, diff --git a/projects/library/package.json b/projects/library/package.json index 7e4cfc1..fc8901c 100644 --- a/projects/library/package.json +++ b/projects/library/package.json @@ -44,8 +44,8 @@ }, "peerDependencies": { "@angular/cdk": ">= 13 < 18", - "@wdio/logger": ">= 8 < 9", - "webdriverio": ">= 8 < 9" + "@wdio/logger": ">= 9 < 10", + "webdriverio": ">= 9 < 10" }, "dependencies": { "@colors/colors": "^1.6.0" diff --git a/projects/library/src/WebdriverIOHarnessEnvironment.ts b/projects/library/src/WebdriverIOHarnessEnvironment.ts index 2693022..c201bd7 100644 --- a/projects/library/src/WebdriverIOHarnessEnvironment.ts +++ b/projects/library/src/WebdriverIOHarnessEnvironment.ts @@ -59,7 +59,7 @@ export class WebdriverIOHarnessEnvironment extends HarnessEnvironment { log.info(`${magenta('GET_ALL_RAW_ELEMENTS')} ${green(selector.toString())}`); - return [...(await this.rawRootElement.$$(selector))]; + return [...(await this.rawRootElement.$$(selector).getElements())]; } /** Gets the root element for the document. */ diff --git a/projects/library/src/WebdriverIOTestElement.ts b/projects/library/src/WebdriverIOTestElement.ts index 479e5ae..f6b86d1 100644 --- a/projects/library/src/WebdriverIOTestElement.ts +++ b/projects/library/src/WebdriverIOTestElement.ts @@ -278,7 +278,7 @@ export class WebdriverIOTestElement implements TestElement { async selectOptions(...optionIndexes: number[]): Promise { this.logAction('SELECT_OPTIONS', `[${optionIndexes.join(', ')}]`); - const options = await this.hostElement.$$('option'); + const options = await this.hostElement.$$('option').getElements(); const indexes = new Set(optionIndexes); // Convert to a set to remove duplicates. if (options.length && indexes.size) { diff --git a/projects/library/src/index.ts b/projects/library/src/index.ts index 29a5203..bb00b5d 100644 --- a/projects/library/src/index.ts +++ b/projects/library/src/index.ts @@ -43,7 +43,7 @@ export const getHarness = async ( export const createHarnessEnvironment = async ( rootElement?: WebdriverIO.Element ): Promise => { - return WebdriverIOHarnessEnvironment.loader(rootElement || await $('body')); + return WebdriverIOHarnessEnvironment.loader(rootElement ?? await $('//body').getElement()); }; /** diff --git a/projects/library/tsconfig.json b/projects/library/tsconfig.json index 6961e80..92d88fb 100644 --- a/projects/library/tsconfig.json +++ b/projects/library/tsconfig.json @@ -26,7 +26,8 @@ "strictPropertyInitialization": true, "noUnusedLocals": true, "types": [ - "node" + "node", + "@wdio/globals/types" ] }, "compileOnSave": false, diff --git a/projects/tests-e2e/harness.e2e.ts b/projects/tests-e2e/harness.e2e.ts index 58b3b34..34b0a5a 100644 --- a/projects/tests-e2e/harness.e2e.ts +++ b/projects/tests-e2e/harness.e2e.ts @@ -52,7 +52,7 @@ describe('Angular Material Harness', () => { * @error ERROR webdriver: Request failed with status 404 due to invalid session id: invalid session id * Moreover this api is not efficient as it loops through all the cells no matter the filter. */ - const cellElement = await calendar.element().$('span.mat-calendar-body-cell-content=20'); + const cellElement = await calendar.element().$('span.mat-calendar-body-cell-content=20').getElement(); const cell = await getHarness(MatCalendarCellHarness, cellElement); await cell.select(); /** -- */ diff --git a/projects/tests-e2e/tsconfig.json b/projects/tests-e2e/tsconfig.json index 97ef561..617cbda 100644 --- a/projects/tests-e2e/tsconfig.json +++ b/projects/tests-e2e/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "moduleResolution": "node", + "moduleResolution": "node", "module": "ESNext", "target": "es2022", "lib": [ @@ -9,8 +9,10 @@ ], "types": [ "node", + "jasmine", + "@wdio/globals/types", "expect-webdriverio/jasmine", - "@wdio/jasmine-framework" + "@wdio/jasmine-framework", ] } } diff --git a/projects/tests-e2e/wdio.config.ts b/projects/tests-e2e/wdio.config.ts index ddb250f..14fa971 100644 --- a/projects/tests-e2e/wdio.config.ts +++ b/projects/tests-e2e/wdio.config.ts @@ -25,11 +25,6 @@ export const config: Options.Testrunner = { // ==================== runner: 'local', injectGlobals: false, - autoCompileOpts: { - tsNodeOpts: { - project: 'tsconfig.json' - } - }, // // ================== // Specify Test Files @@ -37,15 +32,18 @@ export const config: Options.Testrunner = { specs: [ './**/*.e2e.ts' ], + filesToWatch: [ + './src/**/*.ts' + ], // // ============ // Capabilities // ============ maxInstances: debug ? 1 : 100, capabilities: [{ - maxInstances: 5, browserName: 'chrome', browserVersion: 'stable', + maxInstances: 5, acceptInsecureCerts: true, 'goog:chromeOptions': { args: headless ? ['--headless', '--disable-gpu', '--disable-dev-shm-usage'] : [debug ? '--auto-open-devtools-for-tabs' : '']