Cypress CLI
This is the CLI for: https://github.com/cypress-io/cypress.
View our progress: https://www.pivotaltracker.com/n/projects/1531501
What this does
This is the Cypress CLI
tool used for communicating with the real Cypress Desktop Application
.
For instance you can do common tasks like:
- Installing Cypress
- Running Cypress Headlessly
- Generating API Keys
Installation
npm install -g cypress-cli
This will make the cypress
command globally available from your command line.
You can now execute the following commands:
Available Commands
--
cypress install
Installs the Cypress Desktop Application
to the default location for each Operating System.
OS | Path |
---|
Mac | /Applications/Cypress.app |
Linux | /home/<user>/.cypress/Cypress |
cypress install
cypress install --cypress-version 0.13.0
Additionally if you have a CYPRESS_VERSION
environment variable set, it will automatically download that version. Useful in CI.
Watch a video of Cypress being installed
cypress update
Updates Cypress to the latest version. This does the same thing as cypress install
.
cypress update
cypress run
Runs Cypress headlessly. By default will run all your tests. Useful when developing locally.
cypress run
cypress run /users/john/projects/TodoMVC
cypress run --port 8080
cypress run --reporter json
cypress run --reporter-options mochaFile=result.xml,toConsole=true
cypress run --spec cypress/integration/app_spec.js
cypress run --env host=api.dev.local
cypress run --config pageLoadTimeout=100000,watchForFileChanges=false
You can read more about environment variables and configuration here.
cypress ci
Run Cypress headlessly in CI. Read the Continuous Integration docs for examples.
Note: cypress ci
supports all the same flags as cypress run
.
cypress ci 1234-abcd-efgh-9876
cypress ci
cypress open
Opens the Cypress application. This is the same thing as double-clicking the application.
In Mac you'll see the cy
icon in the tray, and in Linux you'll see the Cypress application window open.
Arguments you pass to cypress open
will automatically be applied to the projects you open. These persist onto all projects until you quit the Cypress Desktop Application.
cypress open --port 8080
cypress open --config pageLoadTimeout=100000,watchForFileChanges=false
cypress open --env host=api.dev.local
cypress get:path
Returns the path Cypress will be install to. Additionally checks to see if Cypress already exists at that path.
cypress get:key
Returns your secret project key for use in CI.
cypress new:key
Creates a new secret project key and returns that key for use in CI. This will negate previous secret keys, so be sure to update your CI to use this new key.
cypress remove:ids
Removes the test IDs found in your specs. In versions of Cypress prior to 0.14.0
we inserted IDs directly into your code.
This feature has been removed for the foreseeable future.
cypress verify
Verifies that the Cypress application is found.
cypress version
Outputs both the version of the CLI Tool and the installed Cypress application.
Upcoming Commands
These commands have not yet been released:
cypress login
cypress set:path
cypress add:project
cypress remove:project
Contributing
npm test
npm run test-debug
npm version [major | minor | patch] -m "release %s"
npm publish
Changelog
0.12.0
- added cli arg for passing reporterOptions
0.11.1
- cypress ci accepts --spec argument
0.11.0
cypress open
now accepts arguments- you can now pass the --config flag to
cypress run
, ci
, and open
which overrides cypress.json
configuration values