ashikkumar23 / api-testing-cypress

"A repository containing API testing examples using the Cypress framework, providing a quick and easy approach to testing APIs with a focus on simplicity and ease of use."

Home Page:https://ashikkumar23.github.io/api-testing-cypress/

Repository from Github https://github.comashikkumar23/api-testing-cypressRepository from Github https://github.comashikkumar23/api-testing-cypress

Cypress REST API Test Framework

Actions Status Actions Status Actions Status

API Testing Framework using Cypress with GitHub Actions workflow for generating and publishing test report

πŸš€ Description:

Automated CRUD (i.e., POST, GET, PUT, DELETE) operations using Cypress

πŸš€ Prerequisites:

πŸš€ Installation Steps:

  • Fork and Clone the repository api-testing-cypress
  • Move to the api-testing-cypress directory:
cd api-testing-cypress
  • Set up a new npm package:
npm init
  • Install cypress:
npm install cypress
  • Add the following lines to the package.json file, "scripts" section:
  "scripts": {
    "cypress:open": "./node_modules/.bin/cypress open",
    "cypress:run": "./node_modules/.bin/cypress run --spec **/*.cy.js"
  }

πŸš€ Test Execution:

  • To run the tests on your terminal:
npm run cypress:run
npm run cypress:open
  • On Cypress Test Runner:
    • Select E2E Testing
    • Choose a browser: Chrome or Electron
    • Click on Start E2E Testing in {browser}
    • Once the test runner has loaded, click on the spec file i.e., test_crud.cy.js to run the test

πŸš€ Reporting:

npm install --save-dev mocha cypress-multi-reporters mochawesome
npm install --save-dev mochawesome-merge
npm install --save-dev mochawesome-report-generator
  • Add the following lines to the package.json file, "scripts" section:
  "scripts": {
    "report:merge": "mochawesome-merge cypress/reports/json/*.json > index.json",
    "report:generate": "marge index.json --reportDir public --assetsDir public/assets --reportPageTitle index.html"
  }

πŸš€ Notes:

  • .github/workflows/package_update.yml workflow would ensure the dependencies are up-to-date
  • Tests are always run on the latest dependencies βœ…

About

"A repository containing API testing examples using the Cypress framework, providing a quick and easy approach to testing APIs with a focus on simplicity and ease of use."

https://ashikkumar23.github.io/api-testing-cypress/

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%