Skip to content

adequatica/api-testing-comparison

Repository files navigation

API Testing Comparison: Cypress vs. Playwright vs. Jest

There is an implementation of a bunch of the same tests for each framework: Cypress, Playwright, and Jest as a test runner + Axios as HTTP library.

Example API for testing: OpenWeatherMap API, which requires a key for authorization (API_KEY env variable).

How to Use

  1. Clone repository
  2. Install dependencies: npm install
  3. Install Cypress as per the documentation
  4. Run all tests: API_KEY={string} npm run test

Read more in the article «API Testing Comparison: Cypress vs. Playwright vs. Jest».

Methods of gathering results for the article:

  • time API_KEY={string} npm run cypress:run
  • time API_KEY={string} npm run test:playwright
  • time API_KEY={string} npm run test:jest

Resulting average results:

  • Cypress:run command time: 12,96 sec
  • Playwright command time: 3,21 sec
  • Jest command time: 3,84 sec

This means that Сypress is 4 times slower than Playwright.