Metadata-Version: 2.5
Name: tracera-playwright
Version: 2.0.0
Summary: Tracera Autotest adapter for Playwright (Python)
Project-URL: Homepage, https://tracera.dev/docs/playwright-python
Project-URL: Changelog, https://github.com/tracera-dev/tracera-releases/releases?q=Adapters+%28Python%29
Project-URL: Bug-Tracker, https://github.com/tracera-dev/tracera-releases/issues
Author-email: Tracera <contact@tracera.dev>
License-Expression: Apache-2.0
License-File: LICENSE.md
Keywords: autotest,playwright,pytest,test-reporting,testops,tracera
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.11
Requires-Dist: tracera-core==2.0.0
Description-Content-Type: text/markdown

# tracera-playwright

Tracera Autotest adapter for Playwright for Python (pytest plugin).

**Tested on Python 3.11–3.15, pytest 8–9.1, Playwright 1.49–1.64, and pytest-playwright 0.5–0.10.**

```bash
pip install tracera-playwright
```

How-to: [Playwright Python](https://tracera.dev/docs/playwright-python). Shared env / run mode: [Autotest adapters](https://tracera.dev/docs/adapters#environment).

## Setup

The package registers as a pytest plugin automatically. Do **not** load `tracera-pytest` and `tracera-playwright` in the same pytest run.

Enable pytest-playwright screenshot / video / trace — files the runner keeps attach to the Tracera result automatically:

```ini
# pytest.ini
addopts = --screenshot only-on-failure --video retain-on-failure --tracing retain-on-failure
```

```python
from tracera_playwright import id as tracera_id
from tracera_playwright import tracera


@tracera_id(42, "e2e/login")
def test_login(page):
    page.goto("/login")
    tracera.step("assert signed in", lambda: None)
```

## Bind

`@tracera.id(…)` (preferred) or `tracera.test_case`. Optional name may use `{param}` / `{param_id}` from pytest parametrize. If `name` is omitted → `item.name`.

## Skip

Stock `pytest.skip`. The reason becomes a result `comment`.

## Steps

`tracera.step(title, body)`, `@tracera.step("…")`, `with` / `async with tracera.step("…"):`. Function-scoped fixtures → **Setup** / **Teardown**; suite-level fixtures are not reported.

## Comments, errors, and attachments

`tracera.comment` / `tracera.error` / `tracera.attachment` — see [Autotest adapters](https://tracera.dev/docs/adapters#comments-errors-and-attachments). Playwright screenshot / video / trace from the test output dir attach on their own.

## Parameterized

`@pytest.mark.parametrize` + `@tracera.id(id, "login as {login}")`. Retries: final attempt only; `PLAYWRIGHT_RETRY` on Env when retry > 0.
