Skip to content

Valiantsin2021/API_tests_cypress_playwright_mocha_pytest

Repository files navigation

This repository purpose is to show how to use Cypress with Playwright, Mocha/Supertest, and Pytest test frameworks for API testing and to measure the performance of these frameworks.

Prerequisites

Installation

JavaScript libraries can be installed with npm

npm install

Pytest can be installed with pipenv

pip install pipenv
pipenv shell
pipenv install

Usage

For the sake of clean measurements there are no external reporters installed.

Cypress can be run from the command line.

npm run cypress

Playwright can be run from the command line.

npm run playwright

Mocha can be run from the command line.

npm run mocha

Pytest can be run from the command line.

pipenv run pytest

Performance results

node test_time.js
python pytest_time.py

Conclusion

Time measured per framework for one user and one contact scenario (25 tests run sequentially):

  1. Cypress: > 37s
  2. Playwright: > 16s
  3. Mocha: > 14s
  4. Pytest: > 5s

Time measured per framework for multiple users (11) and multiple contact (11) scenarios 300 tests:

  1. Cypress: > 4m29s
  2. Playwright: > 39s
  3. Mocha: > 1m21s
  4. Pytest: > 53s

Measured performance results can be found in results folder.

I hope you find this repository useful.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published