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