Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
name: Playwright Tests
# https://devblogs.microsoft.com/python/announcing-playwright-for-python-reliable-end-to-end-testing-for-the-web/
# https://github.com/marketplace/actions/run-playwright-tests
name: Site Tests

on:
push:
Expand All @@ -11,9 +9,11 @@ on:
- gh-pages
workflow_dispatch:

permissions:
contents: read

jobs:
test:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -22,11 +22,8 @@ jobs:
with:
version: "latest"
- name: Set up Python
run: uv python install 3.12
run: uv python install 3.14
- name: Install dependencies
run: |
uv sync --extra dev
uv run playwright install --with-deps chromium
run: uv sync --dev prerelease allow
- name: Run Tests
run: |
uv run python -m pytest tests/test.py::test_destination -v || echo "Some tests failed but continuing..."
run: uv run pytest -v
11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@ name = "blackpythondevs-site"
version = "0.1.0"
description = "Black Python Devs community website"
requires-python = ">=3.13"
dependencies = ["render-engine[cli]>=2026.3.4a2", "pyyaml"]
dependencies = [
"render-engine[cli]>=2026.3.4a2",
"pyyaml",
]

[project.optional-dependencies]
dev = [
"pre-commit",
"typer",
"rich",
"python-frontmatter",
"ephemeral_port_reserve",
"pytest-playwright",
"pytest-xprocess",
"axe-core-python==0.1.0",
"axe-playwright-python==0.1.7",
"pytest",
]

[tool.render-engine.cli]
Expand Down
24 changes: 0 additions & 24 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
import pytest
import ephemeral_port_reserve


@pytest.fixture(scope="module")
def url_port() -> tuple[str, int]:
"""returns the localhost and port"""
hostname = ephemeral_port_reserve.LOCALHOST
free_port = ephemeral_port_reserve.reserve(hostname)
url = f"http://{hostname}:{free_port}"
return url, free_port


ROUTES = [
"",
Expand All @@ -23,16 +12,3 @@ def url_port() -> tuple[str, int]:
@pytest.fixture(params=ROUTES)
def loaded_route(request):
return request.param


PROFILES = [
"iPhone 15",
"iPhone 15 landscape",
"iPhone 15 Plus",
"iPhone 15 Plus landscape",
]


@pytest.fixture(scope="session", params=PROFILES)
def loaded_profile(request):
return request.param
Loading
Loading