mirror of
https://github.com/xodio/xod.git
synced 2026-03-15 05:06:59 +01:00
23 lines
566 B
JavaScript
23 lines
566 B
JavaScript
import ConfirmationPopup from './ConfirmationPopup';
|
|
|
|
class PromptPopup extends ConfirmationPopup {
|
|
async typeText(text) {
|
|
const input = await this.elementHandle.$('input');
|
|
await input.type(text);
|
|
}
|
|
}
|
|
|
|
PromptPopup.findOnPage = async page => {
|
|
const elementHandle = await page.$('.PopupPrompt');
|
|
if (!elementHandle) return null;
|
|
|
|
return new PromptPopup(page, elementHandle);
|
|
};
|
|
|
|
PromptPopup.waitOnPage = async page => {
|
|
await page.waitFor('.PopupPrompt', { timeout: 1000 });
|
|
return PromptPopup.findOnPage(page);
|
|
};
|
|
|
|
export default PromptPopup;
|