-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Clear and concise description of the problem
Preserve Playwright Chrome DevTools settings between vitest browser mode sessions.
Use cases:
- remember ignore listing settings
- remember source maps settings
- remember ui preferences (close needless side panels, resize)
Without it, each browser run requires 15sec of manual adjusting devtools settings. For example, I have to disable ignore listing as I debug node_modules code often.
Suggested solution
Chrome user data dir is stored in a cache directory, persisted between browser runs.
Chrome has --user-data-dir option for storing persistent user data.
I tried this in vitest 4:
provider: playwright({
launchOptions: {
args: [
`--user-data-dir=${process.cwd()}/node_modules/.cache/playwright-user-data-dir`,
],
},
}),But it errors, and suggests using API I am not sure is public for vitest users:
error during close browserType.launch: Pass userDataDir parameter to 'browserType.launchPersistentContext(userDataDir, options)' instead of specifying '--user-data-dir' argument
Even if there is a way to hack it on my side, I feel like persistent devtools settings is a useful feature that should be on by default.
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.