Hello,
I have issue testing one page, It use JavaScript for confirmation:
var choice = confirm(“The selected documents will now be finalized!”);
if (choice == false) {
return;
}
After this check it runs AJAX and documents are finalized.
Issue is that whenever this confirm is run, playwright dismiss it.
I found in their docs:
By default, dialogs are auto-dismissed by Playwright, so you don’t have to handle them. However, you can register a dialog handler before the action that triggers the dialog to either dialog.accept() or dialog.dismiss() it.
page.on('dialog', dialog => dialog.accept());await page.getByRole('button').click();
I also found Handle Future Dialogs but also do not work.
Is there a way to pervent new browser to dismiss dialogs?