Repository navigation
Conversation
Closes keycloak#52430 Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
ahus1
force-pushed
the
is-52430-fix-userprofile
branch
from
September 4, 2026 10:42
276cddf to
4648561
Compare
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
All reviewed changes are focused, and no unresolved issues were identified.
Pull request overview
Stabilizes serial user-profile tests for both empty and populated user lists.
Changes:
- Adds a resilient create-user helper using alternative Playwright locators.
- Replaces five empty-state-only clicks with the helper.
File summaries
| File | Description |
|---|---|
js/apps/admin-ui/test/realm-settings/userprofile.ts |
Adds the create-user helper. |
js/apps/admin-ui/test/realm-settings/userprofile.spec.ts |
Uses the helper across five tests. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ahus1
marked this pull request as ready for review
September 4, 2026 11:09
edewit
approved these changes
Sep 4, 2026
Contributor
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.
Closes #52430
Summary
Minimal backport of the
clickCreateUserfix from PR #50995 torelease/26.7. Replaces all 5 directpage.getByTestId("no-users-found-empty-action").click()calls inuserprofile.spec.tswith a helper that handles both the empty-state and populated user list.Decision: minimal backport vs full PR #50995
PR #50995 on
mainoverhauled many test helpers (table.ts,form.ts) and restructured multiple test suites. Only theclickCreateUserportion is relevant to this failure. This PR extracts just that:userprofile.ts: AddedclickCreateUser(page)helper using.or().click()— simpler than themainimplementation which uses if-statementsuserprofile.spec.ts: Replaced all 5 rawno-users-found-empty-actionclicks and added the importDecision:
.or().click()over if-statement branchingThe
mainimplementation checksemptyAction.count()andisVisible()then conditionally clicks one button or the other. This is a TOCTOU race (state can change between the check and the click).Since
ListEmptyStateis a separate React component that replaces the table entirely, only one of the two buttons (no-users-found-empty-actionoradd-user) exists in the DOM at a time. This means.or()always matches exactly one element, and Playwright's.click()waits for it to be actionable. No branching needed.Why the raw click fails
The test suite uses
test.describe.serial, so tests share realm state. Earlier tests create users (testuser7–9), making the empty-state action disappear. Later tests that clickno-users-found-empty-actiondirectly will wait forever since only theadd-userbutton is rendered.