api-testing: API Testing framework for functional testing of REST APIs
Get started with writing API tests in an easy and simplified way. No boilerplate code required
-
This API testing framework created using python make it
simple to write and maintain testsfor REST APIs without worrying about writing extra boilerplate code. -
You can mention the REST API server details like server address, port number and credentials in the
global configuation fileand then directly start writing test cases under tests folder. -
All the reusable functions like
HTTP server methodsare provided under the HTTP utility class. There is aAuthentication helperclass also available for authentication of user and fetching authorization token from the API server. -
Pytest fixtures are used to implement the
setup and teardown methodsfrom HTTP utility class and Authentication helper class. Before a test case runs, the Authentication helper class authenticates user and fetches the authorization token. Then, the Http utiliy class is initialized and the authorization token is set in the request headers. After the test case run is completed, the authorization token is deleted also from the API server. -
You can start writing the test cases directly and call the HTTP utility class methods to perform the REST API operations. You can use Pytest assertions to assert on the REST API operation result.
Installation and how to run the tests
Please make sure you have python version greater than or equal to 3.7 installed on your system. You can install it from official python website: https://www.python.org/downloads/release/python-379/
-
Download or clone the code from the api-testing GitHub repository to your system
-
Go to the directory location of downloaded or cloned code folder - "api-testing"
cd api-testing
-
Run the following command to install the dependencies listed in requirements.txt
pip install -r requirements.txt
-
Write test cases under the folder "tests". ( A example test case for creating a user is already present in the folder )
-
Run the following command to run the test cases written under the "tests" folder
pytest .
You can go through the folder structure of the api-testing module to get familier with testing framework. Also, all the Pytest commands will work for this testing framework also.
Please feel free to provide your feedback and contribute to this project by creating a pull request. You can also reach me via email - luvsharma1931@yahoo.com
Metadata
Release files for api-testing 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| api-testing-1.0.3.tar.gz | 3.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| api_testing-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.4 kB
Release files / api-testing-1.0.3.tar.gz
| Download URL | api-testing-1.0.3.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13a222b9ff934ec1b2a488dbc19417105f6d13f6c9752d6bae939ca71dbbb118
|
|
BLAKE2b-256 checksum How to use checksums |
6583b4bee6e4efcb8a456d1274a3a8ce7eb44c620dc4499a5b2589d2367484df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.9
|
Release files / api_testing-1.0.3-py3-none-any.whl
| Download URL | api_testing-1.0.3-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a66c060b58911cac790b48dc39f27f761001a0c8fe692b545625566ee6bfc4d9
|
|
BLAKE2b-256 checksum How to use checksums |
2c2ac16f37a716f05a02ec3cac1c7caf8c418b7c85689a063c304e9bec7bb7e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.9
|
Security for api-testing 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.