Open AJM-v opened 3 years ago
@AJM-v Did you find a solution to this?
We have a use case that also requires custom Chrome profiles,
@AJM-v Did you find a solution to this?
We have a use case that also requires custom Chrome profiles,
@AlexMurphy Nope, our dev team is creating a workaround for the app we are testing so that we don't have to use a custom chrome profile.
Same issue here on mac. Cypress team could you have a look please?
Same issue on Windows, both --user-data-dir
and --remote-debugging-port
settings are overwritten.
This issue still happen on cypress version 12 when using the run command from the CLI such as npx cypress run --headed --no-exit --browser chrome
. I guess it's because when we run cypress it generate a new temp chrome profile to make the test isolated and this override this setting.
Is there any workaround?
I can tell that Cypress is intentionally overwriting this arg here.
https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/browsers/chrome.ts#L692
But there seems to be no escape hatch to chose it yourself.
Our case also requires this approach (we are setting up mic permissions before test).
I tried running this in plugins/index.js
:
export default (on, config) => {
on('before:browser:launch', (browser = {}, launchOptions) => {
launchOptions.args.push('--user-data-dir=../chromeProfile/Default');
})
}
We have the same requirement. We are trying to run VSCode (Electron) with cypress and we need to override --user-data-dir
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.
This issue is a blocker for many things for us and it's still occurring.
We did add an option recently to IGNORE_CHROME_PREFERENCES
. You can see the code path here: https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/browsers/chrome.ts#L111C19-L111C44
I haven't tried this specific use case, but it may be an option to opt out of the overwriting behavior that is causing problems with Cypress overwriting. Interested to hear if that works for anyone.
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:
The code we tried in our index.js (plugins folder):
Steps to reproduce:
chrome://version
in URL barCypress Version
8.4.0
Other
Also tested on a Windows 10 environment and there this code is working fine when testing headed in Chrome.