View Russian version of this file here
- Description
- Installation
- Running Tests
- Project Structure
- Documentation
- Coverage
- Allure Report
- Telegram Notification
- License
This project is a set of automated UI tests written in Python using Playwright, Allure, and PyTest.
- Install Python: https://www.python.org/downloads/
- Clone the repository:
git clone https://github.com/ZhikharevAl/db_web_test_automation.git
- Activate the virtual environment:
/.venv/Scripts/activate
- Install dependencies:
pip install -r requirements.txt
- Run tests:
pytest
pytest --numprocesses auto
The
pytest --numprocesses auto
command is used to run tests in parallel using the pytest-xdist plugin. To install the pytest-xdist plugin, execute the following command:pip install -U pytest-xdistOr:
pip install pytest-xdistIf you want to use psutil to determine the number of available processors, install the additional psutil package:
pip install pytest-xdist[psutil]Example:
pytest --numprocesses auto --count=100 .\tests\name_test.pyThe
--numprocesses auto
option automatically determines the number of processes equal to the number of available processors and randomly distributes tests among them. The--count=100
option specifies that each test should be run 100 times. The path.\tests\name_test.py
points to the test file to be run.
numprocess.mp4
- Run with a specified base URL:
pytest --base-url https://demoblaze.com/
The
pytest-base-url
plugin is a simple plugin for pytest that provides an optional base URL via the command line or configuration file. You can install pytest-base-url with pip:pip install pytest-base-urlAfter installation, you can specify the base URL on the command line:
pytest --base-url https://demoblaze.com/Or you can specify the base URL in the configuration file:
[pytest] base_url = https://demoblaze.com/
- Automatic test restart on failure:
If you want the test to automatically restart on failure, you can use the
pytest-rerunfailures
plugin. This plugin allows you to automatically rerun failed tests. To install the plugin, execute the following command:pip install pytest-rerunfailuresThen, in the
pytest.ini
file, specify the following:[pytest] addopts = --reruns=5
- Generate Allure report:
allure serve allure-results
.github/workflows/
- directory with workflow filesdata/
- directory with datadocs/
- directory with documentationtests/
- directory with testspages/
- directory with page descriptions.gitignore
- file with ignored files.dockerignore
- file with ignored filesconftest.py
- configuration filedocker-compose.yml
- docker-compose configuration fileDockerfile
- Dockerfilepytest.ini
- Pytest configuration filerequirements.txt
- project dependencies file
Descriptions of tests and documentation can be found here.
For Telegram notifications, you can use a Telegram bot.
This project is licensed under the MIT License - see the LICENSE.md file for details.