How to Speed up your Playwright Tests with shared storageState



AI Summary

The video explains how to optimize Playwright end-to-end tests when testing features behind a login wall. It highlights the default behavior where each test case creates its own browser context, causing repetitive login sequences and slower tests. The video provides a step-by-step guide on how to use Playwright project dependencies and storage state to log in once, save the login session to a file, and share that browser state across multiple test cases. This approach speeds up tests by avoiding multiple login operations. The tutorial includes how to set up a separate project for login setup, run it before other test projects, save the storage state to a JSON file, and then reuse that state in subsequent tests. It demonstrates running tests sequentially with dependencies to ensure the login setup completes first. The video concludes by encouraging viewers to explore Playwright docs for more info and check out related Playwright tutorial videos in the playlist.