@serenity-js/webdriverio
Version:
Adapter that integrates @serenity-js/web with the latest stable version of WebdriverIO, enabling Serenity/JS reporting and using the Screenplay Pattern to write web and mobile test scenarios
34 lines • 998 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebdriverIORootLocator = void 0;
require("webdriverio");
const web_1 = require("@serenity-js/web");
/**
* WebdriverIO-specific implementation of [`RootLocator`](https://serenity-js.org/api/web/class/RootLocator/).
*
* @group Models
*/
class WebdriverIORootLocator extends web_1.RootLocator {
browser;
constructor(browser) {
super();
this.browser = browser;
}
async isPresent() {
return true;
}
async nativeElement() {
return this.browser;
}
async switchToFrame(frame) {
await this.browser.switchFrame(frame);
}
async switchToParentFrame() {
await this.browser.switchToParentFrame();
}
async switchToMainFrame() {
await this.browser.switchFrame(null); // eslint-disable-line unicorn/no-null
}
}
exports.WebdriverIORootLocator = WebdriverIORootLocator;
//# sourceMappingURL=WebdriverIORootLocator.js.map