As far as I know Playwright dismisses the dialog boxes, so you need to handle the dialog boxes in a different way. I never had the opportunity to work with this, but it is documented here: https://playwright.dev/docs/dialogs