Files
ComfyUI_frontend/browser_tests/rerouteNode.spec.ts
2024-12-22 19:51:32 -05:00

37 lines
1.2 KiB
TypeScript

import { expect } from '@playwright/test'
import { comfyPageFixture as test } from './fixtures/ComfyPage'
test.describe('Reroute Node', () => {
test.beforeEach(async ({ comfyPage }) => {
await comfyPage.setSetting('Comfy.UseNewMenu', 'Top')
})
test.afterEach(async ({ comfyPage }) => {
await comfyPage.setupWorkflowsDirectory({})
})
test('loads from inserted workflow', async ({ comfyPage }) => {
const workflowName = 'single_connected_reroute_node.json'
await comfyPage.setupWorkflowsDirectory({
[workflowName]: workflowName
})
await comfyPage.setup()
await comfyPage.menu.topbar.triggerTopbarCommand(['Workflow', 'New'])
// Insert the workflow
const workflowsTab = comfyPage.menu.workflowsTab
await workflowsTab.open()
await workflowsTab.getPersistedItem(workflowName).click({ button: 'right' })
const insertButton = comfyPage.page.locator('.p-contextmenu-item-link', {
hasText: 'Insert'
})
await insertButton.click()
// Close the sidebar tab
await workflowsTab.tabButton.click()
await workflowsTab.root.waitFor({ state: 'hidden' })
await expect(comfyPage.canvas).toHaveScreenshot('reroute_inserted.png')
})
})