Uh oh!
There was an error while loading. Please reload this page.
feat: Add support for Playwright storageState configuration - #5192
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for Playwright's native storageState configuration to the Playwright helper, enabling users to initialize browser contexts with preloaded session data such as cookies, localStorage, and authentication tokens. The feature allows passing either a file path to a JSON storage state or a storage state object directly.
- Adds
storageStateconfiguration option to Playwright helper - Implements
grabStorageState()method to capture current browser state - Ensures scenario-level cookies override global storageState configuration
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/helper/Playwright.js | Adds storageState config handling and grabStorageState method |
| test/helper/Playwright_test.js | Comprehensive test coverage for storageState functionality |
| docs/playwright.md | User guide documentation with examples and security warnings |
| docs/helpers/Playwright.md | API reference documentation for new features |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
7ec2752 to
1570463CompareSamuel-StO
commented
Sep 29, 2025
The fails seems due to a flaky test, it's appear on other PR (https://github.com/codeceptjs/CodeceptJS/actions/runs/17969310358/job/51108017771?pr=5211) |
Uh oh!
There was an error while loading. Please reload this page.
Samuel-StO
commented
Sep 30, 2025
@kobenguyent, is it possible to create a new beta version for version 3.7.6, please? So that we can have a beta version with this feature. |
kobenguyent
commented
Sep 30, 2025
@Samuel-StO sure, please allow me some time to do that. Thanks! |
Samuel-StO
commented
Sep 30, 2025
Yes, of course, no rush. |
Samuel-StO
commented
Sep 30, 2025
Thanks |
kobenguyent
commented
Oct 1, 2025
@Samuel-StO forgot to tell, new beta is now available. Thanks! |
Samuel-StO
commented
Dec 1, 2025
Hi @kobenguyent , quick question regarding releases. We originally added this feature in this PR because we needed it only for our internal tests. After it was merged, we started using version 3.7.6-beta.4, which includes the change, and we’ve now finished our test campaign and are getting ready to move this project to production. Our internal policies require us to use only stable (non-beta) versions in production, so being on 3.7.6-beta.4 is currently a blocker for us. Do you have any plans or an approximate timeline for releasing a stable 3.7.6 that includes this feature? I noticed there are already 4.0.0-beta builds, so I was wondering how 3.7.x fits into the release roadmap. Thanks! |
This PR introduces a new
storageStateoption in the Playwright helper configuration.With this change, users can pass a Playwright storage state directly (either as a path to a JSON file or as an object) to initialize browser contexts with preloaded session data such as cookies, localStorage, IndexedDB, or authentication tokens.
Key points
storageStatecan be configured globally incodecept.conf.jsor overridden per scenario.Applicable helpers:
Applicable plugins:
Type of change
Checklist:
npm run docs)npm run lint)npm test)