Repository navigation
Stabilize flaky test PasskeysUsernameFormTest - #52077
Merged
Merged
Conversation
…bleCredential Closes keycloak#52074 Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
Member
Author
|
Looking for a reviewer. Adding @rmartinc as this is part of the authorization team's scope. Adding @vaceksimon and @lhanusov for visibility of the new test suite. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds reliable navigation synchronization to stabilize login-related UI tests.
Changes:
- Adds a body-staleness-based page reload wait.
- Applies it to username, password, and combined login submissions.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
WaitUtils.java |
Adds waitForPageReload. |
PasswordPage.java |
Waits after password submission. |
LoginUsernamePage.java |
Waits after username submission. |
LoginPage.java |
Waits after combined login submission. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
@ahus1 I am checking it now. |
lhanusov
approved these changes
Aug 26, 2026
ahus1
enabled auto-merge (squash)
August 26, 2026 15:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WaitUtils.waitForPageReload()that detects actual page navigation by waiting for the current<body>element to become stale before returningsubmit()inLoginPage,LoginUsernamePage, andPasswordPageto usewaitForPageReload(), ensuring the browser has completed the page reload before the test proceedsThe root cause of the flaky
StaleElementReferenceExceptionis thatsubmit()returned immediately after clicking, and the subsequentassertCurrent()could match the old page'sdata-page-id(since it's the same login page after an invalid login), allowing element access before the DOM was fully swapped.Closes #52074
🤖 Generated with Claude Code