fix(ci): address PR blockers and move CI/nightly off sqlite
This commit is contained in:
42
apps/core/tests/test_nightly_e2e_playwright.py
Normal file
42
apps/core/tests/test_nightly_e2e_playwright.py
Normal file
@@ -0,0 +1,42 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
|
||||
import pytest
|
||||
from playwright.sync_api import expect, sync_playwright
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_nightly_playwright_journey() -> None:
|
||||
base_url = os.getenv("E2E_BASE_URL")
|
||||
if not base_url:
|
||||
pytest.skip("E2E_BASE_URL is not set")
|
||||
|
||||
base_url = base_url.rstrip("/")
|
||||
|
||||
with sync_playwright() as pw:
|
||||
browser = pw.chromium.launch()
|
||||
page = browser.new_page()
|
||||
|
||||
page.goto(f"{base_url}/", wait_until="networkidle")
|
||||
expect(page.locator("#cookie-banner")).to_be_visible()
|
||||
page.get_by_role("button", name="Toggle theme").click()
|
||||
page.get_by_role("button", name="Accept all").first.click()
|
||||
expect(page.locator("#cookie-banner")).to_have_count(0)
|
||||
|
||||
page.goto(f"{base_url}/articles/", wait_until="networkidle")
|
||||
first_article_link = page.locator("main article a").first
|
||||
expect(first_article_link).to_be_visible()
|
||||
article_href = first_article_link.get_attribute("href")
|
||||
assert article_href
|
||||
|
||||
article_url = article_href if article_href.startswith("http") else f"{base_url}{article_href}"
|
||||
page.goto(article_url, wait_until="networkidle")
|
||||
expect(page.get_by_role("heading", name="Comments")).to_be_visible()
|
||||
expect(page.get_by_role("button", name="Post comment")).to_be_visible()
|
||||
|
||||
page.goto(f"{base_url}/feed/", wait_until="networkidle")
|
||||
feed_content = page.content()
|
||||
assert "<rss" in feed_content or "<feed" in feed_content
|
||||
|
||||
browser.close()
|
||||
Reference in New Issue
Block a user