question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running "Cypress run" with multiple options from the Command Line does not work

See original GitHub issue

Current 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:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
dorothythurstoncommented, Nov 30, 2018

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

1reaction
Narretzcommented, Sep 19, 2018

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,

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found