Open
Description
Current behavior
We would like to use a custom Chrome profile directory for our Cypress tests. The application we are testing uses a Web SQL database which needs to be loaded into the Chrome browser. We tried this command which should be a valid chromium argument.
launchOptions.args.push('--user-data-dir=/Users/testuser/dev/chrome')
But when we run Cypress we see that the Chrome Profile Path is being overwritten by Cypress:
Desired behavior
The Chrome Profile Path from the launchOptions '--user-data-dir=/Users/testuser/dev/chrome'
is used.
Test code to reproduce
Our setup:
- MacOs
- Chrome v93
- Cypress v8.4.0
The code we tried in our index.js (plugins folder):
module.exports = (on, config) => {
on('before:browser:launch', (browser = {}, launchOptions) => {
launchOptions.args.push('--user-data-dir=/Users/testuser/dev/chrome')
launchOptions.args.push('--auto-open-devtools-for-tabs')
return launchOptions
})
};
Steps to reproduce:
- Add launchOptions argument with --user-data-dir like mentioned above
- Open Cypress dashboard (npx cypress open)
- Run 1 test in Chrome
- Chrome browser opens, type
chrome://version
in URL bar - --user-data-dir=/Users/testuser/dev/chrome is listed in the Command Line panel, but I also see --user-data-dir=/Users/xxxxx/Library/Application Support/Cypress/cy/production/browsers/chrome-stable/interactive listed, and that is the Profile Path which is being used by Cypress
Cypress Version
8.4.0
Other
Also tested on a Windows 10 environment and there this code is working fine when testing headed in Chrome.
Activity