How to Speed up your Playwright Tests with shared "storageState"

How to Speed up your Playwright Tests with shared "storageState"

Aug 8, 2024

Join Stefan Judis, Playwright Ambassador, as he shows you how to speed up your Playwright test suite execution time for apps behind a login. Usually, login-walled products require you to log in for every test case. However, by implementing project dependencies, setting up a project, and pairing everything with the storage state, you can log into your app once and then reuse the browser and storage state. This setup equips your subsequent tests with essential cookies and browser state, saving time and effort by avoiding repetitive login actions.

Example code: https://github.com/checkly/playwright-examples/tree/main/project-setup-and-storage-state
Blog post: https://www.checklyhq.com/blog/speed-up-playwright-tests-with-storage-state/
Project dependency docs: https://playwright.dev/docs/test-global-setup-teardown#option-1-project-dependencies
Storage State docs: https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state
Synthetic Monitoring: https://www.checklyhq.com/product/synthetic-monitoring/

0:00 Intro

0:35 Example project setup

2:03 Add a new Playwright project

4:24 Connect projects with project dependencies

5:09 Reuse storage state across projects

7:13 Run projects and their dependencies in UI mode

8:12 Outro

If you find this tutorial helpful, please like, subscribe, and leave your questions or feedback in the comments below!

#playwright #endtoendtesting #checkly #syntheticmonitoring