test(e2e): stable workspace-node selector for chat-desktop specs #2648
Reference in New Issue
Block a user
Delete Branch "fix/2506-chat-desktop-workspace-selector"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes molecule-core#2506.
The chat-desktop E2E selected the workspace node via getByText(workspaceName, { exact: true }) scoped to .react-flow__node. The hidden ConciergeShell also renders a matching wsName div, so the unscoped locator resolved to the invisible concierge node in DOM-order-dependent fashion, causing 7/12 Playwright specs to fail on main.
Make WorkspaceNode emit a deterministic data-testid derived from the workspace name (workspace-node-{name}) and switch chat-desktop.spec.ts to page.getByTestId with that id. Update the staging-concierge locator prefix and the WorkspaceNode unit-test helper to match the new testid shape.
Test plan
SOP checklist
Comprehensive testing performed
Local-postgres E2E run
N/A: pure frontend / test-only change; no backend or database surface.
Staging-smoke verified or pending
Scheduled post-merge; change is limited to canvas E2E selectors and component testid.
Root-cause not symptom
Root cause: hidden ConciergeShell rendered a duplicate wsName div that DOM-order getByText.first() resolved to, making the workspace click hit the wrong node.
Five-Axis review walked
No backwards-compat shim / dead code added
Yes — no shim; old static data-testid="workspace-node" is replaced by dynamic id, and all consumers are updated.
Memory consulted
APPROVED: 5-axis review complete on head
9ce932a02b. Correctness:WorkspaceNodenow exposes a stableworkspace-node-{name}test id and the chat/staging E2E selectors were updated to use that deterministic node target, avoiding hidden ConciergeShell text collisions. Tests:CI / all-requiredis green and the component test helper was updated to the dynamic id. Security: no new data exposure beyond an existing workspace display name already rendered in the node. Performance: no runtime impact. Maintainability: selector intent is clearer and staging prefix selectors preserve multi-node assertions.APPROVE: stable per-workspace data-testid removes ambiguous hidden-node selection while updating dependent tests/selectors consistently; CI/all-required green.