E2E Defect: modal.spec.ts:95:6 focus returns to trigger after closing policy modal #38

Open
opened 2026-02-14 02:03:50 +00:00 by santhoshj · 0 comments
Owner

Automated regression reported this failure from Playwright artifacts.

Defect Details

  • Case key: modal.spec.ts:95:6 focus returns to trigger after closing policy modal
  • Suite: capabilities\accessibility\modal.spec.ts
  • Test: Policy Modal Accessibility @smoke › focus returns to trigger after closing policy modal @smoke
  • Failure frequency: 8

Error Message

[smoke-chromium] › capabilities\accessibility\modal.spec.ts:95:6 › Policy Modal Accessibility @smoke › focus returns to trigger after closing policy modal @smoke       Error: expect(locator).toBeVisible() failed      Locator: locator('[role="dialog"][aria-modal="true"]:has(h2)')     Expected: visible     Error: strict mode violation: locator('[role="dialog"][aria-modal="true"]:has(h2)') resolved to 2 elements:         1) <div role="dialog" aria-modal="true" aria-label="Article summary" class="relative w-full sm:w-[92vw] lg:w-[70vw] xl:w-[60vw] 2xl:w-[50vw] max-w-[1200px] mx-4 max-h-[96vh] overflow-auto rounded-xl border border-white/10 bg-[#0f172a]">…</div> aka getByLabel('Article summary')         2) <div role="dialog" aria-modal="true" aria-label="Terms of Use" :aria-label="openType === 'terms' ? 'Terms of Use' : 'Attribution'" class="relative w-full sm:w-[92vw] lg:w-[70vw] xl:w-[60vw] 2xl:w-[50vw] max-w-[1200px] mx-4 max-h-[96vh] overflow-auto rounded-xl border border-white/10 bg-[#0f172a]">…</div> aka getByRole('dialog', { name: 'Terms of Use' })      Call log:       - Expect "toBeVisible" with timeout 5000ms       - waiting for locator('[role="dialog"][aria-modal="true"]:has(h2)') 

Evidence (Screenshots/Error Context)

  • e2e/test-results/capabilities-accessibility-e758e--closing-policy-modal-smoke-smoke-chromium\test-failed-1.png
  • e2e/test-results/capabilities-accessibility-e758e--closing-policy-modal-smoke-smoke-chromium\error-context.md

Root Cause Analysis

Selector ambiguity: locator matches multiple dialogs (article summary and policy modal) causing strict-mode failures.

Automated regression reported this failure from Playwright artifacts. ## Defect Details - Case key: `modal.spec.ts:95:6 focus returns to trigger after closing policy modal` - Suite: `capabilities\accessibility\modal.spec.ts` - Test: `Policy Modal Accessibility @smoke › focus returns to trigger after closing policy modal @smoke` - Failure frequency: 8 ## Error Message ```text [smoke-chromium] › capabilities\accessibility\modal.spec.ts:95:6 › Policy Modal Accessibility @smoke › focus returns to trigger after closing policy modal @smoke Error: expect(locator).toBeVisible() failed Locator: locator('[role="dialog"][aria-modal="true"]:has(h2)') Expected: visible Error: strict mode violation: locator('[role="dialog"][aria-modal="true"]:has(h2)') resolved to 2 elements: 1) <div role="dialog" aria-modal="true" aria-label="Article summary" class="relative w-full sm:w-[92vw] lg:w-[70vw] xl:w-[60vw] 2xl:w-[50vw] max-w-[1200px] mx-4 max-h-[96vh] overflow-auto rounded-xl border border-white/10 bg-[#0f172a]">…</div> aka getByLabel('Article summary') 2) <div role="dialog" aria-modal="true" aria-label="Terms of Use" :aria-label="openType === 'terms' ? 'Terms of Use' : 'Attribution'" class="relative w-full sm:w-[92vw] lg:w-[70vw] xl:w-[60vw] 2xl:w-[50vw] max-w-[1200px] mx-4 max-h-[96vh] overflow-auto rounded-xl border border-white/10 bg-[#0f172a]">…</div> aka getByRole('dialog', { name: 'Terms of Use' }) Call log: - Expect "toBeVisible" with timeout 5000ms - waiting for locator('[role="dialog"][aria-modal="true"]:has(h2)') ``` ## Evidence (Screenshots/Error Context) - `e2e/test-results/capabilities-accessibility-e758e--closing-policy-modal-smoke-smoke-chromium\test-failed-1.png` - `e2e/test-results/capabilities-accessibility-e758e--closing-policy-modal-smoke-smoke-chromium\error-context.md` ## Root Cause Analysis Selector ambiguity: locator matches multiple dialogs (article summary and policy modal) causing strict-mode failures.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: santhoshj/clawfort#38