Repository navigation
test(playwright): re-resolve property-worker rows after the grid re-renders - #1456
Merged
Merged
Conversation
…enders openRowActionMenu called locator.scrollIntoViewIfNeeded on the row's action cell. Unlike click, that call resolves the element once and throws "Element is not attached to the DOM" when the row is replaced underneath it, and the property-workers grid does replace its rows after a save: the list refresh is a forkJoin of index-device-user, the properties dictionary and the assignments, so a caller that waited for index-device-user can still see the old rows until the other two land. That is how "a removed managing tag can be given back and saved" (shard r) failed intermittently in CI. The helper now clicks the trigger through a fresh locator (click re-resolves on detach and scrolls by itself) and reads the menu index off the action cell whose trigger is aria-expanded, so the index always belongs to the row that is rendered and owns the open menu. Every caller of openRowActionMenu (property workers, properties, chemicals and the specs that use it directly) gets this without call-site changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The focused test-helper change preserves caller contracts and has no identified blocking issues.
No open issues 🎉
What changed in this PR
Stabilizes the shared Playwright row-action-menu helper when grids replace rows during refreshes, without changing callers.
Changes:
- Replaces explicit scrolling with a locator click that handles detached elements.
- Resolves the menu index from the rendered row’s expanded trigger, with a bounded assertion.
| File | Description |
|---|---|
| eform-client/playwright/e2e/plugins/backend-configuration-pn/row-action-menu.ts | Updates menu opening and index resolution to tolerate row replacement. |
Review effort: Balanced
…e typing createTag filled #newTagName as soon as it was visible. The dialog's DOM attaches a frame before its first change detection (the host coalesces events), so ngModel's initial '' could overwrite the typed name and Save stayed disabled until the 5-minute test timeout (shard r on #1456). Wait for the translated dialog title, which renders in that first pass, fill once, and assert Save is enabled before clicking. Same fix in the task-list page object's createTag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ag dialogs Shard f on #1456 hit the same race in openBulkCreateTags: the textarea was filled before the dialog's first change detection, ngModel reset it, and Save stayed disabled. Wait for the translated title, fill once, and assert the typed value stuck. renameTag gets the same wait (there ngModel would write the old name back over the new one). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
r/property-worker-managing-tags.spec.ts› "a removed managing tag can be given back and saved" failed intermittently in CI (PR #1454, the master run after #1455, and work-items-planning-container run 39230664948). Each time a re-run passed. The error was:Root cause
row-action-menu.ts:27calledactionCell.scrollIntoViewIfNeeded(). Aclickre-resolves its locator when the element detaches, butLocator.scrollIntoViewIfNeededdoes not. It resolves an ElementHandle once (_withElement) and throws when that element is detached while it waits for the element to be stable.The property-workers grid replaces its rows after every save.
updateTable()is aforkJoinofindex-device-user,properties/dictionaryandproperties/assignment. The spec'ssaveEdit(like most callers) waits only forindex-device-user, so the old rows can still be on screen whenopenRowActionMenuresolves the action cell. The rows are swapped once the other two responses arrive.Fix (test code only)
openRowActionMenunow:actionMenutrigger through a fresh locator.clickre-resolves on detach and scrolls by itself, so the explicit scroll is gone.action-items-<i>index from the action cell whose trigger isaria-expanded="true". The index therefore belongs to the row that is actually rendered and owns the open menu. Before, it came from a row resolved before the click.No assertions were weakened and nothing is retried. Every caller of the helper gets the fix without call-site changes: the PropertyWorkers, Properties and Chemicals page objects, plus the
o/property-admin-actions,r/property-worker-one-minute-intervals,r/property-worker-set-password-gateandr/property-worker-delete-first-user-onlyspecs.Verification (CI container image from master, MariaDB 10.8, RabbitMQ, Playwright 1.59.1)
properties/dictionarywithpage.route, which widens the window where the grid swaps rows.rwith the fix: 47 passed. The 1 failure isproperty-workers-app-versions, which needsdocker execand had no docker CLI in my local Playwright container. It is unrelated to this change.o/property-admin-actions.spec.ts(properties rows): 3/3 passed.🤖 Generated with Claude Code