Skip to content

Playwright auto tests example with python and pytest

Notifications You must be signed in to change notification settings

vgoroshenko/plwrt_py_auto

Repository files navigation

Test and Deploy result from Python

Test and Deploy result from Docker

Build and push latest Playwright, Allure docker image

Playwright Pytest Allure Page object model example

Example application for writing automated acceptance tests

Link to Allure report after run tests

Install your dependencies:

python -m venv venv
venv/Scripts/activate
pip install -r requirements.txt
playwright install --with-deps

Start web server:

docker-compose up -d

Load the page you want to see in your browser:

http://localhost:5000/

Start tests (run parallel tests in 3 browser):

pytest

See Allure report result:

allure serve reports

Start tests using Docker test:

docker run -v .:/app vgoroshenko/playwright sh -c "pip install  -r requirements.txt; pytest"
docker run -v .:/app vgoroshenko/allure sh -c "allure generate reports"

An example application that captures prominent and ugly functionality found on the web. Perfect for writing automated acceptance tests against.

Deployed and available at http://the-internet.herokuapp.com.