We currently have page.on('console') which enables users to action on all console logs that the website under test logs. We have many community requests to add more event handling for other events. These event handling will enable users to perform more dynamic actions in their test when certain events occur which can help them capture, diagnose, and assert when things are not going well or are going well.
Suggested Solution (optional)
In Playwright they have the following events on page.on:
close
console
crash
dialog
domcontentloaded
download
filechooser
frameattached
framedetached
framenavigated
load
pageerror
popup
request
requestfailed
requestfinished
response
websocket
worker
Already existing or connected issues / PRs (optional)
### Tasks
- [ ] Refactor `page.on('console')` to make it generic to allow extension of more events.
- [ ] Evaluate each event and decide which ones give the most value.
- [ ] Implement each event handling of the events that give the most value.
Feature Description
We currently have
page.on('console')
which enables users to action on all console logs that the website under test logs. We have many community requests to add more event handling for other events. These event handling will enable users to perform more dynamic actions in their test when certain events occur which can help them capture, diagnose, and assert when things are not going well or are going well.Suggested Solution (optional)
In Playwright they have the following events on
page.on
:close
console
crash
dialog
domcontentloaded
download
filechooser
frameattached
framedetached
framenavigated
load
pageerror
popup
request
requestfailed
requestfinished
response
websocket
worker
Already existing or connected issues / PRs (optional)
https://github.com/grafana/xk6-browser/issues/1153