cypress: cypress run -b chrome fails if you attempt to change the baseUrl
Current behavior:
cypress run fails if you attempt to change the baseUrl from the command line while using the --browser chrome option
Running each of these commands individually work as expected with no errors
> cypress run --browser chrome
> cypress run --config baseUrl=http://localhost:3000
but strangely, combining them both causes the process to immediately exit with an error. The failure is almost immediate, there is no output from cypress and no tests are run.
> cypress run --browser chrome --config baseUrl=http://localhost:3000
Error: my-project@0.0.0 cypress:cl: `cypress run --browser chrome --config baseUrl=http://localhost:3000`
Exit status 4294967295
at EventEmitter.<anonymous> (C:\ProgramData\nvm\v8.11.3\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
at emitTwo (events.js:126:13)
at EventEmitter.emit (events.js:214:7)
at ChildProcess.<anonymous> (C:\ProgramData\nvm\v8.11.3\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
It seemed strange, so I tried combining --browser chrome with other options.
This ran as expected with no errors:
> cypress run --browser chrome --config chromeWebSecurity=false
But if you try to set the baseUrl with --env, the same error occurs!
> cypress run --browser chrome --env baseUrl=http://localhost:3000
My current workaround is to set the CYPRESS_BASE_URL environment variable manually prior to calling cypress run.
Desired behavior:
> cypress run --browser chrome --config baseUrl=http://localhost:3000
should not fail
Steps to reproduce:
set baseUrl in cypress.json to localhost:4200
then run
> cypress run --browser chrome --config baseUrl=http://localhost:3000
Versions
Cypress 3.1.0 Windows 10 using git bash Node 8.11.3 Chrome Version 69.0.3497.100
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 4
- Comments: 16 (8 by maintainers)
I’m experiencing the exact same behavior as @MadLittleMods npx cypress open With no parameters, using config file settings, it works fine, however if I add --config baseUrl=X it fails. The debug output is identical. Ends with cypress:cli child event fired { event: ‘exit’, code: 4294967295, signal: null } +35ms cypress:cli child event fired { event: ‘close’, code: 4294967295, signal: null } +2ms
This happened as soon as I upgraded to 3.5
I am running windows 10. node@12.13.0 npm@6.5.0
@flotwig For reference, here is the MR where we are updating to Cypress 3.5.0, https://gitlab.com/gitlab-org/gitter/webapp/merge_requests/1631. I just did a workaround using the
envfield incypress.jsoninstead of passing variables via--envCypress 3.5.0 and
--envHere is the output with
set DEBUG=cypress:*and no workaroundI only started seeing the problem with Cypress 3.5.0
npm@6.11.3node@10.15.1For reference, our Cypress tests are here, https://gitlab.com/gitlab-org/gitter/webapp/blob/086ff67a30a838091fec30beedd923a920797cca/test/e2e/e2e-test.js
Related issues:
Cypress 3.4.1 ✔️
Using
cypress open, test runner appears and tests can run,Cypress 3.5.0 ❌
Using
cypress open, nothing happens (no test runner appears) and it just exits right away,I also saw this and started using
CYPRESS_baseUrl envvariable instead - this actually ended up simplifying my workflow so I forgot about this issue as it no longer affects me.