diff --git a/padelnomics/pyproject.toml b/padelnomics/pyproject.toml index 73fadf2..ae44751 100644 --- a/padelnomics/pyproject.toml +++ b/padelnomics/pyproject.toml @@ -43,3 +43,5 @@ ignore = ["E501"] [tool.pytest.ini_options] asyncio_mode = "auto" testpaths = ["tests"] +markers = ["visual: Playwright visual tests (require browser install)"] +addopts = "-m 'not visual'" diff --git a/padelnomics/tests/test_visual.py b/padelnomics/tests/test_visual.py index 5873021..a4cc399 100644 --- a/padelnomics/tests/test_visual.py +++ b/padelnomics/tests/test_visual.py @@ -4,8 +4,9 @@ Visual regression tests using Playwright. Takes screenshots of key pages and verifies styling invariants (heading colors, backgrounds, nav layout, logo presence). -Usage: - uv run pytest tests/test_visual.py -x -v +Skipped by default (requires `playwright install chromium`). +Run explicitly with: + uv run pytest -m visual tests/test_visual.py -v Screenshots are saved to tests/screenshots/ for manual review. """ @@ -21,6 +22,8 @@ from playwright.sync_api import expect, sync_playwright from padelnomics import core from padelnomics.app import create_app +pytestmark = pytest.mark.visual + SCREENSHOTS_DIR = Path(__file__).parent / "screenshots" SCREENSHOTS_DIR.mkdir(exist_ok=True)