From 1b75a89d2c36e76f0c72a00dbc140b39bc5cfca9 Mon Sep 17 00:00:00 2001 From: Alan Buscaglia Date: Thu, 16 Jul 2026 14:58:09 +0200 Subject: [PATCH] fix(ui): avoid provider cleanup timeout --- ui/tests/helpers.ts | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/ui/tests/helpers.ts b/ui/tests/helpers.ts index 67d647448f..8104a8fd9e 100644 --- a/ui/tests/helpers.ts +++ b/ui/tests/helpers.ts @@ -162,30 +162,14 @@ export async function deleteProviderIfExists( const allRows = page.providersTable.locator("tbody tr"); - const isNoResultsRow = async (row: Locator): Promise => { - const text = await row.textContent(); - return text?.includes("No results") || text?.includes("No data") || false; - }; - const findProviderRow = async (): Promise => { - const rowByText = page.providersTable - .locator("tbody tr") - .filter({ hasText: providerUID }) - .first(); - if (await rowByText.isVisible().catch(() => false)) { - return rowByText; - } - - const count = await allRows.count(); - for (let i = 0; i < count; i++) { - const row = allRows.nth(i); - if (await isNoResultsRow(row)) { - continue; - } - const rowText = await row.textContent(); - if (rowText?.includes(providerUID)) { - return row; - } + // Read the currently rendered rows in one evaluation. Reading individual + // locators can wait for a virtualized row that was removed during a table + // refresh, exhausting the whole Playwright test timeout. + const rowTexts = await allRows.allTextContents(); + const rowIndex = rowTexts.findIndex((text) => text.includes(providerUID)); + if (rowIndex >= 0) { + return allRows.nth(rowIndex); } return null;