-
Notifications
You must be signed in to change notification settings - Fork 239
Open
Labels
Area: browserThe browser moduleThe browser module
Description
What
We want to make writing k6 browser scripts simpler by creating a series of opinionated best practice docs on how best to work with k6 browser.
Why
Users currently feel that they are left in the dark in terms of best practices. It's generally up to them to read the docs and examples and the to build from there. The issue is that users are likely to be facing the same issues over and over again.
How
We should cover:
- Why we should use
page.close
:- Helps with flushing of metrics;
- cleans up things under-the-hood, especially when working with event based APIs like
page.on
.
- Waiting for specific elements before continuing the test script after a navigation or some sort of interactions which changes the DOM.
- How to work with
iframe
s. - When to work with the different
wait*
APIs. - How to work with the browser's (Chromium)
performance
API. - How to work with the
locator
API:- Why they are great; run through the steps a locator API goes through first before performing the requested action.
- E.g. Why
page.locator()
will never fail until the locator object is actually used. - Working with
all
andnth
instead of$$
. - Why working with
force
could be a smell.7. How to deal with cookie banners. - Sometimes a page needs to be interacted with before the cookie banner appears, and other elements on the page do not work until the cookie banner has been dismissed.
Metadata
Metadata
Assignees
Labels
Area: browserThe browser moduleThe browser module