Cypress is a next generation api and front end testing tool built for the modern web. This is a sample project which you can use to start your E2E testing with Cypress. remotes/origin_github/main
-
Install node from https://nodejs.org/en/download/.
-
Use
npm
package manager and install required dependency.npm install
To run UI Test which is under cypress/test/uitest.
npm run ui-test
For Headless Mode, use below command.
npm run ui-test:headless
Run using tags, use below command.
npm run ui-test:withTags
To run API Test which is under cypress/test/apitest.
npm run api-test
There are different folder for different purpose here.
-
config :- This will be used to set configuration for UI & API test individually.
apiconfig.json - all required configurations for api automation are added under this file. uiconfig.json - all required configurations for ui automation are added under this file.
-
fixtures :- This will be used to add required test data files.
-
Reports :- After execution of UI or API test, report will get generate under Reports -> APIReports or Report -> UIReports respectively. There will be one file with ExecutionReport.html to see result in HTML format. It generates from result json data.
-
screenshots :- All failure screenshots will get generated here.
-
support :- This folder will be used to set global configuration and great place to put behavior that modifies Cypress under support/index.js
-
test :- All test will be taken care from this location. Use apitest folder for adding api test cases in TDD Way, uitest folder for adding ui test cases in BDD way.
-
Videos :- All feature execution vidoes gets generated here if Vidoes flag set to true in config/apiconfig.json or config/uiconfig.json.