mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-09 17:40:09 +00:00
## Summary Refactored Vue node browser tests by organizing them into behavioral categories, better reflecting the nature of browser tests as behind user-action/behavior specifications. - **What**: Reorganized Playwright browser tests into logical behavioral folders (`interactions/`, `nodeStates/`) - **Structure**: Created subdirectories for canvas interactions, link interactions, node interactions, and node states ## Review Focus Test file path changes and associated snapshot relocations ensure all browser tests continue to run correctly in the new structure. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5823-refactor-reorganize-Vue-node-browser-tests-into-subfolder-based-on-behaviors-and-states-27b6d73d365081aaa6f9e3a388165258) by [Unito](https://www.unito.io)
34 lines
1.2 KiB
TypeScript
34 lines
1.2 KiB
TypeScript
import {
|
|
comfyExpect as expect,
|
|
comfyPageFixture as test
|
|
} from '../../../../fixtures/ComfyPage'
|
|
|
|
test.describe('Vue Nodes Zoom', () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.setSetting('Comfy.VueNodes.Enabled', true)
|
|
await comfyPage.vueNodes.waitForNodes()
|
|
})
|
|
|
|
test('should not capture drag while zooming with ctrl+shift+drag', async ({
|
|
comfyPage
|
|
}) => {
|
|
const checkpointNode = comfyPage.vueNodes.getNodeByTitle('Load Checkpoint')
|
|
const nodeBoundingBox = await checkpointNode.boundingBox()
|
|
if (!nodeBoundingBox) throw new Error('Node bounding box not available')
|
|
|
|
const nodeMidpointX = nodeBoundingBox.x + nodeBoundingBox.width / 2
|
|
const nodeMidpointY = nodeBoundingBox.y + nodeBoundingBox.height / 2
|
|
|
|
// Start the Ctrl+Shift drag-to-zoom on the canvas and continue dragging over
|
|
// the node. The node should not capture the drag while drag-zooming.
|
|
await comfyPage.page.keyboard.down('Control')
|
|
await comfyPage.page.keyboard.down('Shift')
|
|
await comfyPage.dragAndDrop(
|
|
{ x: 200, y: 300 },
|
|
{ x: nodeMidpointX, y: nodeMidpointY }
|
|
)
|
|
|
|
await expect(comfyPage.canvas).toHaveScreenshot('zoomed-in-ctrl-shift.png')
|
|
})
|
|
})
|