playwright-fluent
Version:
Fluent API around playwright
15 lines (14 loc) • 493 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.acceptDialog = void 0;
async function acceptDialog(dialog, promptText, page, onAccepted) {
if (!page) {
throw new Error(`Cannot accept dialog because no browser has been launched`);
}
if (!dialog) {
throw new Error(`Cannot accept dialog because no dialog has been opened`);
}
await dialog.accept(promptText);
await onAccepted();
}
exports.acceptDialog = acceptDialog;
;