UNPKG

playwright-fluent

Version:
15 lines (14 loc) 493 B
"use strict"; 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;