The purpose of this repository is to provide automated test suite for OpenCart e-commerce platform.
The following directories tree outlines the most important information about project structure:
.
├── README.md <= This file which documents the project.
├── archive <= pyATS reports directory (excluded from git)
├── oct <= a root package
│ └── tests <= a root package for all automated tests
│ ├── api <= API-related tests
│ ├── deployment <= deployment-related tests
│ └── web <= WEB-related tests
├── suite.py <= a job file to run all tests
└── requirements.txt <= Python packages for automated tests execution
Please use Python 3.6.5
for the test execution.
Before running any command, please install required Python's dependencies with
pip install -r requirements.txt
If you need to run whole tests suite, please run
python suite.py -testbed_file testbed.yaml
If you need to run a particular test, please run
export PYTHONPATH=$(pwd):${PYTHONPATH}
python oct/tests/web/sample.py
where oct/tests/web/sample.py
has to be replaced with desired test module.
Please note! If you run WEB tests, please make sure you run the chromedriver
binary first.
All contributors have to follow Google Python's style guide until it conflicts with the configured tools for code quality evaluation.
Also, docstrings are optional for the project.
Type Hints are mandatory.
Please install required Python's dependencies with
pip install -r requirements-dev.txt
We use Black for the auto-formatting of the code. This allows supporting of common code style across all contributors and will reduce amount of lines for either merge conflicts or review.
Please run black .
to reformat the code according to the projects convention.
We use some tools to guarantee the quality of the code.
- Black checks the quality of the code formatting.
- Pylint analyzes the code and assesses it accordingly.
- flake8 applies some style checks on the code.
- pydocstyle analyses the quality of docstrings
(executed via
flake8
). - Mypy checks static types.
In order to run code assessment, you need to run ./code-assessment.sh
command and make sure
that there is no message like Code assessment is failed! Please fix errors!!!. If you face
the massage, please fix all violations.
If you want to deploy the application to localhost, you need to run in the terminal
sudo docker-compose up
After that you can enter in the browser's search field
https://127.0.0.1 or https://localhost
and use the application. If you need to destroy application, run in the terminal
sudo docker-compose down