grafana / xk6-browser

The browser module adds support for browser automation and end-to-end web testing via the Chrome Devtools Protocol to k6.
https://grafana.com/docs/k6/latest/javascript-api/k6-browser/
GNU Affero General Public License v3.0
344 stars 41 forks source link

Update example to work with page.waitForTimeout #1443

Closed ankur22 closed 2 months ago

ankur22 commented 2 months ago

This is recommended when working with the browser APIs.

What?

Update example to work with page.waitForTimeout.

Why?

It's recommended that we work with page.waitForTimeout over sleep due to the async nature of the browser API and the synchronous sleep that blocks the event loop.

Checklist

Related PR(s)/Issue(s)

Updates: https://github.com/grafana/k6-docs/issues/1719