Level 6 · Browser Handling
Everything that leaves the DOM
Alerts, popups, permissions, downloads — the flows that trip up test frameworks the most.
#
Native alerts
- alert: —
- confirm: —
- prompt: —
tipPlaywright: page.on('dialog', d => d.accept())
#
Popup window
tipPlaywright: waitForEvent('popup')
#
Multiple tabs / new window
tipAssert on the new context's URL.
#
Permissions
state: unknown
tipPlaywright: context.grantPermissions(['notifications'])
#
Downloads
tipPlaywright: waitForEvent('download')