test: harden 3 flaky e2e tests with real readiness checks

- cloud-asset-default: poll for widget type before asserting value
- settingsDialog: wait for combobox visible+enabled after search filter
- enterBuilder: wait for workflow-tab popover to dismiss before clicking

Amp-Thread-ID: https://ampcode.com/threads/T-019d882d-8403-7648-a9f3-06d7518d9772
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
DrJKL
2026-04-13 12:13:19 -07:00
parent 7985306352
commit e63757cfed
3 changed files with 30 additions and 1 deletions

View File

@@ -94,6 +94,13 @@ export class AppModeHelper {
/** Enter builder mode via the "Workflow actions" dropdown. */
async enterBuilder() {
// Wait for any workflow-tab popover to dismiss before clicking —
// the popover overlay can intercept the "Workflow actions" click.
await this.page
.locator('.workflow-popover-fade')
.waitFor({ state: 'hidden', timeout: 5000 })
.catch(() => {})
await this.page
.getByRole('button', { name: 'Workflow actions' })
.first()

View File

@@ -74,6 +74,22 @@ test.describe('Asset-supported node default value', { tag: '@cloud' }, () => {
return node!.id
})
// Wait for the asset widget to be created on the new node before
// checking its value — widget mounting is async and may lag behind
// node creation.
await expect
.poll(
() =>
comfyPage.page.evaluate((id) => {
const node = window.app!.graph.getNodeById(id)
return node?.widgets?.find(
(w: { name: string }) => w.name === 'ckpt_name'
)?.type
}, nodeId),
{ timeout: 10_000 }
)
.toBe('asset')
await expect
.poll(
async () => {

View File

@@ -145,10 +145,16 @@ test.describe('Settings dialog', { tag: '@ui' }, () => {
const settingRow = dialog.root.locator(`[data-setting-id="${settingId}"]`)
await expect(settingRow).toBeVisible()
// Wait for the search filter to settle — PrimeVue re-renders the
// settings list after typing, and the combobox may not be stable
// until exactly one row matches.
const select = settingRow.getByRole('combobox')
await expect(select).toBeVisible()
await expect(select).toBeEnabled()
// Open the dropdown via its combobox role and verify it expanded.
// Retry because the PrimeVue Select may re-render during search
// filtering, causing the first click to land on a stale element.
const select = settingRow.getByRole('combobox')
await expect(async () => {
const expanded = await select.getAttribute('aria-expanded')
if (expanded !== 'true') await select.click()