Closed
Description
Current behavior:
When set ELECTRON_EXTRA_LAUNCH_ARGS=--remote-debugging-port 40500
is used then nothing happens
BUT
When I change environment.js to use appendSwitch
instead, it works:
app.commandLine.appendSwitch('remote-debugging-port', '40500')
Desired behavior:
I can set option via environment variable
Test code to reproduce
set ELECTRON_EXTRA_LAUNCH_ARGS=--remote-debugging-port 40500
cypress open
Cypress should output:
DevTools listening on ws://127.0.0.1:40500/devtools/browser/<UUID>
Versions
Windows 10, Cypress 4.10.0, using builtin Electron in Headed mode
Activity
jennifer-shehane commentedon Jul 16, 2020
Yeah, I don't think we are handling key value pairs correctly in our
ELECTRON_EXTRA_LAUNCH_ARGS
here. Electron says we need to call the argument likeapp.commandLine.appendSwitch('remote-debugging-port', '8315')
, but I don't see us actually pulling out the value from the key in order to pass these as 2 arguments to appendSwitch. https://www.electronjs.org/docs/api/command-line-switchesThe code that handles this is here: https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/environment.js#L71:L71
The test shows it's being called as
--remote-debugging-port=40500
.I don't think that
appendArgument
actually supports key value pairs, the Electron docs even suggest usingappendSwitch
here instead. https://www.electronjs.org/docs/api/command-line#commandlineappendargumentvaluejennifer-shehane commentedon Jul 16, 2020
Opened a PR here #8001
dg-nvm commentedon Jul 16, 2020
@jennifer-shehane thank you Jennifer for fast reaction. These two differs greatly internally and also they mention added cmdline will be added before switches.
cypress-bot commentedon Jul 16, 2020
The code for this is done in cypress-io/cypress#8001, but has yet to be released.
We'll update this issue and reference the changelog when it's released.
5 remaining items