Skip to content

Commit

Permalink
Confirm setting before running test
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei committed Jul 11, 2024
1 parent 5c10412 commit 418adc8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion browser_tests/ComfyPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ComfyNodeSearchBox {
}

async fillAndSelectFirstNode(nodeName: string) {
await this.input.waitFor({ state: "visible" })
await this.input.waitFor({ state: "visible" });
await this.input.fill(nodeName);
await this.dropdown.waitFor({ state: "visible" });
await this.dropdown.locator("li").nth(0).click();
Expand Down
14 changes: 13 additions & 1 deletion browser_tests/nodeSearchBox.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
import { expect } from "@playwright/test";
import { comfyPageFixture as test } from "./ComfyPage";
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 }) => {
Expand Down
1 change: 1 addition & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default defineConfig({
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
timeout: 3000,
},

// {
Expand Down
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ColorPaletteLoadedEvent } from "./types/colorPalette";
import { LiteGraphNodeSearchSettingEvent } from "./scripts/ui";
const isLoading = ref(true);
const nodeSearchEnabled = ref(true);
const nodeSearchEnabled = ref(false);
const nodeSearchService = ref<NodeSearchService>();
const updateTheme = (e: ColorPaletteLoadedEvent) => {
Expand All @@ -30,7 +30,7 @@ const updateTheme = (e: ColorPaletteLoadedEvent) => {
};
const updateNodeSearchSetting = (e: LiteGraphNodeSearchSettingEvent) => {
// nodeSearchEnabled.value = !e.detail;
nodeSearchEnabled.value = !e.detail;
};
onMounted(async () => {
Expand Down

0 comments on commit 418adc8

Please sign in to comment.