Running "Cypress run" with multiple options from the Command Line does not work
See original GitHub issueCurrent behavior:
When running the command below, it’s not working:
./node_modules/.bin/cypress run --browser chrome --config baseUrl=http://localhost:45/
Desired behavior:
Cypress should start with the baseUrl configuration variable overriden and the browser being Chrome.
As a personal note, this may be because of inexperience or incorrect formating (I’m fairly new to Cypress, been using it for two weeks) as in the official Cypress doc it only gives one example using two different options (--headed --no-exit
) and I’m using --browser
and --config
.
We need this to work as it’s the command that will be executed in an automated task every night for E2E testing.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Command Line - Cypress Documentation
cypress run --record --key <record-key> Record your test results to Cypress Cloud. For this option to work you must first set up your...
Read more >Troubleshooting | Cypress Documentation
On Windows, you'll need to run the command in a command prompt terminal (not PowerShell). set DEBUG=cypress:* cypress run. If you have issues...
Read more >Configuration - Cypress Documentation
Cypress gives you the option to dynamically alter configuration options. This is helpful when running Cypress in multiple environments and on multiple developer ......
Read more >Introduction | Cypress Documentation
What you'll learn An overview of Continuous Integration How to run Cypress tests in Continuous Integration How to configure Cypress in various CI....
Read more >exec | Cypress Documentation
Execute a system command. Anti-Pattern Don't try to start a web server from cy.exec(). Read about best practices here. Syntax Usage Correct Usage....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have found that in my case adding single quotes around the thing i am passing in to the -s flag fixed my problem. So it could be that @Bkucera had the right idea. The underlying library that cypress is using (commander) does allow for multiple flags so it is probably a parsing error in that library… it seems to choke on extra spaces or missing ’ ’ around the value
I believe this is caused by the
--browser
option. For example, I can use--config
and--env
at the same time, but as soon as--browser
comes into the mix, cypress aborts without any message,