mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
## Summary Alright, alright, alright. These e2e tests have been runnin' around like they're late for somethin', settin' tight little timeouts like the world's gonna end in 250 milliseconds. Man, you gotta *breathe*. Let the framework do its thing. Go slow to go fast, that's what I always say. ## Changes - **What**: Removed ~120 redundant timeout overrides from auto-retrying Playwright assertions (`toBeVisible`, `toBeHidden`, `toHaveCount`, `toBeEnabled`, `toHaveAttribute`, `toContainText`, `expect.poll`) where 5000ms is already the default. Also removed sub-5s timeouts (1s, 2s, 3s) that were just *begging* for flaky failures — like wearin' a belt and suspenders and also holdin' your pants up with both hands. Raised the absurdly short timeouts in `customMatchers.ts` (250ms `toPass` → 5000ms, 256ms poll → default). Kept `timeout: 5000` on `.toPass()` calls (defaults to 0), `.waitFor()`, `waitForRequest`, `waitForFunction`, intentionally-short timeouts inside retry loops, and conditional `.isVisible()/.catch()` checks — those fellas actually need the help. ## Review Focus Every remaining timeout in the diff is there for a *reason*. The ones on `.toPass()` stay because that API defaults to zero — it won't retry at all without one. The ones on `.waitFor()` and `waitForRequest` stay because those are locator actions, not auto-retrying assertions. The intentionally-short ones inside `toPass` retry loops (`interaction.spec.ts`) and the negative assertions (`actionbar.spec.ts` confirming no response arrives) — those are *supposed* to be tight. The short timeouts on regular assertions were actively *encouragin'* flaky failures. That's like settin' your alarm for 4 AM and then gettin' mad you're tired. Just... don't do that, man. Let things take the time they need. 38 files, net -115 lines. Less code, more chill. That's livin'. --------- Co-authored-by: Amp <amp@ampcode.com>
55 lines
1.8 KiB
TypeScript
55 lines
1.8 KiB
TypeScript
import { expect } from '@playwright/test'
|
|
|
|
import { assetPath } from '@e2e/fixtures/utils/paths'
|
|
import { load3dViewerTest as test } from '@e2e/fixtures/helpers/Load3DFixtures'
|
|
|
|
test.describe('Load3D Viewer', () => {
|
|
test.beforeEach(async ({ comfyPage, load3d }) => {
|
|
// Upload cube.obj so the node has a model loaded
|
|
const uploadResponsePromise = comfyPage.page.waitForResponse(
|
|
(resp) => resp.url().includes('/upload/') && resp.status() === 200,
|
|
{ timeout: 15000 }
|
|
)
|
|
const fileChooserPromise = comfyPage.page.waitForEvent('filechooser')
|
|
await load3d.getUploadButton('upload 3d model').click()
|
|
const fileChooser = await fileChooserPromise
|
|
await fileChooser.setFiles(assetPath('cube.obj'))
|
|
await uploadResponsePromise
|
|
|
|
const nodeRef = await comfyPage.nodeOps.getNodeRefById(1)
|
|
const modelFileWidget = await nodeRef.getWidget(0)
|
|
await expect.poll(() => modelFileWidget.getValue()).toContain('cube.obj')
|
|
|
|
await load3d.waitForModelLoaded()
|
|
})
|
|
|
|
test(
|
|
'Opens viewer dialog with canvas and controls sidebar',
|
|
{ tag: '@smoke' },
|
|
async ({ load3d, viewer }) => {
|
|
await load3d.openViewerButton.click()
|
|
await viewer.waitForOpen()
|
|
|
|
await expect(viewer.canvas).toBeVisible()
|
|
const canvasBox = await viewer.canvas.boundingBox()
|
|
expect(canvasBox!.width).toBeGreaterThan(0)
|
|
expect(canvasBox!.height).toBeGreaterThan(0)
|
|
|
|
await expect(viewer.sidebar).toBeVisible()
|
|
await expect(viewer.cancelButton).toBeVisible()
|
|
}
|
|
)
|
|
|
|
test(
|
|
'Cancel button closes the viewer dialog',
|
|
{ tag: '@smoke' },
|
|
async ({ load3d, viewer }) => {
|
|
await load3d.openViewerButton.click()
|
|
await viewer.waitForOpen()
|
|
|
|
await viewer.cancelButton.click()
|
|
await viewer.waitForClosed()
|
|
}
|
|
)
|
|
})
|