Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions browser_tests/fixtures/ComfyPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1272,9 +1272,6 @@ export class ComfyPage {
}, 'image/png')
})
}, filename)

// Wait a bit for the download to process
await this.page.waitForTimeout(500)
}

/**
Expand Down
3 changes: 0 additions & 3 deletions browser_tests/fixtures/components/ComfyNodeSearchBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ export class ComfyNodeSearchBox {
await this.input.waitFor({ state: 'visible' })
await this.input.fill(nodeName)
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
.locator('li')
.nth(options?.suggestionIndex || 0)
Expand Down
2 changes: 0 additions & 2 deletions browser_tests/fixtures/components/SidebarTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export class WorkflowsSidebarTab extends SidebarTab {
async switchToWorkflow(workflowName: string) {
const workflowLocator = this.getOpenedItem(workflowName)
await workflowLocator.click()
await this.page.waitForTimeout(300)
}

getOpenedItem(name: string) {
Expand All @@ -138,7 +137,6 @@ export class WorkflowsSidebarTab extends SidebarTab {
.click()
await this.page.keyboard.type(newName)
await this.page.keyboard.press('Enter')
await this.page.waitForTimeout(300)
}

async insertWorkflow(locator: Locator) {
Expand Down
1 change: 0 additions & 1 deletion browser_tests/fixtures/components/Topbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export class Topbar {
}

async openTopbarMenu() {
await this.page.waitForTimeout(1000)
await this.menuTrigger.click()
await this.menuLocator.waitFor({ state: 'visible' })
return this.menuLocator
Expand Down
2 changes: 0 additions & 2 deletions browser_tests/fixtures/utils/litegraphUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@ export class NodeReference {
async convertToSubgraph() {
await this.clickContextMenuOption('Convert to Subgraph')
await this.comfyPage.nextFrame()
await this.comfyPage.page.waitForTimeout(256)
const nodes = await this.comfyPage.getNodeRefsByTitle('New Subgraph')
if (nodes.length !== 1) {
throw new Error(
Expand Down Expand Up @@ -511,7 +510,6 @@ export class NodeReference {
// Double-click to enter subgraph
await this.comfyPage.canvas.dblclick({ position, force: true })
await this.comfyPage.nextFrame()
await this.comfyPage.page.waitForTimeout(500)

// Check if we successfully entered the subgraph
isInSubgraph = await this.comfyPage.page.evaluate(() => {
Expand Down
8 changes: 0 additions & 8 deletions browser_tests/tests/backgroundImageUpload.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ test.describe('Background Image Upload', () => {
// Upload the test image
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
const urlInput = backgroundImageSetting.locator('input[type="text"]')
const inputValue = await urlInput.inputValue()
Expand Down Expand Up @@ -191,14 +188,11 @@ test.describe('Background Image Upload', () => {
)
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')
await expect(uploadTooltip).toBeVisible()

// Move away to hide tooltip
await comfyPage.page.locator('body').hover()
await comfyPage.page.waitForTimeout(100)

// Set a background to enable clear button
const urlInput = backgroundImageSetting.locator('input[type="text"]')
Expand All @@ -209,8 +203,6 @@ test.describe('Background Image Upload', () => {
const clearButton = backgroundImageSetting.locator('button:has(.pi-trash)')
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')
await expect(clearTooltip).toBeVisible()
})
Expand Down
3 changes: 0 additions & 3 deletions browser_tests/tests/colorPalette.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,13 @@ test.describe('Node Color Adjustments', () => {
comfyPage
}) => {
await comfyPage.setSetting('Comfy.Node.Opacity', 0.5)
await comfyPage.page.waitForTimeout(128)

// Drag mouse to force canvas to redraw
await comfyPage.page.mouse.move(0, 0)

await expect(comfyPage.canvas).toHaveScreenshot('node-opacity-0.5.png')

await comfyPage.setSetting('Comfy.Node.Opacity', 1.0)
await comfyPage.page.waitForTimeout(128)

await comfyPage.page.mouse.move(8, 8)
await expect(comfyPage.canvas).toHaveScreenshot('node-opacity-1.png')
Expand All @@ -235,7 +233,6 @@ test.describe('Node Color Adjustments', () => {
await comfyPage.setSetting('Comfy.Node.Opacity', 0.5)
await comfyPage.setSetting('Comfy.ColorPalette', 'light')
const saveWorkflowInterval = 1000
await comfyPage.page.waitForTimeout(saveWorkflowInterval)
const workflow = await comfyPage.page.evaluate(() => {
return localStorage.getItem('workflow')
})
Expand Down
1 change: 0 additions & 1 deletion browser_tests/tests/dialog.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ test('Does not report warning on undo/redo', async ({ comfyPage }) => {

// Wait for any async operations to complete after dialog closes
await comfyPage.nextFrame()
await comfyPage.page.waitForTimeout(100)

// Make a change to the graph
await comfyPage.doubleClickCanvas()
Expand Down
4 changes: 0 additions & 4 deletions browser_tests/tests/execution.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ test.describe('Execute to selected output nodes', () => {
await output1.click('title')

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 output1.getWidget(0)).getValue()).toBe('foo')
Expand Down
15 changes: 0 additions & 15 deletions browser_tests/tests/featureFlags.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ test.describe('Feature Flags', () => {
test('Server feature flags are received and accessible', async ({
comfyPage
}) => {
// Wait for connection to establish
await comfyPage.page.waitForTimeout(1000)

// Get the actual server feature flags from the backend
const serverFlags = await comfyPage.page.evaluate(() => {
return window['app'].api.serverFeatureFlags
Expand All @@ -116,9 +113,6 @@ test.describe('Feature Flags', () => {
test('serverSupportsFeature method works with real backend flags', async ({
comfyPage
}) => {
// Wait for connection
await comfyPage.page.waitForTimeout(1000)

// Test serverSupportsFeature with real backend flags
const supportsPreviewMetadata = await comfyPage.page.evaluate(() => {
return window['app'].api.serverSupportsFeature(
Expand Down Expand Up @@ -170,9 +164,6 @@ test.describe('Feature Flags', () => {
test('getServerFeature method works with real backend data', async ({
comfyPage
}) => {
// Wait for connection
await comfyPage.page.waitForTimeout(1000)

// Test getServerFeature method
const previewMetadataValue = await comfyPage.page.evaluate(() => {
return window['app'].api.getServerFeature('supports_preview_metadata')
Expand All @@ -199,9 +190,6 @@ test.describe('Feature Flags', () => {
test('getServerFeatures returns all backend feature flags', async ({
comfyPage
}) => {
// Wait for connection
await comfyPage.page.waitForTimeout(1000)

// Test getServerFeatures returns all flags
const allFeatures = await comfyPage.page.evaluate(() => {
return window['app'].api.getServerFeatures()
Expand Down Expand Up @@ -248,9 +236,6 @@ test.describe('Feature Flags', () => {
test('Server features are immutable when accessed via getServerFeatures', async ({
comfyPage
}) => {
// Wait for connection to establish
await comfyPage.page.waitForTimeout(1000)

const immutabilityTest = await comfyPage.page.evaluate(() => {
// Get a copy of server features
const features1 = window['app'].api.getServerFeatures()
Expand Down
4 changes: 0 additions & 4 deletions browser_tests/tests/groupNode.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ test.describe('Group Node', () => {
await comfyPage.setSetting('Comfy.EnableTooltips', true)
await comfyPage.convertAllNodesToGroupNode('Group Node')
await comfyPage.page.mouse.move(47, 173)
const tooltipTimeout = 500
await comfyPage.page.waitForTimeout(tooltipTimeout + 16)
await expect(comfyPage.page.locator('.node-tooltip')).toBeVisible()
})

Expand Down Expand Up @@ -320,14 +318,12 @@ test.describe('Group Node', () => {
test('Convert to group node, no selection', async ({ comfyPage }) => {
expect(await comfyPage.getVisibleToastCount()).toBe(0)
await comfyPage.page.keyboard.press('Alt+g')
await comfyPage.page.waitForTimeout(300)
expect(await comfyPage.getVisibleToastCount()).toBe(1)
})
test('Convert to group node, selected 1 node', async ({ comfyPage }) => {
expect(await comfyPage.getVisibleToastCount()).toBe(0)
await comfyPage.clickTextEncodeNode1()
await comfyPage.page.keyboard.press('Alt+g')
await comfyPage.page.waitForTimeout(300)
expect(await comfyPage.getVisibleToastCount()).toBe(1)
})
})
Expand Down
6 changes: 0 additions & 6 deletions browser_tests/tests/interaction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,6 @@ test.describe('Node Interaction', () => {
position: numberWidgetPos
})
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({
position: {
x: 10,
Expand All @@ -332,7 +330,6 @@ test.describe('Node Interaction', () => {
await expect(comfyPage.canvas).toHaveScreenshot(
'prompt-dialog-opened-text.png'
)
await comfyPage.page.waitForTimeout(1000)
await comfyPage.canvas.click({
position: {
x: 10,
Expand Down Expand Up @@ -663,9 +660,6 @@ test.describe('Load workflow', () => {
await comfyPage.loadWorkflow('nodes/single_ksampler')
const node = (await comfyPage.getFirstNodeRef())!
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 expect(comfyPage.canvas).toHaveScreenshot(
'single_ksampler_modified.png'
Expand Down
4 changes: 0 additions & 4 deletions browser_tests/tests/nodeSearchBox.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ test.describe('Node search box', () => {
await comfyPage.searchBox.input.waitFor({ state: 'visible' })
await comfyPage.searchBox.input.fill(node)
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()
await expect(firstResult).toHaveAttribute('aria-label', node)
Expand All @@ -125,7 +122,6 @@ test.describe('Node search box', () => {
await comfyPage.canvas.tap({
position: screenCenter
})
await comfyPage.page.waitForTimeout(256)
await expect(comfyPage.searchBox.input).not.toHaveCount(0)
})

Expand Down
3 changes: 0 additions & 3 deletions browser_tests/tests/releaseNotifications.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,6 @@ test.describe('Release Notifications', () => {

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
expect(apiCallCount).toBe(0)
})
Expand Down
13 changes: 0 additions & 13 deletions browser_tests/tests/remoteWidgets.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ test.describe('Remote COMBO Widget', () => {
const waitForWidgetUpdate = async (comfyPage: ComfyPage) => {
// Force re-render to trigger first access of widget's options
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 }) => {
Expand Down Expand Up @@ -92,7 +90,6 @@ test.describe('Remote COMBO Widget', () => {
}) => {
const nodeName = 'Remote Widget Node'
await comfyPage.loadWorkflow('inputs/remote_widget')
await comfyPage.page.waitForTimeout(512)

const node = await comfyPage.page.evaluate((name) => {
return window['app'].graph.nodes.find((node) => node.title === name)
Expand Down Expand Up @@ -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)
})

Expand Down Expand Up @@ -214,16 +209,9 @@ test.describe('Remote COMBO Widget', () => {
await waitForWidgetUpdate(comfyPage)
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
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)
expect(refreshedOptions).not.toEqual(initialOptions)
})
Expand Down Expand Up @@ -331,7 +319,6 @@ test.describe('Remote COMBO Widget', () => {

// Click refresh button
await clickRefreshButton(comfyPage, nodeName)
await comfyPage.page.waitForTimeout(200)

// Verify the selected value of the widget is the first option in the refreshed list
const refreshedValue = await getWidgetValue(comfyPage, nodeName)
Expand Down
1 change: 0 additions & 1 deletion browser_tests/tests/rightClickMenu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ test.describe('Node Right Click Menu', () => {
await comfyPage.rightClickEmptyLatentNode()
await comfyPage.page.click('.litemenu-entry:has-text("Unpin")')
await comfyPage.nextFrame()
await comfyPage.page.waitForTimeout(256)
await comfyPage.dragAndDrop({ x: 496, y: 618 }, { x: 200, y: 590 })
await expect(comfyPage.canvas).toHaveScreenshot(
'right-click-unpinned-node-moved.png'
Expand Down
3 changes: 0 additions & 3 deletions browser_tests/tests/selectionToolboxSubmenus.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ test.describe('Selection Toolbox - More Options Submenus', () => {

await ksamplerNodes[0].click('title')
await comfyPage.nextFrame()
await comfyPage.page.waitForTimeout(500)

await expect(comfyPage.page.locator('.selection-toolbox')).toBeVisible({
timeout: 5000
Expand All @@ -59,7 +58,6 @@ test.describe('Selection Toolbox - More Options Submenus', () => {

await moreOptionsBtn.click({ force: true })
await comfyPage.nextFrame()
await comfyPage.page.waitForTimeout(2000)

const menuOptionsVisibleAfterClick = await comfyPage.page
.getByText('Rename')
Expand Down Expand Up @@ -172,7 +170,6 @@ test.describe('Selection Toolbox - More Options Submenus', () => {
}
})
await comfyPage.nextFrame()
await comfyPage.page.waitForTimeout(500)

await expect(
comfyPage.page.getByText('Rename', { exact: true })
Expand Down
6 changes: 0 additions & 6 deletions browser_tests/tests/sidebar/workflows.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,8 @@ test.describe('Workflows sidebar', () => {
await tab.open()
// Switch to the parent folder
await tab.getPersistedItem('foo').click()
await comfyPage.page.waitForTimeout(300)
// Switch to the nested workflow
await tab.getPersistedItem('bar').click()
await comfyPage.page.waitForTimeout(300)

const openedWorkflow = tab.getOpenedItem('foo/bar')
await tab.renameWorkflow(openedWorkflow, 'foo/baz')
Expand Down Expand Up @@ -193,7 +191,6 @@ test.describe('Workflows sidebar', () => {

await comfyPage.menu.topbar.saveWorkflowAs('workflow5.json')
await comfyPage.confirmDialog.click('overwrite')
await comfyPage.page.waitForTimeout(200)
expect(await comfyPage.menu.workflowsTab.getOpenedWorkflowNames()).toEqual([
'workflow5.json'
])
Expand Down Expand Up @@ -228,7 +225,6 @@ test.describe('Workflows sidebar', () => {

await topbar.saveWorkflowAs('workflow1.json')
await comfyPage.confirmDialog.click('overwrite')
await comfyPage.page.waitForTimeout(200)
// The old workflow1.json should be deleted and the new one should be saved.
expect(await comfyPage.menu.workflowsTab.getOpenedWorkflowNames()).toEqual([
'workflow2.json',
Expand Down Expand Up @@ -362,8 +358,6 @@ test.describe('Workflows sidebar', () => {
'#graph-canvas',
{ targetPosition }
)
// Wait for the workflow to be inserted
await comfyPage.page.waitForTimeout(200)
expect(await comfyPage.getGraphNodesCount()).toBe(nodeCount * 2)
})
})
Loading