Playwright · Middle · Question 12 of 75

What is the recommended way to log in once and reuse it?

Show the answer

Correct answer: A setup project saves storageState, others depend on it

Explanation

The setup project logs in and writes cookies and storage to a file. Projects with dependencies: ['setup'] load it with storageState, so tests start logged in.

Further reading

Problem with a question

Playwright · Middle · question 12

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