This repository contains a Postman collection for testing one of the REST API resources available on GoRest and to be more specific related to /users
.
- The Postman collection covers various testing levels and types, including functional, negative, and edge cases.
- The tests are designed to catch potential critical defects and ensure the reliability of the API.
- The collection includes tests for all the main operations (GET, POST, PUT, DELETE) on the selected resource.
To run the tests locally, you need to have Postman and Newman installed.
- Import the Postman collection into your Postman application.
- Configure the necessary environment variables, such as the authentication token.
- Run the tests within Postman or use Newman to execute the tests from the command line:
newman run path/to/your/e2e_user_flow.postman_collection.json
The tests can be executed as part of a CI/CD pipeline using GitHub Actions. The provided .github/workflows/newman-tests.yml
workflow file is configured to run the tests on each push or pull request to the master
branch.
To set up the CI/CD pipeline:
- Push the
.github
directory and your Postman collection JSON file to your GitHub repository. - GitHub Actions will automatically run the tests whenever there is a push or pull request to the
master
branch. Example of results can be found here - Be sure to update the token variable with your own authentication token in
environment-file.json
.
There is simple tests for python, the same which was use in Postman
- Update token in
go_test.py
file. - Install
pip install requests
and create virtual environmentpython -m venv venv
- Activate the virtual environment
source venv/bin/activate
(for Unix-based systems) orvenv\Scripts\activate
(for Windows) - Run
python go_test.py
to execute the Python tests.
The final solution includes a comprehensive Postman collection for testing one of the REST API resources on GoRest, along with a GitHub Actions workflow to execute the tests in a CI/CD pipeline. Also few python tests for some request, but not for all. This ensures that any changes made to the API are automatically tested, improving the overall reliability and stability of the API.