Tests using Playwright for Python and pytest.
First time only (create venv and install deps):
cd healenium-example-playwright-python
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
playwright install chromiumEvery new terminal (only activate the venv):
cd healenium-example-playwright-python
source .venv/bin/activate
pytest -v(Optional) Connect to Healenium proxy: set PLAYWRIGHT_SERVER_URL to your WebSocket endpoint (default: ws://localhost:8095/hlm-playwright-proxy).
-
Run all tests (requires Healenium/remote browser or local Chromium):
pytest
-
Run with verbose output:
pytest -v
-
Run only tests that are not marked
slow:pytest -m "not slow" -
Run a specific test file:
pytest tests/test-env/playwright-specific/test_get_by.py -v
conftest.py– Pytest/Playwright config:connect_options(WebSocket to Healenium), timeouts.tests/test-env/playwright-specific/– Locator API tests (getBy, chain, iframe, actions, expect, etc.).tests/test-env/selenium-like-locator-api/– Locator-based tests (CSS, XPath, simple, general, parent-child).tests/test-env/selenium-like-page-api/– Page API tests usingquery_selector(ElementHandle-style).
Tests target the same Healenium test env URL as the Node.js example: https://healenium.github.io/healenium-test-env/index.html.