Skip to content

The repository contains the code to demonstrate how cypress can be used to perform API testing

Notifications You must be signed in to change notification settings

the-test-trove/api-tests-cypress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Testing with Cypress

Getting started

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

Clone Repository

  • [Create] Folder on your local machine
  • Clone Repository using below command
git clone https://github.com/the-test-trove/api-tests-cypress.git

Run Tests from You Machine

  • 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"

Integrate with Github Actions

  • The test execution can be done in github with Github actions.