简体   繁体   中英

Cypress command-line tool not honoring arguments

I'm not using npm, so I've downloaded Cypress directly. I'm able to open the Cypress binary directly from the command line, but I can't make it run tests from the command line. Running Cypress run just opens the UI. Cypress run --project /path/to/my/project does open the project in the UI, but doesn't run it. Bizarrely, Cypress version doesn't display the version, it just opens the UI. Even Cypress this-is-not-a-command opens the UI without any errors.

You should use the cypress NPM package to run Cypress from the command line. The binary itself is not designed to be executed for anything other than global open mode. The cypress NPM package contains a command-line utility that makes cypress run , cypress open , and cypress version work like you expect.


If you really really really don't want to use the CLI supplied with the cypress NPM package, you can reference how the CLI translates your command line arguments:

Note that these APIs are internal and may change at any time.

So, to do cypress run --project /path/to/project directly on the binary, it would look like this:

cypress-binary --run-project /path/to/project

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM