import 'webdriverio'; import { RootLocator } from '@serenity-js/web'; /** * WebdriverIO-specific implementation of [`RootLocator`](https://serenity-js.org/api/web/class/RootLocator/). * * @group Models */ export class WebdriverIORootLocator extends RootLocator { constructor(private readonly browser: WebdriverIO.Browser) { super(); } async isPresent(): Promise { return true; } async nativeElement(): Promise> { return this.browser; } async switchToFrame(frame: WebdriverIO.Element): Promise { await this.browser.switchFrame(frame); } async switchToParentFrame(): Promise { await this.browser.switchToParentFrame(); } async switchToMainFrame(): Promise { await this.browser.switchFrame(null); } }