Skip to content

Latest commit

 

History

History
73 lines (48 loc) · 1.28 KB

README.md

File metadata and controls

73 lines (48 loc) · 1.28 KB

Overview

Test framework written in python as demo for testing RESTful API of https://swapi.dev/

How to run tests

pre-installed on local:

by script

Run script

test.sh

manually:

  1. Create virtual env
python3 -m venv env
  1. Activate env
source env/bin/activate
  1. Install required packages
pip install -r requirements.txt
  1. Run pytest
pytest --alluredir=./reports/allure_results
  1. Generate report
allure serve ./reports/allure_results

Libraries used by project:

  1. Python 3.9 and higher
  2. pytest
  3. pytest-timeout
  4. requests
  5. allure-pytest for reports

Improvements

There is plenty room for refactor I could:

  • extract asserts to some helper module .e.g new folder/package helpers > asserts.py etc
  • handle better constants.py to use and store data need it by tests
  • add more negative tests around each endpoint
  • test full content of response bodies returned by service
  • etc..

Estimation

It took me around 2 working days, of which half day I've tried to implement pytest-bdd but I didn't continue with that.