Skip to content

aleksmt/nxlog

Repository files navigation

TodoMVC Playwright Tests (Python)

Automated tests for https://demo.playwright.dev/todomvc/#/ written using Python + Playwright + pytest.
The project uses pipenv for environment and dependency management. But you can use whatever you prefer (e.g., venv and pip).


🎥 Demo

Test workflow demo

🚀 Installation

Make sure pipenv is installed:

pip install --user pipenv

OR (macOS)

brew install pipenv

1. Create the virtual environment

pipenv --python 3.14

2. Install dependencies

pipenv install pytest-playwright pytest-xdist

3. Install Playwright browsers

pipenv run playwright install

4. (Optional) Create your own pytest.ini

cp pytest.ini.example pytest.ini

Running the tests

From inside the pipenv shell:

pipenv shell
pytest -v

Or directly:

pipenv run pytest -v
# if you want to run tests in parallel
pytest -v --numprocesses 4
# if you want to run tests with browser shown and/or different browsers
pytest -v --browser webkit --browser chromium

Or if you want to run tests in headless mode, remove the "--headed" option from pytest.ini


Using PyCharm

  1. Open the project in PyCharm
  2. Go to Settings → Project → Python Interpreter
  3. Click Add Interpreter
  4. Select Pipenv Environment
  5. PyCharm will auto-detect the pipenv environment
  6. Click OK

PyCharm will automatically enable:

  • Playwright autocompletion
  • Page Object classes
  • pytest integration

Test Coverage

  • Adding todo items: English, non-English, numeric, symbols
  • Marking items as completed
  • Verifying the "Completed" view
  • Deleting items
  • Active/Completed filter behavior
  • Correct list state after operations

About

Automated tests for https://demo.playwright.dev/todomvc/#/ written using Python + Playwright + pytest.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages