Any public examples of xk6-browser with reusable fixtures?

Hey all

I am very new to xk6-browser (day 1 over here) coming from a selenium testing background. We are interesting in exploring using xk6-browser for testing a new project. I am looking for some examples on on how to make re-usable test fixtures that can be shared between different test cases. Is there anything out there in the form of an example, or can anyone share some guidance on how to get started?

I have built a single test file that can go through our application and interact, but I would like to focus on re-use to avoid high cost of maintenance as we build out.


Hi @jkdale,

That’s great news!

You can take a look at this answer for reusing code from other files. There is also a locator example where we demonstrate how to create reusable and readable tests.


Thank you… very helpful info you shared