Tested with NodeJS v6.x.
In our project the easiest way to install and use Cypress, is to install it as a global node module.
You should install a LTS version of NodeJS for the best support.
$ npm install -g cypress
Run cypress verify to make sure that cypress is installed correctly.
$ cypress verify
All custom and Cypress-specific ENV variables have CYPRESS_ prefix.
List of custom variables:
- CYPRESS_NAP_LOGIN: Test user username
- CYPRESS_NAP_PASSWORD: Test user password
Some useful cypress ENV variables:
- CYPRESS_RECORD_KEY
- CYPRESS_baseUrl: By default we are using a value defined in cypress.json (testi.finap.fi)
- CYPRESS_port
- CYPRESS_reporter
- CYPRESS_screenshotOnHeadlessFailure
- CYPRESS_watchForFileChanges
https://docs.cypress.io/guides/references/configuration.html#Global
https://docs.cypress.io/guides/guides/command-line.html#cypress-open
$ CYPRESS_NAP_LOGIN=username CYPRESS_NAP_PASSWORD=password cypress open
https://docs.cypress.io/guides/guides/command-line.html#cypress-run
$ CYPRESS_NAP_LOGIN=username CYPRESS_NAP_PASSWORD=password cypress --headed --spec "cypress/integration/operator_spec.js"
https://docs.cypress.io/guides/guides/command-line.html#cypress-run
$ CYPRESS_NAP_LOGIN=username CYPRESS_NAP_PASSWORD=password cypress run --record
https://docs.cypress.io/guides/core-concepts/dashboard-service.html#Setup
$ CYPRESS_NAP_LOGIN=username CYPRESS_NAP_PASSWORD=password cypress run --record --key <secret record key>
The secret record key can be copied from the Cypress cloud dashboard if you have proper access rights.
Get the key from here
https://docs.cypress.io/guides/guides/continuous-integration.html#
In short:
- Install Cypress
- Define CYPRESS_NAP_LOGIN, CYPRESS_NAP_PASSWORD and CYPRESS_RECORD_KEY (copy it from here) ENV variables.
- Add
cypress run --record
command in the CI configuration.
All the test spec files must be stored in cypress/integration
directory.
If fixtures are needed in tests, they can be stored in cypress/fixtures
directory.
All the supporting features and custom cypress commands should be added in the cypress/support
directory.
More info: