Skip to content
Merged
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
4 changes: 3 additions & 1 deletion tests/e2e/management/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def ui_page(browser: "Browser") -> "Iterator[Page]":
page.fill("#username", UI_USERNAME)
page.fill("#password", UI_PASSWORD)
page.click('button[type="submit"]')
page.wait_for_function("() => document.cookie.includes('token=')")
page.wait_for_function(
"() => document.cookie.includes('token=') || !document.querySelector('#username')"
)
Comment on lines +54 to +56

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 No post-login assertion after #username disappears

The !document.querySelector('#username') branch resolves the wait as soon as the login form unmounts — but it does not verify that the resulting page is the dashboard rather than an error page (e.g., a 500 or a redirect back to /ui/login with a different form structure). If a misconfigured or unreachable backend causes the login to fail with a page that happens not to contain #username, every downstream test in the session will receive a page in a broken state and produce confusing assertion failures instead of a clear "fixture login failed" diagnostic. A lightweight guard after the wait_for_function — checking that the final URL contains /ui/ or that a known dashboard selector is present — would make the failure mode much more actionable.

yield page
finally:
context.close()
Loading