- fixtures holds optional JSON data formocking, [read more] [https://docs.cypress.io/guides/core-concepts/writing-and-organizing-tests.html#Fixture-Files]
- integration holds the actual test files, [read more] [https://docs.cypress.io/guides/core-concepts/writing-and-organizing-tests.html#Test-files]
- plugins allow you to customize how tests are loaded, [read more] [https://docs.cypress.io/guides/core-concepts/writing-and-organizing-tests.html#Plugin-files]
- support Files that contain reusable behavior such as Custom Commands or global overrides that you want applied and available to all of your spec files, [read more] [https://docs.cypress.io/guides/core-concepts/writing-and-organizing-tests.html#Support-file]
- git clone repo
- npm install
- Add
/// <reference types="Cypress" />
and/// <reference types="../support" />
reference on the top, to get typed reference. - Add new spec file with the format TC00*_SampleTest*_spec.js
- Write functions in PageObjects as E.g login
- Write helper methods in support/actions.js
- Write custom commands in support/commands.js [read more] [https://docs.cypress.io/api/cypress-api/custom-commands.html#Syntax]
- Add type declaration for custom commands in support/index.d.ts
- Add test data in data/testdata.js
- Keep mock json files in fixtures/
- Open config and update test environment urls,user,pass and update it to config.js
- Test environment json files names are case sensitive
- To run test on specific environment update
configFile=uat or configFile=prod
npm run cy:chrome
run tests in chrome browsernpm run cypress:open
for test development and run(Test Watcher is set to false)npm run cy:test
run all tests in headlessnpx cypress run --env configFile=uat --headed --spec 'cypress/integration/TC001_PersonalDemoAccounts.js'
To run specific test in chrome
npm run combine-reports
to combine mocha json reportnpm run generate-report
to generate html report