static_site_tests: fix some bugs in the Playwright testing
- ID
14b1d8b- date
2026-02-28 10:11:08+00:00- author
Alex Chan <alex@alexwlchan.net>- parent
fc5f1bf- message
static_site_tests: fix some bugs in the Playwright testing- changed files
2 files, 4 additions, 3 deletions
Changed files
CHANGELOG.md (3174) → CHANGELOG.md (3226)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 389812d..1909781 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,8 @@
Change the type of `StaticSiteTestSuite.pages_to_check` from `set` to `list` to ensure consistent ordering of parametrised tests.
+Fix a bug when testing URLs with query parameters.
+
## v24 - 2026-02-28
In `StaticSiteTestSuite`, add testing with [Playwright](https://playwright.dev) that checks static websites render correctly.
src/chives/static_site_tests.py (9907) → src/chives/static_site_tests.py (9853)
diff --git a/src/chives/static_site_tests.py b/src/chives/static_site_tests.py
index c0aae22..419755e 100644
--- a/src/chives/static_site_tests.py
+++ b/src/chives/static_site_tests.py
@@ -285,8 +285,7 @@ class StaticSiteTestSuite[M](ABC):
The parameters for this test are populated by `pytest_generate_tests`.
"""
full_path = site_root.absolute() / url
- if not full_path.exists():
- raise FileNotFoundError(full_path)
+ file_uri = f"file://{full_path}"
p = browser.new_page()
@@ -298,7 +297,7 @@ class StaticSiteTestSuite[M](ABC):
page_errors = []
p.on("pageerror", lambda err: page_errors.append(err))
- p.goto(f"file://{full_path}")
+ p.goto(file_uri)
# Check there weren't any console errors logged to the page.
console_errors = [