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).
Make sure pipenv is installed:
pip install --user pipenvOR (macOS)
brew install pipenvpipenv --python 3.14pipenv install pytest-playwright pytest-xdistpipenv run playwright installcp pytest.ini.example pytest.iniFrom inside the pipenv shell:
pipenv shell
pytest -vOr 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 chromiumOr if you want to run tests in headless mode, remove the "--headed" option from pytest.ini
- Open the project in PyCharm
- Go to Settings → Project → Python Interpreter
- Click Add Interpreter
- Select Pipenv Environment
- PyCharm will auto-detect the pipenv environment
- Click OK
PyCharm will automatically enable:
- Playwright autocompletion
- Page Object classes
- pytest integration
- 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
