Playwright · Middle · Question 68 of 75

How do you keep test data separate when tests run in parallel workers?

Show the answer

Correct answer: Use unique data, e.g. names with testInfo.workerIndex

Explanation

Unique users or prefixes per worker or test prevent collisions, like two tests editing the same cart.

Further reading

Problem with a question

Playwright · Middle · question 68

Test yourself

Take the Playwright · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz