From 305372eb23153a874e020dcdc2fd76ec4ea40680 Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Thu, 15 Jan 2026 10:54:21 +0100 Subject: [PATCH] fix(e2e): stabilize flaky LWW delete vs update race test Replace racy :focus selector with explicit visibility wait and focus() call. The original selector failed intermittently because Angular sets focus asynchronously via change detection. --- e2e/tests/sync/supersync-lww-conflict.spec.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/e2e/tests/sync/supersync-lww-conflict.spec.ts b/e2e/tests/sync/supersync-lww-conflict.spec.ts index 9f360752e..02aaa4b71 100644 --- a/e2e/tests/sync/supersync-lww-conflict.spec.ts +++ b/e2e/tests/sync/supersync-lww-conflict.spec.ts @@ -1333,11 +1333,13 @@ test.describe('@supersync SuperSync LWW Conflict Resolution', () => { const taskLocatorB = clientB.page .locator(`task:not(.ng-animating):has-text("${taskName}")`) .first(); + await taskLocatorB.waitFor({ state: 'visible', timeout: 5000 }); await taskLocatorB.dblclick(); - const titleInputB = clientB.page.locator( - 'input.mat-mdc-input-element:focus, textarea:focus', - ); + const titleInputB = clientB.page + .locator('input.mat-mdc-input-element, textarea') + .first(); await titleInputB.waitFor({ state: 'visible', timeout: 5000 }); + await titleInputB.focus(); await titleInputB.fill(`${taskName}-Updated`); await clientB.page.keyboard.press('Enter'); await clientB.page.waitForTimeout(300);