This project demonstrates how pytest can be put together to create an API automation tool to assist in regression testing.
when testing apis I usually found myself repeating alot test code and I knew this is wrong. I strongly believe that api tests should be:
- Test data driven - scenarios should drive tests.
- There should be minimal repetition on test code. DRY Principal
- Stand alone - tests should not depend on each other, or else there should be minimal dependancy.
- Test dependancy comes in handy when testing business logic.
- Any part of API under test should be configurable, i.e remove any hard coding as much as possible.
Therefore there is a need to organize test process or flow to ensure that apis tests yield maximum benefits like test accuracy,maintainance and speed.
- setup code(code executed before any test is run).
- session management - managing session objects and data.
- Test data generation - important for concurrent tests.
- parametrizing tests - since the framework is test data driven and need to run tests concurrently.
- writting a conftest file e.g fixtures and extra commandline arguments
- collecting tests
- marking tests - helps to choose which tests to execute.
- running tests - concurrent execution of tests for speed.
- test reporting - allure, html, and json reports
- python 3 should be installed
pip install pytest
- installs the most recent version
to do - add more details