Tests: Playwright test timeouts (#7231)

## Summary

See where we can use proper DOM waiting instead of waitForTimeout.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7231-WIP-Playwright-test-timeouts-2c36d73d3650812b966ac3d9c338dfd4)
by [Unito](https://www.unito.io)
This commit is contained in:
Alexander Brown
2025-12-08 15:50:35 -08:00
committed by GitHub
parent 973d7678a1
commit 5c01861f4e
22 changed files with 0 additions and 107 deletions

View File

@@ -1272,9 +1272,6 @@ export class ComfyPage {
}, 'image/png') }, 'image/png')
}) })
}, filename) }, filename)
// Wait a bit for the download to process
await this.page.waitForTimeout(500)
} }
/** /**

View File

@@ -60,9 +60,6 @@ export class ComfyNodeSearchBox {
await this.input.waitFor({ state: 'visible' }) await this.input.waitFor({ state: 'visible' })
await this.input.fill(nodeName) await this.input.fill(nodeName)
await this.dropdown.waitFor({ state: 'visible' }) await this.dropdown.waitFor({ state: 'visible' })
// Wait for some time for the auto complete list to update.
// The auto complete list is debounced and may take some time to update.
await this.page.waitForTimeout(500)
await this.dropdown await this.dropdown
.locator('li') .locator('li')
.nth(options?.suggestionIndex || 0) .nth(options?.suggestionIndex || 0)

View File

@@ -116,7 +116,6 @@ export class WorkflowsSidebarTab extends SidebarTab {
async switchToWorkflow(workflowName: string) { async switchToWorkflow(workflowName: string) {
const workflowLocator = this.getOpenedItem(workflowName) const workflowLocator = this.getOpenedItem(workflowName)
await workflowLocator.click() await workflowLocator.click()
await this.page.waitForTimeout(300)
} }
getOpenedItem(name: string) { getOpenedItem(name: string) {
@@ -138,7 +137,6 @@ export class WorkflowsSidebarTab extends SidebarTab {
.click() .click()
await this.page.keyboard.type(newName) await this.page.keyboard.type(newName)
await this.page.keyboard.press('Enter') await this.page.keyboard.press('Enter')
await this.page.waitForTimeout(300)
} }
async insertWorkflow(locator: Locator) { async insertWorkflow(locator: Locator) {

View File

@@ -95,7 +95,6 @@ export class Topbar {
} }
async openTopbarMenu() { async openTopbarMenu() {
await this.page.waitForTimeout(1000)
await this.menuTrigger.click() await this.menuTrigger.click()
await this.menuLocator.waitFor({ state: 'visible' }) await this.menuLocator.waitFor({ state: 'visible' })
return this.menuLocator return this.menuLocator

View File

@@ -462,7 +462,6 @@ export class NodeReference {
async convertToSubgraph() { async convertToSubgraph() {
await this.clickContextMenuOption('Convert to Subgraph') await this.clickContextMenuOption('Convert to Subgraph')
await this.comfyPage.nextFrame() await this.comfyPage.nextFrame()
await this.comfyPage.page.waitForTimeout(256)
const nodes = await this.comfyPage.getNodeRefsByTitle('New Subgraph') const nodes = await this.comfyPage.getNodeRefsByTitle('New Subgraph')
if (nodes.length !== 1) { if (nodes.length !== 1) {
throw new Error( throw new Error(
@@ -511,7 +510,6 @@ export class NodeReference {
// Double-click to enter subgraph // Double-click to enter subgraph
await this.comfyPage.canvas.dblclick({ position, force: true }) await this.comfyPage.canvas.dblclick({ position, force: true })
await this.comfyPage.nextFrame() await this.comfyPage.nextFrame()
await this.comfyPage.page.waitForTimeout(500)
// Check if we successfully entered the subgraph // Check if we successfully entered the subgraph
isInSubgraph = await this.comfyPage.page.evaluate(() => { isInSubgraph = await this.comfyPage.page.evaluate(() => {

View File

@@ -75,9 +75,6 @@ test.describe('Background Image Upload', () => {
// Upload the test image // Upload the test image
await fileChooser.setFiles(comfyPage.assetPath('image32x32.webp')) await fileChooser.setFiles(comfyPage.assetPath('image32x32.webp'))
// Wait for upload to complete and verify the setting was updated
await comfyPage.page.waitForTimeout(500) // Give time for file reading
// Verify the URL input now has an API URL // Verify the URL input now has an API URL
const urlInput = backgroundImageSetting.locator('input[type="text"]') const urlInput = backgroundImageSetting.locator('input[type="text"]')
const inputValue = await urlInput.inputValue() const inputValue = await urlInput.inputValue()
@@ -191,14 +188,11 @@ test.describe('Background Image Upload', () => {
) )
await uploadButton.hover() await uploadButton.hover()
// Wait for tooltip to appear and verify it exists
await comfyPage.page.waitForTimeout(700) // Tooltip delay
const uploadTooltip = comfyPage.page.locator('.p-tooltip:visible') const uploadTooltip = comfyPage.page.locator('.p-tooltip:visible')
await expect(uploadTooltip).toBeVisible() await expect(uploadTooltip).toBeVisible()
// Move away to hide tooltip // Move away to hide tooltip
await comfyPage.page.locator('body').hover() await comfyPage.page.locator('body').hover()
await comfyPage.page.waitForTimeout(100)
// Set a background to enable clear button // Set a background to enable clear button
const urlInput = backgroundImageSetting.locator('input[type="text"]') const urlInput = backgroundImageSetting.locator('input[type="text"]')
@@ -209,8 +203,6 @@ test.describe('Background Image Upload', () => {
const clearButton = backgroundImageSetting.locator('button:has(.pi-trash)') const clearButton = backgroundImageSetting.locator('button:has(.pi-trash)')
await clearButton.hover() await clearButton.hover()
// Wait for tooltip to appear and verify it exists
await comfyPage.page.waitForTimeout(700) // Tooltip delay
const clearTooltip = comfyPage.page.locator('.p-tooltip:visible') const clearTooltip = comfyPage.page.locator('.p-tooltip:visible')
await expect(clearTooltip).toBeVisible() await expect(clearTooltip).toBeVisible()
}) })

View File

@@ -203,7 +203,6 @@ test.describe('Node Color Adjustments', () => {
comfyPage comfyPage
}) => { }) => {
await comfyPage.setSetting('Comfy.Node.Opacity', 0.5) await comfyPage.setSetting('Comfy.Node.Opacity', 0.5)
await comfyPage.page.waitForTimeout(128)
// Drag mouse to force canvas to redraw // Drag mouse to force canvas to redraw
await comfyPage.page.mouse.move(0, 0) await comfyPage.page.mouse.move(0, 0)
@@ -211,7 +210,6 @@ test.describe('Node Color Adjustments', () => {
await expect(comfyPage.canvas).toHaveScreenshot('node-opacity-0.5.png') await expect(comfyPage.canvas).toHaveScreenshot('node-opacity-0.5.png')
await comfyPage.setSetting('Comfy.Node.Opacity', 1.0) await comfyPage.setSetting('Comfy.Node.Opacity', 1.0)
await comfyPage.page.waitForTimeout(128)
await comfyPage.page.mouse.move(8, 8) await comfyPage.page.mouse.move(8, 8)
await expect(comfyPage.canvas).toHaveScreenshot('node-opacity-1.png') await expect(comfyPage.canvas).toHaveScreenshot('node-opacity-1.png')
@@ -235,7 +233,6 @@ test.describe('Node Color Adjustments', () => {
await comfyPage.setSetting('Comfy.Node.Opacity', 0.5) await comfyPage.setSetting('Comfy.Node.Opacity', 0.5)
await comfyPage.setSetting('Comfy.ColorPalette', 'light') await comfyPage.setSetting('Comfy.ColorPalette', 'light')
const saveWorkflowInterval = 1000 const saveWorkflowInterval = 1000
await comfyPage.page.waitForTimeout(saveWorkflowInterval)
const workflow = await comfyPage.page.evaluate(() => { const workflow = await comfyPage.page.evaluate(() => {
return localStorage.getItem('workflow') return localStorage.getItem('workflow')
}) })

View File

@@ -43,7 +43,6 @@ test('Does not report warning on undo/redo', async ({ comfyPage }) => {
// Wait for any async operations to complete after dialog closes // Wait for any async operations to complete after dialog closes
await comfyPage.nextFrame() await comfyPage.nextFrame()
await comfyPage.page.waitForTimeout(100)
// Make a change to the graph // Make a change to the graph
await comfyPage.doubleClickCanvas() await comfyPage.doubleClickCanvas()

View File

@@ -36,10 +36,6 @@ test.describe('Execute to selected output nodes', () => {
await output1.click('title') await output1.click('title')
await comfyPage.executeCommand('Comfy.QueueSelectedOutputNodes') await comfyPage.executeCommand('Comfy.QueueSelectedOutputNodes')
// @note: Wait for the execution to finish. We might want to move to a more
// reliable way to wait for the execution to finish. Workflow in this test
// is simple enough that this is fine for now.
await comfyPage.page.waitForTimeout(200)
expect(await (await input.getWidget(0)).getValue()).toBe('foo') expect(await (await input.getWidget(0)).getValue()).toBe('foo')
expect(await (await output1.getWidget(0)).getValue()).toBe('foo') expect(await (await output1.getWidget(0)).getValue()).toBe('foo')

View File

@@ -94,9 +94,6 @@ test.describe('Feature Flags', () => {
test('Server feature flags are received and accessible', async ({ test('Server feature flags are received and accessible', async ({
comfyPage comfyPage
}) => { }) => {
// Wait for connection to establish
await comfyPage.page.waitForTimeout(1000)
// Get the actual server feature flags from the backend // Get the actual server feature flags from the backend
const serverFlags = await comfyPage.page.evaluate(() => { const serverFlags = await comfyPage.page.evaluate(() => {
return window['app'].api.serverFeatureFlags return window['app'].api.serverFeatureFlags
@@ -116,9 +113,6 @@ test.describe('Feature Flags', () => {
test('serverSupportsFeature method works with real backend flags', async ({ test('serverSupportsFeature method works with real backend flags', async ({
comfyPage comfyPage
}) => { }) => {
// Wait for connection
await comfyPage.page.waitForTimeout(1000)
// Test serverSupportsFeature with real backend flags // Test serverSupportsFeature with real backend flags
const supportsPreviewMetadata = await comfyPage.page.evaluate(() => { const supportsPreviewMetadata = await comfyPage.page.evaluate(() => {
return window['app'].api.serverSupportsFeature( return window['app'].api.serverSupportsFeature(
@@ -170,9 +164,6 @@ test.describe('Feature Flags', () => {
test('getServerFeature method works with real backend data', async ({ test('getServerFeature method works with real backend data', async ({
comfyPage comfyPage
}) => { }) => {
// Wait for connection
await comfyPage.page.waitForTimeout(1000)
// Test getServerFeature method // Test getServerFeature method
const previewMetadataValue = await comfyPage.page.evaluate(() => { const previewMetadataValue = await comfyPage.page.evaluate(() => {
return window['app'].api.getServerFeature('supports_preview_metadata') return window['app'].api.getServerFeature('supports_preview_metadata')
@@ -199,9 +190,6 @@ test.describe('Feature Flags', () => {
test('getServerFeatures returns all backend feature flags', async ({ test('getServerFeatures returns all backend feature flags', async ({
comfyPage comfyPage
}) => { }) => {
// Wait for connection
await comfyPage.page.waitForTimeout(1000)
// Test getServerFeatures returns all flags // Test getServerFeatures returns all flags
const allFeatures = await comfyPage.page.evaluate(() => { const allFeatures = await comfyPage.page.evaluate(() => {
return window['app'].api.getServerFeatures() return window['app'].api.getServerFeatures()
@@ -248,9 +236,6 @@ test.describe('Feature Flags', () => {
test('Server features are immutable when accessed via getServerFeatures', async ({ test('Server features are immutable when accessed via getServerFeatures', async ({
comfyPage comfyPage
}) => { }) => {
// Wait for connection to establish
await comfyPage.page.waitForTimeout(1000)
const immutabilityTest = await comfyPage.page.evaluate(() => { const immutabilityTest = await comfyPage.page.evaluate(() => {
// Get a copy of server features // Get a copy of server features
const features1 = window['app'].api.getServerFeatures() const features1 = window['app'].api.getServerFeatures()

View File

@@ -104,8 +104,6 @@ test.describe('Group Node', () => {
await comfyPage.setSetting('Comfy.EnableTooltips', true) await comfyPage.setSetting('Comfy.EnableTooltips', true)
await comfyPage.convertAllNodesToGroupNode('Group Node') await comfyPage.convertAllNodesToGroupNode('Group Node')
await comfyPage.page.mouse.move(47, 173) await comfyPage.page.mouse.move(47, 173)
const tooltipTimeout = 500
await comfyPage.page.waitForTimeout(tooltipTimeout + 16)
await expect(comfyPage.page.locator('.node-tooltip')).toBeVisible() await expect(comfyPage.page.locator('.node-tooltip')).toBeVisible()
}) })
@@ -320,14 +318,12 @@ test.describe('Group Node', () => {
test('Convert to group node, no selection', async ({ comfyPage }) => { test('Convert to group node, no selection', async ({ comfyPage }) => {
expect(await comfyPage.getVisibleToastCount()).toBe(0) expect(await comfyPage.getVisibleToastCount()).toBe(0)
await comfyPage.page.keyboard.press('Alt+g') await comfyPage.page.keyboard.press('Alt+g')
await comfyPage.page.waitForTimeout(300)
expect(await comfyPage.getVisibleToastCount()).toBe(1) expect(await comfyPage.getVisibleToastCount()).toBe(1)
}) })
test('Convert to group node, selected 1 node', async ({ comfyPage }) => { test('Convert to group node, selected 1 node', async ({ comfyPage }) => {
expect(await comfyPage.getVisibleToastCount()).toBe(0) expect(await comfyPage.getVisibleToastCount()).toBe(0)
await comfyPage.clickTextEncodeNode1() await comfyPage.clickTextEncodeNode1()
await comfyPage.page.keyboard.press('Alt+g') await comfyPage.page.keyboard.press('Alt+g')
await comfyPage.page.waitForTimeout(300)
expect(await comfyPage.getVisibleToastCount()).toBe(1) expect(await comfyPage.getVisibleToastCount()).toBe(1)
}) })
}) })

View File

@@ -307,8 +307,6 @@ test.describe('Node Interaction', () => {
position: numberWidgetPos position: numberWidgetPos
}) })
await expect(comfyPage.canvas).toHaveScreenshot('prompt-dialog-opened.png') await expect(comfyPage.canvas).toHaveScreenshot('prompt-dialog-opened.png')
// Wait for 1s so that it does not trigger the search box by double click.
await comfyPage.page.waitForTimeout(1000)
await comfyPage.canvas.click({ await comfyPage.canvas.click({
position: { position: {
x: 10, x: 10,
@@ -332,7 +330,6 @@ test.describe('Node Interaction', () => {
await expect(comfyPage.canvas).toHaveScreenshot( await expect(comfyPage.canvas).toHaveScreenshot(
'prompt-dialog-opened-text.png' 'prompt-dialog-opened-text.png'
) )
await comfyPage.page.waitForTimeout(1000)
await comfyPage.canvas.click({ await comfyPage.canvas.click({
position: { position: {
x: 10, x: 10,
@@ -663,9 +660,6 @@ test.describe('Load workflow', () => {
await comfyPage.loadWorkflow('nodes/single_ksampler') await comfyPage.loadWorkflow('nodes/single_ksampler')
const node = (await comfyPage.getFirstNodeRef())! const node = (await comfyPage.getFirstNodeRef())!
await node.click('collapse') await node.click('collapse')
// Wait 300ms between 2 clicks so that it is not treated as a double click
// by litegraph.
await comfyPage.page.waitForTimeout(300)
await comfyPage.clickEmptySpace() await comfyPage.clickEmptySpace()
await expect(comfyPage.canvas).toHaveScreenshot( await expect(comfyPage.canvas).toHaveScreenshot(
'single_ksampler_modified.png' 'single_ksampler_modified.png'

View File

@@ -104,9 +104,6 @@ test.describe('Node search box', () => {
await comfyPage.searchBox.input.waitFor({ state: 'visible' }) await comfyPage.searchBox.input.waitFor({ state: 'visible' })
await comfyPage.searchBox.input.fill(node) await comfyPage.searchBox.input.fill(node)
await comfyPage.searchBox.dropdown.waitFor({ state: 'visible' }) await comfyPage.searchBox.dropdown.waitFor({ state: 'visible' })
// Wait for some time for the auto complete list to update.
// The auto complete list is debounced and may take some time to update.
await comfyPage.page.waitForTimeout(500)
const firstResult = comfyPage.searchBox.dropdown.locator('li').first() const firstResult = comfyPage.searchBox.dropdown.locator('li').first()
await expect(firstResult).toHaveAttribute('aria-label', node) await expect(firstResult).toHaveAttribute('aria-label', node)
@@ -125,7 +122,6 @@ test.describe('Node search box', () => {
await comfyPage.canvas.tap({ await comfyPage.canvas.tap({
position: screenCenter position: screenCenter
}) })
await comfyPage.page.waitForTimeout(256)
await expect(comfyPage.searchBox.input).not.toHaveCount(0) await expect(comfyPage.searchBox.input).not.toHaveCount(0)
}) })

View File

@@ -212,9 +212,6 @@ test.describe('Release Notifications', () => {
await comfyPage.setup({ mockReleases: false }) await comfyPage.setup({ mockReleases: false })
// Wait a bit to ensure any potential API calls would have been made
await comfyPage.page.waitForTimeout(1000)
// Verify no API calls were made // Verify no API calls were made
expect(apiCallCount).toBe(0) expect(apiCallCount).toBe(0)
}) })

View File

@@ -49,8 +49,6 @@ test.describe('Remote COMBO Widget', () => {
const waitForWidgetUpdate = async (comfyPage: ComfyPage) => { const waitForWidgetUpdate = async (comfyPage: ComfyPage) => {
// Force re-render to trigger first access of widget's options // Force re-render to trigger first access of widget's options
await comfyPage.page.mouse.click(400, 300) await comfyPage.page.mouse.click(400, 300)
// Wait for the widget to actually update instead of fixed timeout
await comfyPage.page.waitForTimeout(300)
} }
test.beforeEach(async ({ comfyPage }) => { test.beforeEach(async ({ comfyPage }) => {
@@ -92,7 +90,6 @@ test.describe('Remote COMBO Widget', () => {
}) => { }) => {
const nodeName = 'Remote Widget Node' const nodeName = 'Remote Widget Node'
await comfyPage.loadWorkflow('inputs/remote_widget') await comfyPage.loadWorkflow('inputs/remote_widget')
await comfyPage.page.waitForTimeout(512)
const node = await comfyPage.page.evaluate((name) => { const node = await comfyPage.page.evaluate((name) => {
return window['app'].graph.nodes.find((node) => node.title === name) return window['app'].graph.nodes.find((node) => node.title === name)
@@ -160,8 +157,6 @@ test.describe('Remote COMBO Widget', () => {
} }
}) })
// Wait a reasonable time to ensure no request is made
await comfyPage.page.waitForTimeout(512)
expect(requestWasMade).toBe(false) expect(requestWasMade).toBe(false)
}) })
@@ -214,16 +209,9 @@ test.describe('Remote COMBO Widget', () => {
await waitForWidgetUpdate(comfyPage) await waitForWidgetUpdate(comfyPage)
const initialOptions = await getWidgetOptions(comfyPage, nodeName) const initialOptions = await getWidgetOptions(comfyPage, nodeName)
// Wait for the refresh (TTL) to expire with extra buffer for processing
// TTL is 300ms, wait 600ms to ensure it has expired
await comfyPage.page.waitForTimeout(600)
// Click on the canvas to trigger widget refresh // Click on the canvas to trigger widget refresh
await comfyPage.page.mouse.click(400, 300) await comfyPage.page.mouse.click(400, 300)
// Wait a bit for the refresh to complete
await comfyPage.page.waitForTimeout(100)
const refreshedOptions = await getWidgetOptions(comfyPage, nodeName) const refreshedOptions = await getWidgetOptions(comfyPage, nodeName)
expect(refreshedOptions).not.toEqual(initialOptions) expect(refreshedOptions).not.toEqual(initialOptions)
}) })
@@ -331,7 +319,6 @@ test.describe('Remote COMBO Widget', () => {
// Click refresh button // Click refresh button
await clickRefreshButton(comfyPage, nodeName) await clickRefreshButton(comfyPage, nodeName)
await comfyPage.page.waitForTimeout(200)
// Verify the selected value of the widget is the first option in the refreshed list // Verify the selected value of the widget is the first option in the refreshed list
const refreshedValue = await getWidgetValue(comfyPage, nodeName) const refreshedValue = await getWidgetValue(comfyPage, nodeName)

View File

@@ -118,7 +118,6 @@ test.describe('Node Right Click Menu', () => {
await comfyPage.rightClickEmptyLatentNode() await comfyPage.rightClickEmptyLatentNode()
await comfyPage.page.click('.litemenu-entry:has-text("Unpin")') await comfyPage.page.click('.litemenu-entry:has-text("Unpin")')
await comfyPage.nextFrame() await comfyPage.nextFrame()
await comfyPage.page.waitForTimeout(256)
await comfyPage.dragAndDrop({ x: 496, y: 618 }, { x: 200, y: 590 }) await comfyPage.dragAndDrop({ x: 496, y: 618 }, { x: 200, y: 590 })
await expect(comfyPage.canvas).toHaveScreenshot( await expect(comfyPage.canvas).toHaveScreenshot(
'right-click-unpinned-node-moved.png' 'right-click-unpinned-node-moved.png'

View File

@@ -34,7 +34,6 @@ test.describe('Selection Toolbox - More Options Submenus', () => {
await ksamplerNodes[0].click('title') await ksamplerNodes[0].click('title')
await comfyPage.nextFrame() await comfyPage.nextFrame()
await comfyPage.page.waitForTimeout(500)
await expect(comfyPage.page.locator('.selection-toolbox')).toBeVisible({ await expect(comfyPage.page.locator('.selection-toolbox')).toBeVisible({
timeout: 5000 timeout: 5000
@@ -59,7 +58,6 @@ test.describe('Selection Toolbox - More Options Submenus', () => {
await moreOptionsBtn.click({ force: true }) await moreOptionsBtn.click({ force: true })
await comfyPage.nextFrame() await comfyPage.nextFrame()
await comfyPage.page.waitForTimeout(2000)
const menuOptionsVisibleAfterClick = await comfyPage.page const menuOptionsVisibleAfterClick = await comfyPage.page
.getByText('Rename') .getByText('Rename')
@@ -172,7 +170,6 @@ test.describe('Selection Toolbox - More Options Submenus', () => {
} }
}) })
await comfyPage.nextFrame() await comfyPage.nextFrame()
await comfyPage.page.waitForTimeout(500)
await expect( await expect(
comfyPage.page.getByText('Rename', { exact: true }) comfyPage.page.getByText('Rename', { exact: true })

View File

@@ -104,10 +104,8 @@ test.describe('Workflows sidebar', () => {
await tab.open() await tab.open()
// Switch to the parent folder // Switch to the parent folder
await tab.getPersistedItem('foo').click() await tab.getPersistedItem('foo').click()
await comfyPage.page.waitForTimeout(300)
// Switch to the nested workflow // Switch to the nested workflow
await tab.getPersistedItem('bar').click() await tab.getPersistedItem('bar').click()
await comfyPage.page.waitForTimeout(300)
const openedWorkflow = tab.getOpenedItem('foo/bar') const openedWorkflow = tab.getOpenedItem('foo/bar')
await tab.renameWorkflow(openedWorkflow, 'foo/baz') await tab.renameWorkflow(openedWorkflow, 'foo/baz')
@@ -193,7 +191,6 @@ test.describe('Workflows sidebar', () => {
await comfyPage.menu.topbar.saveWorkflowAs('workflow5.json') await comfyPage.menu.topbar.saveWorkflowAs('workflow5.json')
await comfyPage.confirmDialog.click('overwrite') await comfyPage.confirmDialog.click('overwrite')
await comfyPage.page.waitForTimeout(200)
expect(await comfyPage.menu.workflowsTab.getOpenedWorkflowNames()).toEqual([ expect(await comfyPage.menu.workflowsTab.getOpenedWorkflowNames()).toEqual([
'workflow5.json' 'workflow5.json'
]) ])
@@ -228,7 +225,6 @@ test.describe('Workflows sidebar', () => {
await topbar.saveWorkflowAs('workflow1.json') await topbar.saveWorkflowAs('workflow1.json')
await comfyPage.confirmDialog.click('overwrite') await comfyPage.confirmDialog.click('overwrite')
await comfyPage.page.waitForTimeout(200)
// The old workflow1.json should be deleted and the new one should be saved. // The old workflow1.json should be deleted and the new one should be saved.
expect(await comfyPage.menu.workflowsTab.getOpenedWorkflowNames()).toEqual([ expect(await comfyPage.menu.workflowsTab.getOpenedWorkflowNames()).toEqual([
'workflow2.json', 'workflow2.json',
@@ -362,8 +358,6 @@ test.describe('Workflows sidebar', () => {
'#graph-canvas', '#graph-canvas',
{ targetPosition } { targetPosition }
) )
// Wait for the workflow to be inserted
await comfyPage.page.waitForTimeout(200)
expect(await comfyPage.getGraphNodesCount()).toBe(nodeCount * 2) expect(await comfyPage.getGraphNodesCount()).toBe(nodeCount * 2)
}) })
}) })

View File

@@ -308,8 +308,6 @@ test.describe('Subgraph Operations', () => {
} }
}) })
// Wait for dialog to appear
await comfyPage.page.waitForTimeout(200)
await comfyPage.nextFrame() await comfyPage.nextFrame()
await comfyPage.page.waitForSelector(SELECTORS.promptDialog, { await comfyPage.page.waitForSelector(SELECTORS.promptDialog, {
@@ -656,7 +654,6 @@ test.describe('Subgraph Operations', () => {
await comfyPage.rightClickSubgraphInputSlot('text') await comfyPage.rightClickSubgraphInputSlot('text')
await comfyPage.clickLitegraphContextMenuItem('Remove Slot') await comfyPage.clickLitegraphContextMenuItem('Remove Slot')
await comfyPage.page.waitForTimeout(200)
// Wait for breadcrumb to be visible // Wait for breadcrumb to be visible
await comfyPage.page.waitForSelector(SELECTORS.breadcrumb, { await comfyPage.page.waitForSelector(SELECTORS.breadcrumb, {
@@ -673,7 +670,6 @@ test.describe('Subgraph Operations', () => {
await homeBreadcrumb.waitFor({ state: 'visible' }) await homeBreadcrumb.waitFor({ state: 'visible' })
await homeBreadcrumb.click() await homeBreadcrumb.click()
await comfyPage.nextFrame() await comfyPage.nextFrame()
await comfyPage.page.waitForTimeout(300)
// Check that the subgraph node has no widgets after removing the text slot // Check that the subgraph node has no widgets after removing the text slot
const widgetCount = await comfyPage.page.evaluate(() => { const widgetCount = await comfyPage.page.evaluate(() => {

View File

@@ -150,7 +150,6 @@ test.describe('Settings Search functionality', () => {
// Type in search box // Type in search box
await searchBox.fill('graph') await searchBox.fill('graph')
await comfyPage.page.waitForTimeout(200) // Wait for debounce
// Verify that the search input is handled // Verify that the search input is handled
await expect(searchBox).toHaveValue('graph') await expect(searchBox).toHaveValue('graph')
@@ -182,9 +181,6 @@ test.describe('Settings Search functionality', () => {
await searchBox.fill('abc') await searchBox.fill('abc')
await searchBox.fill('abcd') await searchBox.fill('abcd')
// Wait for debounce
await comfyPage.page.waitForTimeout(200)
// Verify final value // Verify final value
await expect(searchBox).toHaveValue('abcd') await expect(searchBox).toHaveValue('abcd')
}) })
@@ -200,7 +196,6 @@ test.describe('Settings Search functionality', () => {
// Search for our test settings // Search for our test settings
const searchBox = comfyPage.page.locator('.settings-search-box input') const searchBox = comfyPage.page.locator('.settings-search-box input')
await searchBox.fill('Test') await searchBox.fill('Test')
await comfyPage.page.waitForTimeout(300) // Wait for debounce
// Get all settings content // Get all settings content
const settingsContent = comfyPage.page.locator('.settings-tab-panels') const settingsContent = comfyPage.page.locator('.settings-tab-panels')
@@ -221,7 +216,6 @@ test.describe('Settings Search functionality', () => {
// Search for our test settings // Search for our test settings
const searchBox = comfyPage.page.locator('.settings-search-box input') const searchBox = comfyPage.page.locator('.settings-search-box input')
await searchBox.fill('Test') await searchBox.fill('Test')
await comfyPage.page.waitForTimeout(300) // Wait for debounce
// Get all settings content // Get all settings content
const settingsContent = comfyPage.page.locator('.settings-tab-panels') const settingsContent = comfyPage.page.locator('.settings-tab-panels')
@@ -242,7 +236,6 @@ test.describe('Settings Search functionality', () => {
// Search for our test settings // Search for our test settings
const searchBox = comfyPage.page.locator('.settings-search-box input') const searchBox = comfyPage.page.locator('.settings-search-box input')
await searchBox.fill('Test') await searchBox.fill('Test')
await comfyPage.page.waitForTimeout(300) // Wait for debounce
// Get all settings content // Get all settings content
const settingsContent = comfyPage.page.locator('.settings-tab-panels') const settingsContent = comfyPage.page.locator('.settings-tab-panels')
@@ -269,7 +262,6 @@ test.describe('Settings Search functionality', () => {
// Search specifically for hidden setting by name // Search specifically for hidden setting by name
await searchBox.clear() await searchBox.clear()
await searchBox.fill('Hidden') await searchBox.fill('Hidden')
await comfyPage.page.waitForTimeout(300)
// Should not show the hidden setting even when searching by name // Should not show the hidden setting even when searching by name
await expect(settingsContent).not.toContainText('Test Hidden Setting') await expect(settingsContent).not.toContainText('Test Hidden Setting')
@@ -277,7 +269,6 @@ test.describe('Settings Search functionality', () => {
// Search specifically for deprecated setting by name // Search specifically for deprecated setting by name
await searchBox.clear() await searchBox.clear()
await searchBox.fill('Deprecated') await searchBox.fill('Deprecated')
await comfyPage.page.waitForTimeout(300)
// Should not show the deprecated setting even when searching by name // Should not show the deprecated setting even when searching by name
await expect(settingsContent).not.toContainText('Test Deprecated Setting') await expect(settingsContent).not.toContainText('Test Deprecated Setting')
@@ -285,7 +276,6 @@ test.describe('Settings Search functionality', () => {
// Search for visible setting by name - should work // Search for visible setting by name - should work
await searchBox.clear() await searchBox.clear()
await searchBox.fill('Visible') await searchBox.fill('Visible')
await comfyPage.page.waitForTimeout(300)
// Should show the visible setting // Should show the visible setting
await expect(settingsContent).toContainText('Test Visible Setting') await expect(settingsContent).toContainText('Test Visible Setting')

View File

@@ -19,7 +19,6 @@ test.describe('Vue Node Resizing', () => {
// Select the node first (this was causing the bug) // Select the node first (this was causing the bug)
await node.header.click() await node.header.click()
await comfyPage.page.waitForTimeout(100) // Brief pause after selection
// Get position after selection // Get position after selection
const selectedBox = await node.boundingBox() const selectedBox = await node.boundingBox()

View File

@@ -95,7 +95,6 @@ test.describe('Boolean widget', () => {
test.describe('Slider widget', () => { test.describe('Slider widget', () => {
test('Can drag adjust value', async ({ comfyPage }) => { test('Can drag adjust value', async ({ comfyPage }) => {
await comfyPage.loadWorkflow('inputs/simple_slider') await comfyPage.loadWorkflow('inputs/simple_slider')
await comfyPage.page.waitForTimeout(300)
const node = (await comfyPage.getFirstNodeRef())! const node = (await comfyPage.getFirstNodeRef())!
const widget = await node.getWidget(0) const widget = await node.getWidget(0)
@@ -117,7 +116,6 @@ test.describe('Slider widget', () => {
test.describe('Number widget', () => { test.describe('Number widget', () => {
test('Can drag adjust value', async ({ comfyPage }) => { test('Can drag adjust value', async ({ comfyPage }) => {
await comfyPage.loadWorkflow('widgets/seed_widget') await comfyPage.loadWorkflow('widgets/seed_widget')
await comfyPage.page.waitForTimeout(300)
const node = (await comfyPage.getFirstNodeRef())! const node = (await comfyPage.getFirstNodeRef())!
const widget = await node.getWidget(0) const widget = await node.getWidget(0)
@@ -141,7 +139,6 @@ test.describe('Dynamic widget manipulation', () => {
comfyPage comfyPage
}) => { }) => {
await comfyPage.loadWorkflow('nodes/single_ksampler') await comfyPage.loadWorkflow('nodes/single_ksampler')
await comfyPage.page.waitForTimeout(300)
await comfyPage.page.evaluate(() => { await comfyPage.page.evaluate(() => {
window['graph'].nodes[0].addWidget('number', 'new_widget', 10) window['graph'].nodes[0].addWidget('number', 'new_widget', 10)
@@ -234,9 +231,6 @@ test.describe('Animated image widget', () => {
'animated_image_preview_drag_and_dropped.png' 'animated_image_preview_drag_and_dropped.png'
) )
// Wait for animation to go to next frame
await comfyPage.page.waitForTimeout(512)
// Move mouse and click on canvas to trigger render // Move mouse and click on canvas to trigger render
await comfyPage.page.mouse.click(64, 64) await comfyPage.page.mouse.click(64, 64)
@@ -260,7 +254,6 @@ test.describe('Animated image widget', () => {
await comfyPage.dragAndDropFile('animated_webp.webp', { await comfyPage.dragAndDropFile('animated_webp.webp', {
dropPosition: { x, y } dropPosition: { x, y }
}) })
await comfyPage.page.waitForTimeout(200)
// Expect the filename combo value to be updated // Expect the filename combo value to be updated
const fileComboWidget = await loadAnimatedWebpNode.getWidget(0) const fileComboWidget = await loadAnimatedWebpNode.getWidget(0)
@@ -306,9 +299,6 @@ test.describe('Animated image widget', () => {
) )
await comfyPage.nextFrame() await comfyPage.nextFrame()
// Wait for animation to go to next frame
await comfyPage.page.waitForTimeout(512)
// Move mouse and click on canvas to trigger render // Move mouse and click on canvas to trigger render
await comfyPage.page.mouse.click(64, 64) await comfyPage.page.mouse.click(64, 64)