Skip to content

obstar/qrPythonSwapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published