-
Notifications
You must be signed in to change notification settings - Fork 241
Open
Labels
Area: browserThe browser moduleThe browser module
Description
What
Users often use sleep
when they should use page.waitForTimeout
.
Solution
Use page.waitForTimeout
instead of sleep
. page.waitForTimeout
is asynchronous and doesn't block the thread, allowing other background events to continue which is important for browser tests since there's usually a lot going on in the background. sleep
is synchronous and blocks the thread, preventing other background tasks from completing. working with sleep
will affect the measurements.
Create dedicated documentation for this. Currently this is detailed in: https://grafana.com/docs/k6/latest/using-k6-browser/recommended-practices/simulate-user-input-delay/ but i think it would be better in its own page.
Metadata
Metadata
Assignees
Labels
Area: browserThe browser moduleThe browser module