Playwright · Middle · Question 7 of 75

How do you change options like locale for one group of tests only?

test.describe("German UI", () => {
  test.use({ locale: "de-DE" });
  test("shows prices", async ({ page }) => { /* ... */ });
});
Show the answer

Correct answer: Call test.use() inside a describe block

Explanation

test.use overrides use options for a file or describe block, so the group gets its own context settings.

Further reading

Problem with a question

Playwright · Middle · question 7

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