Files
xod/packages/xod-client-browser/test-func/pageObjects/ConfirmationPopup.js
Evgeny Kochetkov e6ab08e297 chore(infra): format code with prettier
Just `yarn lint  --fix`
2018-03-05 17:59:03 +03:00

30 lines
707 B
JavaScript

import BasePageObject from './BasePageObject';
class ConfirmationPopup extends BasePageObject {
async getTitle() {
const titleElementHandle = await this.elementHandle.$('.skylight-title');
const title = await this.page.evaluate(
el => el.textContent,
titleElementHandle
);
return title;
}
async clickConfirm() {
const button = await this.elementHandle.xpath(
'//button[.//text()="Confirm"]'
);
await button.click();
}
}
ConfirmationPopup.findOnPage = async page => {
const elementHandle = await page.$('.PopupConfirm');
if (!elementHandle) return null;
return new ConfirmationPopup(page, elementHandle);
};
export default ConfirmationPopup;