mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-26 17:30:07 +00:00
refactor: wire helpers into ComfyPage and update test usages
Phase 2 of ComfyPage refactor: - Add ToastHelper, DragDropHelper, CommandHelper instances to ComfyPage - Remove migrated methods from ComfyPage (command, toast, dragDrop, workflow, canvasOps, nodeOps methods) - Update all test files to use new helper paths - Keep visibleToasts as passthrough getter for backward compatibility Amp-Thread-ID: https://ampcode.com/threads/T-019c1666-ed27-773c-976a-07cc805d7a6c Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -26,7 +26,7 @@ test.describe('Vue Node Groups', { tag: '@screenshot' }, () => {
|
||||
await comfyPage.setup()
|
||||
await comfyPage.workflow.loadWorkflow('groups/oversized_group')
|
||||
await comfyPage.keyboard.selectAll()
|
||||
await comfyPage.executeCommand('Comfy.Graph.FitGroupToContents')
|
||||
await comfyPage.command.executeCommand('Comfy.Graph.FitGroupToContents')
|
||||
await comfyPage.nextFrame()
|
||||
await expect(comfyPage.canvas).toHaveScreenshot(
|
||||
'vue-groups-fit-to-contents.png'
|
||||
@@ -39,15 +39,17 @@ test.describe('Vue Node Groups', { tag: '@screenshot' }, () => {
|
||||
await comfyPage.workflow.loadWorkflow('groups/nested-groups-1-inner-node')
|
||||
|
||||
// Get initial positions with null guards
|
||||
const outerInitial = await comfyPage.getGroupPosition('Outer Group')
|
||||
const innerInitial = await comfyPage.getGroupPosition('Inner Group')
|
||||
const outerInitial =
|
||||
await comfyPage.canvasOps.getGroupPosition('Outer Group')
|
||||
const innerInitial =
|
||||
await comfyPage.canvasOps.getGroupPosition('Inner Group')
|
||||
|
||||
const initialOffsetX = innerInitial.x - outerInitial.x
|
||||
const initialOffsetY = innerInitial.y - outerInitial.y
|
||||
|
||||
// Drag the outer group
|
||||
const dragDelta = { x: 100, y: 80 }
|
||||
await comfyPage.dragGroup({
|
||||
await comfyPage.canvasOps.dragGroup({
|
||||
name: 'Outer Group',
|
||||
deltaX: dragDelta.x,
|
||||
deltaY: dragDelta.y
|
||||
@@ -55,8 +57,10 @@ test.describe('Vue Node Groups', { tag: '@screenshot' }, () => {
|
||||
|
||||
// Use retrying assertion to wait for positions to update
|
||||
await expect(async () => {
|
||||
const outerFinal = await comfyPage.getGroupPosition('Outer Group')
|
||||
const innerFinal = await comfyPage.getGroupPosition('Inner Group')
|
||||
const outerFinal =
|
||||
await comfyPage.canvasOps.getGroupPosition('Outer Group')
|
||||
const innerFinal =
|
||||
await comfyPage.canvasOps.getGroupPosition('Inner Group')
|
||||
|
||||
const finalOffsetX = innerFinal.x - outerFinal.x
|
||||
const finalOffsetY = innerFinal.y - outerFinal.y
|
||||
|
||||
Reference in New Issue
Block a user