/** * Get the message of the user prompt (`alert`, `confirm` or `prompt`) that is * open in this browsing context. Rejects with `no such alert` when none is open. * * WebdriverIO dismisses prompts automatically unless something listens to the * `dialog` event, so register a listener first. * * :getAlertText.js it('reads the message of a prompt', async () => { browser.on('dialog', () => {}) // keep prompts open const page = await browser.url('https://webdriver.io') const opened = new Promise((resolve) => browser.once('dialog', resolve)) await page.execute(() => setTimeout(() => window.alert('Saved'))) await opened console.log(await page.getAlertText()) // outputs: "Saved" await page.acceptAlert() }) * * * @alias browsingContext.getAlertText * @return {string} the prompt message */ export declare function getAlertText(this: WebdriverIO.BrowsingContext): Promise; //# sourceMappingURL=getAlertText.d.ts.map