From ecd454ab82f80db8d6ea117a66a4ae548b2b6d81 Mon Sep 17 00:00:00 2001 From: huanghuoguoguo <60681390+huanghuoguoguo@users.noreply.github.com> Date: Sat, 17 Oct 2026 15:58:12 +0800 Subject: [PATCH] test(web): wait for filter popups to restore focus --- web/tests/e2e/monitoring-executions.spec.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/web/tests/e2e/monitoring-executions.spec.ts b/web/tests/e2e/monitoring-executions.spec.ts index 6e253bad6..8d33cbf13 100644 --- a/web/tests/e2e/monitoring-executions.spec.ts +++ b/web/tests/e2e/monitoring-executions.spec.ts @@ -445,9 +445,20 @@ test('remembers all filters on reload and persists resetting them', async ({ for (const [id, label] of selections) { await page.locator(`#monitoring-filter-${id}`).click(); if (id === 'processor') { - await page.getByRole('checkbox', { name: label, exact: true }).check(); + const checkbox = page.getByRole('dialog').getByRole('checkbox', { + name: label, + exact: true, + }); + await checkbox.check(); + await expect(checkbox).toBeChecked(); await page.keyboard.press('Escape'); - } else await page.getByRole('option', { name: label, exact: true }).click(); + await expect(page.getByRole('dialog')).toHaveCount(0); + } else { + await page.getByRole('option', { name: label, exact: true }).click(); + await expect(page.getByRole('listbox')).toHaveCount(0); + } + // The previous popup must finish restoring focus before opening another. + await expect(page.locator(`#monitoring-filter-${id}`)).toBeFocused(); } await page.reload(); for (const [id, label] of selections) {