tests(ui): wait for the token panel before filling the search box - #449
Merged
Merged
Conversation
The search-box test clicks Generate and then asserts the table contains "root-admin", which passes immediately from rows rendered at login when earlier tests already minted tokens, so it never waits for the POST. When the response lands while a later fill() is between focusing the search box and inserting text, showGeneratedToken() moves focus to the token field and the text goes there instead. The search box never sees an input event, no data-filter-empty row appears, and the test times out. Wait for the result panel, which is set visible in the same synchronous step as the focus change, before typing into the search box.
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the UI test in tests/ui/console.spec.js to wait for the #token-result panel to be visible after submitting the token generation form. This prevents a race condition where focus shifts to the token field and interferes with subsequent typing into the search box. There are no review comments, and I have no feedback to provide.
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.
What
Fixes the flake in
the search box filters rendered rowsseen in this run:Why
The test clicks Generate, then asserts the table contains
root-admin. Earlier tests already mintedroot-admintokens on the shared control plane, so that assertion passes at once from the rows rendered at login and the test does not actually wait for the POST.It then
fill()s the search box. Playwright'sfillfocuses the element and inserts the text in a separate CDP round-trip. If the token response lands in that gap,showGeneratedToken()runsinput.focus(); input.select()on#token-result-value, so the text goes into the token field. The search box never receives aninputevent, nodata-filter-emptyrow is created, and the expectation times out.Fix
Wait for
#token-resultto be visible before typing anywhere else. The panel is unhidden in the same synchronous step as the focus change, so once it is visible nothing else in the page steals focus. Test-only change.