mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-01 05:49:54 +00:00
* Add disconnect node test * Add connect node test * Add widght value adjust test * Add zoom test * Test panning of canvas * Move fixture * Add add node test * Add group test * Property panel * Add collapse test * Bypass node * Add widget convertion test * Update test expectations [skip ci] * Add group node test * Update test expectations [skip ci] --------- Co-authored-by: github-actions <github-actions@github.com>
75 lines
3.5 KiB
TypeScript
75 lines
3.5 KiB
TypeScript
import { expect } from '@playwright/test';
|
|
import { comfyPageFixture as test } from './ComfyPage';
|
|
|
|
test.describe('Canvas Right Click Menu', () => {
|
|
test('Can add node', async ({ comfyPage }) => {
|
|
await comfyPage.rightClickCanvas();
|
|
await expect(comfyPage.canvas).toHaveScreenshot('right-click-menu.png');
|
|
await comfyPage.page.getByText('Add Node').click();
|
|
await comfyPage.nextFrame();
|
|
await expect(comfyPage.canvas).toHaveScreenshot('add-node-menu.png');
|
|
await comfyPage.page.getByText('loaders').click();
|
|
await comfyPage.nextFrame();
|
|
await expect(comfyPage.canvas).toHaveScreenshot('add-node-menu-loaders.png');
|
|
await comfyPage.page.getByText('Load VAE').click();
|
|
await comfyPage.nextFrame();
|
|
await expect(comfyPage.canvas).toHaveScreenshot('add-node-node-added.png');
|
|
});
|
|
|
|
test('Can add group', async ({ comfyPage }) => {
|
|
await comfyPage.rightClickCanvas();
|
|
await expect(comfyPage.canvas).toHaveScreenshot('right-click-menu.png');
|
|
await comfyPage.page.getByText('Add Group', { exact: true }).click();
|
|
await comfyPage.nextFrame();
|
|
await expect(comfyPage.canvas).toHaveScreenshot('add-group-group-added.png');
|
|
});
|
|
|
|
test('Can convert to group node', async ({ comfyPage }) => {
|
|
await comfyPage.select2Nodes();
|
|
await expect(comfyPage.canvas).toHaveScreenshot('selected-2-nodes.png');
|
|
comfyPage.page.on('dialog', async dialog => {
|
|
await dialog.accept("GroupNode2CLIP");
|
|
});
|
|
await comfyPage.rightClickCanvas();
|
|
await comfyPage.page.getByText('Convert to Group Node').click();
|
|
await comfyPage.nextFrame();
|
|
await expect(comfyPage.canvas).toHaveScreenshot('right-click-node-group-node.png');
|
|
});
|
|
});
|
|
|
|
test.describe('Node Right Click Menu', () => {
|
|
test('Can open properties panel', async ({ comfyPage }) => {
|
|
await comfyPage.rightClickEmptyLatentNode();
|
|
await expect(comfyPage.canvas).toHaveScreenshot('right-click-node.png');
|
|
await comfyPage.page.getByText('Properties Panel').click();
|
|
await comfyPage.nextFrame();
|
|
await expect(comfyPage.canvas).toHaveScreenshot('right-click-node-properties-panel.png');
|
|
});
|
|
|
|
test('Can collapse', async ({ comfyPage }) => {
|
|
await comfyPage.rightClickEmptyLatentNode();
|
|
await expect(comfyPage.canvas).toHaveScreenshot('right-click-node.png');
|
|
await comfyPage.page.getByText('Collapse').click();
|
|
await comfyPage.nextFrame();
|
|
await expect(comfyPage.canvas).toHaveScreenshot('right-click-node-collapsed.png');
|
|
});
|
|
|
|
test('Can bypass', async ({ comfyPage }) => {
|
|
await comfyPage.rightClickEmptyLatentNode();
|
|
await expect(comfyPage.canvas).toHaveScreenshot('right-click-node.png');
|
|
await comfyPage.page.getByText('Bypass').click();
|
|
await comfyPage.nextFrame();
|
|
await expect(comfyPage.canvas).toHaveScreenshot('right-click-node-bypassed.png');
|
|
});
|
|
|
|
test('Can convert widget to input', async ({ comfyPage }) => {
|
|
await comfyPage.rightClickEmptyLatentNode();
|
|
await expect(comfyPage.canvas).toHaveScreenshot('right-click-node.png');
|
|
await comfyPage.page.getByText('Convert Widget to Input').click();
|
|
await comfyPage.nextFrame();
|
|
await comfyPage.page.getByText('Convert width to input').click();
|
|
await comfyPage.nextFrame();
|
|
await expect(comfyPage.canvas).toHaveScreenshot('right-click-node-widget-converted.png');
|
|
});
|
|
});
|