Description
userDataDir set in the config file has no effect. The browser always launches with user-data-dir: regardless of the config. The --profile CLI flag works correctly for the same path.
Steps to reproduce
Create .playwright/cli.config.json:
{
"browser": {
"browserName": "chromium",
"userDataDir": "/Users/chris/.my-profile",
"launchOptions": {
"headless": false
},
"contextOptions": {
"viewport": {
"width": 1280,
"height": 900
}
}
}
}
Run:
npx playwright-cli open https://example.com --config .playwright/cli.config.json
Output shows:
- user-data-dir: <in-memory>
Also tried:
playwright-cli.json, ~/.playwright at project root and I tried changing between userDataDir abs path and relative path at project root - same result.
Expected behavior
Browser should launch with user-data-dir: /Users/chris/.my-profile and persist cookies/state across sessions.
Actual behavior
user-data-dir is always . Login state is lost when the browser closes.
Workaround
Passing --profile directly works:
npx playwright-cli open https://example.com --profile=/Users/chris/.kaggle-playwright-profile
Description
userDataDirset in the config file has no effect. The browser always launches with user-data-dir: regardless of the config. The --profile CLI flag works correctly for the same path.Steps to reproduce
Create .playwright/cli.config.json:
{ "browser": { "browserName": "chromium", "userDataDir": "/Users/chris/.my-profile", "launchOptions": { "headless": false }, "contextOptions": { "viewport": { "width": 1280, "height": 900 } } } }Run:
Output shows:
Also tried:
playwright-cli.json,~/.playwrightat project root and I tried changing betweenuserDataDirabs path and relative path at project root - same result.Expected behavior
Browser should launch with user-data-dir: /Users/chris/.my-profile and persist cookies/state across sessions.
Actual behavior
user-data-dir is always . Login state is lost when the browser closes.
Workaround
Passing --profile directly works: