Skip to content

Commit 21cc208

Browse files
committed
Merge remote-tracking branch 'origin/main' into bl-more-slots
2 parents 1c11dcc + a2c7db9 commit 21cc208

40 files changed

+458
-553
lines changed

browser_tests/tests/vueNodes/interactions/zoom.spec.ts renamed to browser_tests/tests/vueNodes/interactions/canvas/zoom.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
comfyExpect as expect,
33
comfyPageFixture as test
4-
} from '../../../fixtures/ComfyPage'
4+
} from '../../../../fixtures/ComfyPage'
55

66
test.describe('Vue Nodes Zoom', () => {
77
test.beforeEach(async ({ comfyPage }) => {
File renamed without changes.

browser_tests/tests/vueNodes/linkInteraction.spec.ts renamed to browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import type { Locator, Page } from '@playwright/test'
22

3-
import type { NodeId } from '../../../src/platform/workflow/validation/schemas/workflowSchema'
4-
import { getSlotKey } from '../../../src/renderer/core/layout/slots/slotIdentifier'
3+
import type { NodeId } from '../../../../../src/platform/workflow/validation/schemas/workflowSchema'
4+
import { getSlotKey } from '../../../../../src/renderer/core/layout/slots/slotIdentifier'
55
import {
66
comfyExpect as expect,
77
comfyPageFixture as test
8-
} from '../../fixtures/ComfyPage'
9-
import { getMiddlePoint } from '../../fixtures/utils/litegraphUtils'
10-
import { fitToViewInstant } from '../../helpers/fitToView'
8+
} from '../../../../fixtures/ComfyPage'
9+
import { getMiddlePoint } from '../../../../fixtures/utils/litegraphUtils'
10+
import { fitToViewInstant } from '../../../../helpers/fitToView'
1111

1212
async function getCenter(locator: Locator): Promise<{ x: number; y: number }> {
1313
const box = await locator.boundingBox()
@@ -189,6 +189,13 @@ test.describe('Vue Node Link Interaction', () => {
189189

190190
expect(await samplerOutput.getLinkCount()).toBe(0)
191191
expect(await clipInput.getLinkCount()).toBe(0)
192+
193+
const graphLinkDetails = await getInputLinkDetails(
194+
comfyPage.page,
195+
clipNode.id,
196+
0
197+
)
198+
expect(graphLinkDetails).toBeNull()
192199
})
193200

194201
test('should not create a link when dropping onto a slot on the same node', async ({
@@ -218,7 +225,6 @@ test.describe('Vue Node Link Interaction', () => {
218225
const samplerNode = (await comfyPage.getNodeRefsByType('KSampler'))[0]
219226
const vaeNode = (await comfyPage.getNodeRefsByType('VAEDecode'))[0]
220227
expect(samplerNode && vaeNode).toBeTruthy()
221-
222228
const samplerOutputCenter = await getSlotCenter(
223229
comfyPage.page,
224230
samplerNode.id,
53.7 KB
Loading

browser_tests/tests/vueNodes/deleteKeyInteraction.spec.ts renamed to browser_tests/tests/vueNodes/interactions/node/remove.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from '@playwright/test'
22

3-
import { comfyPageFixture as test } from '../../fixtures/ComfyPage'
3+
import { comfyPageFixture as test } from '../../../../fixtures/ComfyPage'
44

55
test.beforeEach(async ({ comfyPage }) => {
66
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import {
2+
comfyExpect as expect,
3+
comfyPageFixture as test
4+
} from '../../../../fixtures/ComfyPage'
5+
import { VueNodeFixture } from '../../../../fixtures/utils/vueNodeFixtures'
6+
7+
test.describe('Vue Nodes Renaming', () => {
8+
test.beforeEach(async ({ comfyPage }) => {
9+
await comfyPage.setSetting('Comfy.Graph.CanvasMenu', false)
10+
await comfyPage.setSetting('Comfy.VueNodes.Enabled', true)
11+
await comfyPage.setup()
12+
})
13+
14+
test('should display node title', async ({ comfyPage }) => {
15+
// Get the KSampler node from the default workflow
16+
const nodes = await comfyPage.getNodeRefsByType('KSampler')
17+
expect(nodes.length).toBeGreaterThanOrEqual(1)
18+
19+
const node = nodes[0]
20+
const vueNode = new VueNodeFixture(node, comfyPage.page)
21+
22+
const title = await vueNode.getTitle()
23+
expect(title).toBe('KSampler')
24+
25+
// Verify title is visible in the header
26+
const header = await vueNode.getHeader()
27+
await expect(header).toContainText('KSampler')
28+
})
29+
30+
test('should allow title renaming by double clicking on the node header', async ({
31+
comfyPage
32+
}) => {
33+
const nodes = await comfyPage.getNodeRefsByType('KSampler')
34+
const node = nodes[0]
35+
const vueNode = new VueNodeFixture(node, comfyPage.page)
36+
37+
// Test renaming with Enter
38+
await vueNode.setTitle('My Custom Sampler')
39+
const newTitle = await vueNode.getTitle()
40+
expect(newTitle).toBe('My Custom Sampler')
41+
42+
// Verify the title is displayed
43+
const header = await vueNode.getHeader()
44+
await expect(header).toContainText('My Custom Sampler')
45+
46+
// Test cancel with Escape
47+
const titleElement = await vueNode.getTitleElement()
48+
await titleElement.dblclick()
49+
await comfyPage.nextFrame()
50+
51+
// Type a different value but cancel
52+
const input = (await vueNode.getHeader()).locator(
53+
'[data-testid="node-title-input"]'
54+
)
55+
await input.fill('This Should Be Cancelled')
56+
await input.press('Escape')
57+
await comfyPage.nextFrame()
58+
59+
// Title should remain as the previously saved value
60+
const titleAfterCancel = await vueNode.getTitle()
61+
expect(titleAfterCancel).toBe('My Custom Sampler')
62+
})
63+
64+
test('Double click node body does not trigger edit', async ({
65+
comfyPage
66+
}) => {
67+
const loadCheckpointNode =
68+
comfyPage.vueNodes.getNodeByTitle('Load Checkpoint')
69+
const nodeBbox = await loadCheckpointNode.boundingBox()
70+
if (!nodeBbox) throw new Error('Node not found')
71+
await loadCheckpointNode.dblclick()
72+
73+
const editingTitleInput = comfyPage.page.getByTestId('node-title-input')
74+
await expect(editingTitleInput).not.toBeVisible()
75+
})
76+
})

browser_tests/tests/vueNodes/nodeInteractions/selectionState.spec.ts renamed to browser_tests/tests/vueNodes/interactions/node/select.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
comfyExpect as expect,
33
comfyPageFixture as test
4-
} from '../../../fixtures/ComfyPage'
4+
} from '../../../../fixtures/ComfyPage'
55

66
test.beforeEach(async ({ comfyPage }) => {
77
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
@@ -15,7 +15,8 @@ test.describe('Vue Node Selection', () => {
1515

1616
const modifiers = [
1717
{ key: 'Control', name: 'ctrl' },
18-
{ key: 'Shift', name: 'shift' }
18+
{ key: 'Shift', name: 'shift' },
19+
{ key: 'Meta', name: 'meta' }
1920
] as const
2021

2122
for (const { key: modifier, name } of modifiers) {
-107 KB
Binary file not shown.
-39.8 KB
Binary file not shown.
-107 KB
Binary file not shown.

0 commit comments

Comments
 (0)