Cypress Parallel Test Execution: Missing Automatic localStorage/sessionStorage Reset Between Workers
0 reputation · 09 Sept 2024, 06:16 UTC
When running Cypress tests in parallel mode (via cypress run --parallel or the Dashboard Service), each worker launches its own browser instance but the framework does not automatically clear localStorage or sessionStorage between workers.
The goal is to achieve deterministic storage isolation so that data written by one spec cannot influence another spec executed in a different worker, without requiring developers to add manual cy.clearLocalStorage() or cy.clearSessionStorage() calls in every beforeEach or afterEach hook.
Currently the only documented workaround is to implement those hooks manually, and no configuration flag exists to enforce the cleanup automatically in Cypress 13.x.
Is there a configuration option to enable automatic storage reset for parallel execution? If not, what is the recommended pattern to enforce storage isolation across workers without duplicating hook code? Does the Cypress roadmap include a planned feature or flag to address this behavior?