mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-07 14:09:59 +00:00
- Remove 27 deprecated/wrapper methods from ComfyPage - Migrate callers to use helper classes directly: - keyboard.selectAll/bypass/undo/redo/moveUp/moveDown - clipboard.copy/paste - settings.setSetting/getSetting - workflow.loadWorkflow/deleteWorkflow/setupWorkflowsDirectory - contextMenu.clickMenuItem/clickLitegraphMenuItem - nodeOps.resizeNode with DefaultGraphPositions - canvasOps.clickEmptySpace with DefaultGraphPositions - Replace deprecated node click methods with direct canvas clicks - Replace position getter properties with DefaultGraphPositions imports Amp-Thread-ID: https://ampcode.com/threads/T-019c15e7-2319-76ec-855e-098ec75ef18a Co-authored-by: Amp <amp@ampcode.com>
56 lines
2.0 KiB
TypeScript
56 lines
2.0 KiB
TypeScript
import {
|
|
comfyExpect as expect,
|
|
comfyPageFixture as test
|
|
} from '../../../fixtures/ComfyPage'
|
|
|
|
const BYPASS_HOTKEY = 'Control+b'
|
|
const BYPASS_CLASS = /before:bg-bypass\/60/
|
|
|
|
test.describe('Vue Node Bypass', () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.settings.setSetting('Comfy.VueNodes.Enabled', true)
|
|
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Top')
|
|
await comfyPage.settings.setSetting('Comfy.Minimap.Visible', false)
|
|
await comfyPage.settings.setSetting('Comfy.Graph.CanvasMenu', true)
|
|
await comfyPage.vueNodes.waitForNodes()
|
|
})
|
|
|
|
test(
|
|
'should allow toggling bypass on a selected node with hotkey',
|
|
{ tag: '@screenshot' },
|
|
async ({ comfyPage }) => {
|
|
await comfyPage.page.getByText('Load Checkpoint').click()
|
|
await comfyPage.page.keyboard.press(BYPASS_HOTKEY)
|
|
|
|
const checkpointNode =
|
|
comfyPage.vueNodes.getNodeByTitle('Load Checkpoint')
|
|
await expect(checkpointNode).toHaveClass(BYPASS_CLASS)
|
|
await comfyPage.nextFrame()
|
|
await expect(comfyPage.canvas).toHaveScreenshot(
|
|
'vue-node-bypassed-state.png'
|
|
)
|
|
|
|
await comfyPage.page.keyboard.press(BYPASS_HOTKEY)
|
|
await expect(checkpointNode).not.toHaveClass(BYPASS_CLASS)
|
|
}
|
|
)
|
|
|
|
test('should allow toggling bypass on multiple selected nodes with hotkey', async ({
|
|
comfyPage
|
|
}) => {
|
|
await comfyPage.page.getByText('Load Checkpoint').click()
|
|
await comfyPage.page.getByText('KSampler').click({ modifiers: ['Control'] })
|
|
|
|
const checkpointNode = comfyPage.vueNodes.getNodeByTitle('Load Checkpoint')
|
|
const ksamplerNode = comfyPage.vueNodes.getNodeByTitle('KSampler')
|
|
|
|
await comfyPage.page.keyboard.press(BYPASS_HOTKEY)
|
|
await expect(checkpointNode).toHaveClass(BYPASS_CLASS)
|
|
await expect(ksamplerNode).toHaveClass(BYPASS_CLASS)
|
|
|
|
await comfyPage.page.keyboard.press(BYPASS_HOTKEY)
|
|
await expect(checkpointNode).not.toHaveClass(BYPASS_CLASS)
|
|
await expect(ksamplerNode).not.toHaveClass(BYPASS_CLASS)
|
|
})
|
|
})
|