Playwright · Middle · Question 12 of 75
What is the recommended way to log in once and reuse it?
- 1Hard-code session cookies into the config file
- 2Log in inside
beforeAllof every single test file - 3A setup project saves
storageState, others depend on 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.