UNPKG

webdriverio

Version:

Next-gen browser and mobile automation test framework for Node.js

29 lines (28 loc) • 905 B
export {}; /** * Accepts the dialog and returns when the dialog has been handled. * * :::info * Only works with browser dialogs (via BiDi protocol). For mobile native dialogs, * use [`browser.acceptDialog`](/docs/api/mobile/acceptDialog) instead. * ::: * * <example> :dialogAccept.js // Listen for the dialog event to get the dialog object browser.on('dialog', async (dialog) => { console.log(dialog.message()); // prints: 'Hello, world!' await dialog.accept(); }); // Or accept a prompt dialog with text browser.on('dialog', async (dialog) => { if (dialog.type() === 'prompt') { await dialog.accept('my input'); } }); * </example> * * @alias dialog.accept * @param {string=} promptText A text to enter into prompt. Does not cause any effects if the dialog's type is not prompt. */ //# sourceMappingURL=accept.d.ts.map