1. To Run Single test :
npx cypress open --config testFiles="/Users/rajeshvarma/Documents/CypressProj/cypress/integration/UIScripts/tc1.spec.js" ---------------------------------------------------------------------------------------------------------------------------
2. To run cypress multiple test cases option:
npx cypress open
---------------------------------------------------------------------------------------------------------------------------
3. crossbrowser testing:-
$ npx cypress run --browser chrome --spec “cypress/integration/examples/tests/e2e_test.spec.js”
update package.json file with below entries for crossbrowser:
}
---------------------------------------------------------------------------------------------------------------------------
4. Cypress reporting:-
$ npm install mochawesome. OR. $ npm install junit
update cypress.json file with below entries :-
}
$ npx cypress run --reporter mochawesome --spec “cypress/integration/examples/tests/e2e_test.spec.js”
Cypress.json config file for JUnit:--
}
$ npx cypress run --reporter junit \ --reporter-options “mochaFile=results/my-test-output.xml,toConsole=true”
---------------------------------------------------------------------------------------------------------------------------