Merge remote-tracking branch 'origin/bl-tests' into bl-more-slots

This commit is contained in:
Benjamin Lu
2025-09-19 13:05:54 -07:00
3 changed files with 112 additions and 123 deletions

View File

@@ -6,6 +6,7 @@ import {
comfyExpect as expect,
comfyPageFixture as test
} from '../../fixtures/ComfyPage'
import { fitToViewInstant } from '../../helpers/fitToView'
async function getCenter(locator: Locator): Promise<{ x: number; y: number }> {
const box = await locator.boundingBox()
@@ -65,7 +66,7 @@ test.describe('Vue Node Link Interaction', () => {
await comfyPage.setup()
await comfyPage.loadWorkflow('vueNodes/simple-triple')
await comfyPage.vueNodes.waitForNodes()
await comfyPage.fitToView()
await fitToViewInstant(comfyPage)
})
test('should show a link dragging out from a slot when dragging on a slot', async ({
@@ -108,8 +109,7 @@ test.describe('Vue Node Link Interaction', () => {
})
test('should create a link when dropping on a compatible slot', async ({
comfyPage,
comfyMouse
comfyPage
}) => {
const samplerNodes = await comfyPage.getNodeRefsByType('KSampler')
expect(samplerNodes.length).toBeGreaterThan(0)
@@ -135,13 +135,7 @@ test.describe('Vue Node Link Interaction', () => {
await expect(outputSlot).toBeVisible()
await expect(inputSlot).toBeVisible()
const start = await getCenter(outputSlot)
const target = await getCenter(inputSlot)
await comfyMouse.move(start)
await comfyMouse.drag(target)
await comfyMouse.drop()
await outputSlot.dragTo(inputSlot)
await comfyPage.nextFrame()
expect(await samplerOutput.getLinkCount()).toBe(1)
@@ -179,8 +173,7 @@ test.describe('Vue Node Link Interaction', () => {
})
test('should not create a link when slot types are incompatible', async ({
comfyPage,
comfyMouse
comfyPage
}) => {
const samplerNodes = await comfyPage.getNodeRefsByType('KSampler')
expect(samplerNodes.length).toBeGreaterThan(0)
@@ -206,13 +199,7 @@ test.describe('Vue Node Link Interaction', () => {
await expect(outputSlot).toBeVisible()
await expect(inputSlot).toBeVisible()
const start = await getCenter(outputSlot)
const target = await getCenter(inputSlot)
await comfyMouse.move(start)
await comfyMouse.drag(target)
await comfyMouse.drop()
await outputSlot.dragTo(inputSlot)
await comfyPage.nextFrame()
expect(await samplerOutput.getLinkCount()).toBe(0)
@@ -233,8 +220,7 @@ test.describe('Vue Node Link Interaction', () => {
})
test('should not create a link when dropping onto a slot on the same node', async ({
comfyPage,
comfyMouse
comfyPage
}) => {
const samplerNodes = await comfyPage.getNodeRefsByType('KSampler')
expect(samplerNodes.length).toBeGreaterThan(0)
@@ -256,13 +242,7 @@ test.describe('Vue Node Link Interaction', () => {
await expect(outputSlot).toBeVisible()
await expect(inputSlot).toBeVisible()
const start = await getCenter(outputSlot)
const target = await getCenter(inputSlot)
await comfyMouse.move(start)
await comfyMouse.drag(target)
await comfyMouse.drop()
await outputSlot.dragTo(inputSlot)
await comfyPage.nextFrame()
expect(await samplerOutput.getLinkCount()).toBe(0)