mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 06:47:33 +00:00
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.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user