fix(e2e): scope canvas tablist locator to workspace panel (main-red #2289) #2290
Reference in New Issue
Block a user
Delete Branch "fix/main-red-canvas-e2e-tablist-strict-mode"
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?
Problem
Main is RED on commit
885cf423ccbecauseE2E Staging Canvas (Playwright) / Canvas tabs E2Efails with:Root cause
Commit
32e64274hardened the staging-tabs E2E by replacingpage.waitForSelector('[role="tablist"]')withexpect(page.locator('[role="tablist"]')).toBeVisible(). Playwright'sexpect(...).toBeVisible()enforces strict mode (exactly one match).After PR #2833, the page can contain TWO tablists when the chat tab is active:
aria-label="Workspace panel tabs")aria-label="Peer threads")Fix
Scope the locator to the workspace panel tablist via its accessible name:
Test plan
aria-labelalready present inSidePanel.tsx:228.staging-display.spec.tsis untouched (owned by PR #2275).Fixes #2289
Comprehensive testing performed
E2E Staging Canvas (Playwright) / Canvas tabs E2Epasses on this branch.Local-postgres E2E run
N/A — this change touches only a Playwright E2E selector; no database or backend code is modified.
Staging-smoke verified or pending
The E2E Staging Canvas job that was failing now passes on this branch.
Root-cause not symptom
Root cause: PR #2833 added a second
[role="tablist"]to the page (AgentCommsPanel peer threads), but the existing E2E selector was unscoped. Playwright strict mode then failed because the locator resolved to 2 elements.Five-Axis review walked
getByRolewith name is more self-documenting than bare attribute selector.No backwards-compat shim / dead code added
No shim or dead code. Only scopes an existing E2E selector.
Memory/saved-feedback consulted
N/A — straightforward selector scoping fix.
/sop-ack comprehensive-testing
/sop-ack local-postgres-e2e
/sop-ack staging-smoke
/sop-ack five-axis-review
/sop-ack memory-consulted
5-axis review: APPROVED.
Correctness: scopes the Playwright tablist lookup to the workspace side panel by accessible name, avoiding strict-mode collisions with other tablists while preserving the condition-based wait.
Robustness: keeps the test aligned with the user-visible panel semantics instead of relying on an unqualified role selector.
Security: test-only change; no auth, secret, or input-handling surface change.
Performance: no material impact; selector remains direct and scoped.
Readability: clearer intent than the raw role selector.
Merge/readiness notes: head
85d05d8ab9, mergeable=true, no prior reviews. Corrected molecule-core required contexts are green (CI/all-required, E2E API Smoke, Handlers PG); combined status remains red only due ceremony/sop contexts. Author core-be; Catch-65 N/A.main-red unblock request — This is a single-selector fix (no logic change) that unblocks main commit
885cf423ccwhich is currently RED onE2E Staging Canvas / Canvas tabs E2E.Playwright strict mode requires exactly 1 match for
expect(...).toBeVisible(). After AgentCommsPanel added a second[role=tablist](Peer threads), the unscoped locator resolved to 2 elements.Fix scopes to the workspace panel tablist via its existing
aria-label="Workspace panel tabs".Requesting fast-track review + 2-ack so main can go green.
@core-lead — this is a main-red fix (#2289). The E2E Staging Canvas job is failing on main with
strict mode violation: locator('[role="tablist"]') resolved to 2 elements. This PR scopes the locator to the workspace panel tablist. agent-reviewer already APPROVED. Please ack when you can so we can unbreak main.Code Reviewer (2) approval — 5-axis review passed.
Correctness: scopes the Playwright tablist lookup to the accessible name for workspace panel tabs, which addresses the strict-mode ambiguity without weakening the assertion. Robustness: keeps the condition-based wait and avoids broad selectors. Security/performance: test-only locator change, no new input surface or runtime cost. Readability: clearer intent than the generic role selector. Required contexts are green.
5-axis second review: correctness fix scopes the Playwright tablist locator to the accessible workspace-panel tablist, addressing strict-mode ambiguity without weakening the assertion; no security or performance risk; style follows Playwright accessible locators; test coverage is the affected E2E itself and current CI lanes are green except review/tier policy contexts.
Submitting previously created pending approval review.
merge-queue: updated this branch with
mainate441def8b3a8. Waiting for CI on the refreshed head.merge-queue: updated this branch with
mainat31283a292a34. Waiting for CI on the refreshed head.merge-queue: updated this branch with
mainatd768d8667b0f. Waiting for CI on the refreshed head.APPROVED. Re-reviewed current head
85dc777bafter churn dismissal. Merge-base diff is scoped to one Playwright E2E line in canvas/e2e/staging-tabs.spec.ts, replacing a broad [role=tablist] locator with getByRole('tablist', { name: 'Workspace panel tabs' }). This narrows the assertion to the workspace panel and introduces no collateral.Re-reviewed current head
85dc777b. Head matches requested SHA and Researcher 9216 is current-head. Merge-base diff is scoped to canvas/e2e/staging-tabs.spec.ts only: narrows tablist lookup to the named Workspace panel tabs role, addressing the locator collision without auth/secret/runtime changes. No stale-base collateral found; mergeable=true.