mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-27 03:19:56 +00:00
37 lines
1.2 KiB
TypeScript
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')
|
|
})
|
|
})
|