-
Create
package.jsonnpm init -
Install cypress
npm install cypress --save-dev -
Cypress latest version
npm install --save-dev cypress@latest -
Open cypress
./node_modules/.bin/cypress open -
cypress-file-upload
npm install --save-dev cypress-file-upload -
headless
./node_modules/.bin/cypress run --spec cypress/integration/webdriver-uni/contact-us.js -
Multiple-reporters •
npm install --save-dev cypress-multi-reporters mocha-junit-reporter• Config cypress.json{ "reporter": "cypress-multi-reporters", "reporterOptions": { "configFile": "reporter-config.json" } }• Add reporter-config.json
{ "reporterEnabled": "spec, mocha-junit-reporter", "mochaJunitReporterReporterOptions": { "mochaFile": "cypress/results/results-[hash].xml" } }•
npm install --save-dev mochawesome mochawesome-merge mochawesome-report-generator•npm run triggerAllTests-headless -
Switch-between-multiple-configuration-files
cypress run --env configFile=stagingEach of these environments would read in the configuration at these files:
cypress/config/development.json cypress/config/qa.json cypress/config/staging.json cypress/config/production.jsonThis would enable you to do things like this:
// cypress/config/development.json { "baseUrl": "http://localhost:1234", "env": { "something": "development" } } // cypress/config/qa.json { "baseUrl": "https://qa.acme.com", "env": { "something": "qa" } } // cypress/config/staging.json { "baseUrl": "https://staging.acme.com", "env": { "something": "staging" } } // cypress/config/production.json { "baseUrl": "https://production.acme.com", "env": { "something": "production" } }
-
java -jar -Dfile.encoding=UTF-8 jenkins.war
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|