-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Description
The test Persistence — data survives app restart › notes persist after closing and reopening the app (e2e/persistence.spec.ts:55) is failing with a strict mode violation.
Error
locator.click: Error: strict mode violation: locator('h1.editor-title') resolved to 2 elements:
1) <h1 dir="auto" class="editor-title" ...>…</h1> aka locator('h1').first()
2) <h1 dir="auto" class="editor-title" ...>…</h1> aka getByRole('heading')
> 62 | await window.locator('h1.editor-title').click();
Root Cause
The app keeps all open tab editors mounted simultaneously (hidden via display: none). After creating the first note and then clicking "New note" again, there are two <h1 class="editor-title"> elements in the DOM — one for each tab. The bare h1.editor-title locator matches both, triggering Playwright's strict mode.
The fix should scope the locator to the visible editor, e.g. main:visible h1.editor-title (which is already used later in the same file for the second note).
Steps to Reproduce
pnpm exec playwright test -g "notes persist after closing and reopening the app"Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels