feat: comprehensive Playwright E2E test suite #7
Reference in New Issue
Block a user
Delete Branch "tests/e2e"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Adds a full Playwright E2E test suite in
e2e/covering all key user journeys, wired into CI so every PR runs it.Tests added (
e2e/)test_home.pytest_cookie_consent.pytest_articles.pytest_article_detail.pytest_comments.py?commented=1, empty body → errors, disabled checktest_newsletter.pytest_feeds.pySeed content extended
seed_e2e_contentnow creates tagged article, about page, no-comments article, and legal pages.CI changes
pr-e2ejob (runs on every PR): builds image → starts postgres + app → playwright install →pytest e2e/e2e/suite alongside the existing journey test--ignore=e2e(browser tests excluded from coverage)Verified
ruffclean ✓- test_homepage_title_contains_brand: to_have_title() requires a string or regex, not a lambda; switch to re.compile('No Hype AI') - test_granular_preferences_save_dismisses_banner: wrong element clicked to open <details>; use 'details summary' locator directly - test_subscribe_invalid_email_shows_error: browser HTML5 email validation swallows the submit event before the JS handler fires; add 'novalidate' via evaluate() so the fetch still runs and the server returns 400 - test_copy_link_button_updates_text: clipboard API unavailable in headless Docker; add polyfill + pre-grant permissions in conftest page fixture so the JS success path runs and button text becomes 'Copied' - test_comments_section_absent_when_disabled: guard against Wagtail's add_child() resetting BooleanField defaults by calling an explicit .update(comments_enabled=False) + re-setting on the instance before save_revision().publish(); also tighten test to assert 200 + correct title Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>