From e7e8c674b3563c4855ecc993b4fd49fe4128dbf4 Mon Sep 17 00:00:00 2001 From: snomiao Date: Thu, 9 Oct 2025 00:49:04 +0000 Subject: [PATCH] fix: replace timeout with waitForState({ visible: true }) in userSelectView test Replace page.waitForTimeout(500) with firstOption.waitFor({ state: 'visible' }) to properly wait for dropdown options to populate instead of using arbitrary timeout. Addresses review feedback from christian-byrne. --- browser_tests/tests/userSelectView.spec.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/browser_tests/tests/userSelectView.spec.ts b/browser_tests/tests/userSelectView.spec.ts index 9237e1e09..a6887c5b2 100644 --- a/browser_tests/tests/userSelectView.spec.ts +++ b/browser_tests/tests/userSelectView.spec.ts @@ -41,11 +41,9 @@ test.describe('User Select View', () => { const dropdownList = page.locator('.p-select-list') await expect(dropdownList).toBeVisible() - // Wait for dropdown to populate - await page.waitForTimeout(500) - // Try to click first option if it exists const firstOption = page.locator('.p-select-list .p-select-option').first() + await firstOption.waitFor({ state: 'visible' }).catch(() => {}) if ((await firstOption.count()) > 0) { await firstOption.click()