mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-09 17:40:09 +00:00
Auto link node on creation (#110)
* Auto link node on creation * Handle corner case * Add some browser tests * Add auto link test * Force enable * Confirm setting before running test * Update test expectations [skip ci] --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
47
browser_tests/nodeSearchBox.spec.ts
Normal file
47
browser_tests/nodeSearchBox.spec.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import { expect } from "@playwright/test";
|
||||
import { ComfyPage, comfyPageFixture } from "./ComfyPage";
|
||||
|
||||
export const test = comfyPageFixture.extend<{ comfyPage: ComfyPage }>({
|
||||
comfyPage: async ({ comfyPage }, use) => {
|
||||
await comfyPage.page.evaluate(async () => {
|
||||
await window["app"].ui.settings.setSettingValueAsync(
|
||||
"Comfy.NodeSearchBoxImpl",
|
||||
"default"
|
||||
);
|
||||
});
|
||||
await use(comfyPage);
|
||||
},
|
||||
});
|
||||
|
||||
test.describe("Node search box", () => {
|
||||
test("Can trigger on empty canvas double click", async ({ comfyPage }) => {
|
||||
await comfyPage.doubleClickCanvas();
|
||||
await expect(comfyPage.searchBox.input).toHaveCount(1);
|
||||
});
|
||||
|
||||
test("Can trigger on link release", async ({ comfyPage }) => {
|
||||
await comfyPage.page.keyboard.down("Shift");
|
||||
await comfyPage.disconnectEdge();
|
||||
await expect(comfyPage.searchBox.input).toHaveCount(1);
|
||||
});
|
||||
|
||||
test("Does not trigger on link release (no shift)", async ({ comfyPage }) => {
|
||||
await comfyPage.disconnectEdge();
|
||||
await expect(comfyPage.searchBox.input).toHaveCount(0);
|
||||
});
|
||||
|
||||
test("Can add node", async ({ comfyPage }) => {
|
||||
await comfyPage.doubleClickCanvas();
|
||||
await expect(comfyPage.searchBox.input).toHaveCount(1);
|
||||
await comfyPage.searchBox.fillAndSelectFirstNode("KSampler");
|
||||
await expect(comfyPage.canvas).toHaveScreenshot("added-node.png");
|
||||
});
|
||||
|
||||
test("Can auto link node", async ({ comfyPage }) => {
|
||||
await comfyPage.page.keyboard.down("Shift");
|
||||
await comfyPage.disconnectEdge();
|
||||
await comfyPage.page.keyboard.up("Shift");
|
||||
await comfyPage.searchBox.fillAndSelectFirstNode("CLIPTextEncode");
|
||||
await expect(comfyPage.canvas).toHaveScreenshot("auto-linked-node.png");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user