Skip to content

Latest commit

 

History

History
60 lines (41 loc) · 1.58 KB

File metadata and controls

60 lines (41 loc) · 1.58 KB

Healenium Example - Playwright Python

Tests using Playwright for Python and pytest.

Setup

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 chromium

Every 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).

Running tests

  • 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

Project structure

  • 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 using query_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.