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).
- Clone repository
- Install dependencies:
npm install
- Install Cypress as per the documentation
- 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.