fix: resolve ruff/mypy lint errors and fix E2E test failures
- Use datetime.timedelta instead of timezone.timedelta (mypy) - Fix import ordering (ruff I001) - Fix admin sidebar E2E selector: use #wagtail-sidebar (Wagtail 7) - Set deterministic published_date on seeded E2E articles for stable ordering - Fix nightly test strict-mode violation: exact=True for Comments heading Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -19,7 +19,7 @@ def admin_login(page: Page, base_url: str) -> None:
|
||||
def test_articles_menu_item_visible(page: Page, base_url: str) -> None:
|
||||
"""The admin sidebar should contain an 'Articles' menu item."""
|
||||
admin_login(page, base_url)
|
||||
sidebar = page.locator("[data-side-panel]").first
|
||||
sidebar = page.locator("#wagtail-sidebar")
|
||||
articles_link = sidebar.get_by_role("link", name="Articles")
|
||||
expect(articles_link).to_be_visible()
|
||||
|
||||
@@ -47,8 +47,8 @@ def test_article_editor_has_tabs(page: Page, base_url: str) -> None:
|
||||
"""The article editor should have Content, Metadata, Publishing, and SEO tabs."""
|
||||
admin_login(page, base_url)
|
||||
page.goto(f"{base_url}/cms/articles/", wait_until="networkidle")
|
||||
# Click the first article to edit it
|
||||
page.get_by_text("Nightly Playwright Journey").first.click()
|
||||
# Click the first article title link to edit it
|
||||
page.get_by_role("link", name="Nightly Playwright Journey").first.click()
|
||||
page.wait_for_load_state("networkidle")
|
||||
expect(page.get_by_role("tab", name="Content")).to_be_visible()
|
||||
expect(page.get_by_role("tab", name="Metadata")).to_be_visible()
|
||||
|
||||
Reference in New Issue
Block a user