This is a python PageObject framework for Playwright.
Read more about Playwright — https://playwright.dev/
Python 3.12
- Create new virtual environment and use package manager pip to install all requirements:
pip install -r requirements.txt
; - Install Playwright dependencies:
playwright install
- Follow this guide to install Allure — https://docs.qameta.io/allure/#_get_started
To add and use more browsers, check Playwright documentation – https://playwright.dev/docs/browsers
Usage: add decorator @pytest.mark.mobile
to your test on class to use mobile emulation.
To add more mobile devices:
- Add new mark to
pytest.ini
; - Add new devices in
core/driver.py
; - Change
is_mobile
function inconftest.py
— it requires new logic;
Multiple threads:
- Single-thread — execute command
pytest tests/
to run all tests in 1 thread; - Multi-thread — execute command
pytest tests/ -n 5
to run all tests in 5 threads.
Generate Allure report:
- Execute command
pytest tests/ --alluredir=./allure_results
to run all tests and generate Allure report files in directory./allure_reports
. To run human-readable Allure report, execute command from the same directoryallure serve ./allure_results
.