The repository contains code that demonstrate how cypress can be used to do API Testing.
The API endpoints used here are from website (https://fakerestapi.azurewebsites.net/index.html)
Kindly note that as these are dummy endpoints so no data will be actually deleted, updated or created. You will just receieve a Mocked repsosne.
The Basic HTTP methods are tests are demonstrated.
- GET
- POST
- PUT
- DELETE
- [Create] Folder on your local machine
- Clone Repository using below command
git clone https://github.com/the-test-trove/api-tests-cypress.git
- Please ensure that you have node version 12 or higher is installed.
- Open the project using VS Code and Open Terminal
- Perform npm install so that all the required dependencies required for cypress are available
- In order to run the tests using cypress runner execute command "npx cypress open" and select the spec file that needs to run.
- In order ot execute all the tests in headless mode execute the command "npm run test"
- The test execution can be done in github with Github actions.