From 624bcc75abfeffc1e5bf589fcfd5203d01b61e95 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Fri, 25 Oct 2024 08:01:50 -0400 Subject: [PATCH] Move ComfyPage to fixtures folder (#1304) --- browser_tests/actionbar.spec.ts | 2 +- browser_tests/browserTabTitle.spec.ts | 2 +- browser_tests/changeTracker.spec.ts | 2 +- browser_tests/colorPalette.spec.ts | 2 +- browser_tests/commands.spec.ts | 2 +- browser_tests/copyPaste.spec.ts | 2 +- browser_tests/dialog.spec.ts | 2 +- browser_tests/extensionAPI.spec.ts | 2 +- browser_tests/{ => fixtures}/ComfyPage.ts | 12 ++++++------ browser_tests/graphCanvasMenu.spec.ts | 2 +- browser_tests/groupNode.spec.ts | 6 +++++- browser_tests/interaction.spec.ts | 2 +- browser_tests/keybindings.spec.ts | 2 +- browser_tests/litegraphEvent.spec.ts | 2 +- browser_tests/loadWorkflowInMedia.spec.ts | 2 +- browser_tests/menu.spec.ts | 2 +- browser_tests/nodeBadge.spec.ts | 2 +- browser_tests/nodeDisplay.spec.ts | 2 +- browser_tests/nodeSearchBox.spec.ts | 2 +- browser_tests/primitiveNode.spec.ts | 5 ++++- browser_tests/propertiesPanel.spec.ts | 2 +- browser_tests/rightClickMenu.spec.ts | 2 +- browser_tests/templates.spec.ts | 2 +- browser_tests/textWidgetTruncate.spec.ts | 2 +- 24 files changed, 36 insertions(+), 29 deletions(-) rename browser_tests/{ => fixtures}/ComfyPage.ts (98%) diff --git a/browser_tests/actionbar.spec.ts b/browser_tests/actionbar.spec.ts index 5185ca045..41a486019 100644 --- a/browser_tests/actionbar.spec.ts +++ b/browser_tests/actionbar.spec.ts @@ -1,7 +1,7 @@ import type { Response } from '@playwright/test' import type { StatusWsMessage } from '../src/types/apiTypes.ts' import { expect, mergeTests } from '@playwright/test' -import { comfyPageFixture } from './ComfyPage' +import { comfyPageFixture } from './fixtures/ComfyPage' import { webSocketFixture } from './fixtures/ws.ts' const test = mergeTests(comfyPageFixture, webSocketFixture) diff --git a/browser_tests/browserTabTitle.spec.ts b/browser_tests/browserTabTitle.spec.ts index abbe90dfe..11b0f7aeb 100644 --- a/browser_tests/browserTabTitle.spec.ts +++ b/browser_tests/browserTabTitle.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Browser tab title', () => { test.describe('Beta Menu', () => { diff --git a/browser_tests/changeTracker.spec.ts b/browser_tests/changeTracker.spec.ts index e9ecf6ffb..655f07f05 100644 --- a/browser_tests/changeTracker.spec.ts +++ b/browser_tests/changeTracker.spec.ts @@ -2,7 +2,7 @@ import { ComfyPage, comfyPageFixture as test, comfyExpect as expect -} from './ComfyPage' +} from './fixtures/ComfyPage' async function beforeChange(comfyPage: ComfyPage) { await comfyPage.page.evaluate(() => { diff --git a/browser_tests/colorPalette.spec.ts b/browser_tests/colorPalette.spec.ts index 84dbfee2e..d618f0f61 100644 --- a/browser_tests/colorPalette.spec.ts +++ b/browser_tests/colorPalette.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' const customColorPalettes = { obsidian: { diff --git a/browser_tests/commands.spec.ts b/browser_tests/commands.spec.ts index 7ee3744c9..65a30e648 100644 --- a/browser_tests/commands.spec.ts +++ b/browser_tests/commands.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Keybindings', () => { test('Should execute command', async ({ comfyPage }) => { diff --git a/browser_tests/copyPaste.spec.ts b/browser_tests/copyPaste.spec.ts index 70865e3fb..50ee5dc7b 100644 --- a/browser_tests/copyPaste.spec.ts +++ b/browser_tests/copyPaste.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Copy Paste', () => { test('Can copy and paste node', async ({ comfyPage }) => { diff --git a/browser_tests/dialog.spec.ts b/browser_tests/dialog.spec.ts index 5e2d601f2..e0c11a183 100644 --- a/browser_tests/dialog.spec.ts +++ b/browser_tests/dialog.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Load workflow warning', () => { test('Should display a warning when loading a workflow with missing nodes', async ({ diff --git a/browser_tests/extensionAPI.spec.ts b/browser_tests/extensionAPI.spec.ts index cee3beb54..70efa5914 100644 --- a/browser_tests/extensionAPI.spec.ts +++ b/browser_tests/extensionAPI.spec.ts @@ -1,5 +1,5 @@ import { expect, Locator } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Topbar commands', () => { test.beforeEach(async ({ comfyPage }) => { diff --git a/browser_tests/ComfyPage.ts b/browser_tests/fixtures/ComfyPage.ts similarity index 98% rename from browser_tests/ComfyPage.ts rename to browser_tests/fixtures/ComfyPage.ts index b4f92d669..4938ec936 100644 --- a/browser_tests/ComfyPage.ts +++ b/browser_tests/fixtures/ComfyPage.ts @@ -1,15 +1,15 @@ import type { Page, Locator, APIRequestContext } from '@playwright/test' import { expect } from '@playwright/test' import { test as base } from '@playwright/test' -import { ComfyActionbar } from './helpers/actionbar' +import { ComfyActionbar } from '../helpers/actionbar' import dotenv from 'dotenv' dotenv.config() import * as fs from 'fs' -import { NodeBadgeMode } from '../src/types/nodeSource' -import type { NodeId } from '../src/types/comfyWorkflow' -import type { KeyCombo } from '../src/types/keyBindingTypes' -import { ManageGroupNode } from './helpers/manageGroupNode' -import { ComfyTemplates } from './helpers/templates' +import { NodeBadgeMode } from '../../src/types/nodeSource' +import type { NodeId } from '../../src/types/comfyWorkflow' +import type { KeyCombo } from '../../src/types/keyBindingTypes' +import { ManageGroupNode } from '../helpers/manageGroupNode' +import { ComfyTemplates } from '../helpers/templates' interface Position { x: number diff --git a/browser_tests/graphCanvasMenu.spec.ts b/browser_tests/graphCanvasMenu.spec.ts index 04ce0740b..ca934af40 100644 --- a/browser_tests/graphCanvasMenu.spec.ts +++ b/browser_tests/graphCanvasMenu.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Graph Canvas Menu', () => { test.beforeEach(async ({ comfyPage }) => { diff --git a/browser_tests/groupNode.spec.ts b/browser_tests/groupNode.spec.ts index c72245473..f2d9383ff 100644 --- a/browser_tests/groupNode.spec.ts +++ b/browser_tests/groupNode.spec.ts @@ -1,5 +1,9 @@ import { expect } from '@playwright/test' -import { ComfyPage, NodeReference, comfyPageFixture as test } from './ComfyPage' +import { + ComfyPage, + NodeReference, + comfyPageFixture as test +} from './fixtures/ComfyPage' test.describe('Group Node', () => { test.afterEach(async ({ comfyPage }) => { diff --git a/browser_tests/interaction.spec.ts b/browser_tests/interaction.spec.ts index d542e117c..901e05ed9 100644 --- a/browser_tests/interaction.spec.ts +++ b/browser_tests/interaction.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Node Interaction', () => { test('Can enter prompt', async ({ comfyPage }) => { diff --git a/browser_tests/keybindings.spec.ts b/browser_tests/keybindings.spec.ts index e58610b5b..e7a26dc8e 100644 --- a/browser_tests/keybindings.spec.ts +++ b/browser_tests/keybindings.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Keybindings', () => { test('Should not trigger non-modifier keybinding when typing in input fields', async ({ diff --git a/browser_tests/litegraphEvent.spec.ts b/browser_tests/litegraphEvent.spec.ts index a5c583849..b00db91be 100644 --- a/browser_tests/litegraphEvent.spec.ts +++ b/browser_tests/litegraphEvent.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' function listenForEvent(): Promise { return new Promise((resolve) => { diff --git a/browser_tests/loadWorkflowInMedia.spec.ts b/browser_tests/loadWorkflowInMedia.spec.ts index 6241296bf..05511386d 100644 --- a/browser_tests/loadWorkflowInMedia.spec.ts +++ b/browser_tests/loadWorkflowInMedia.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Load Workflow in Media', () => { ;[ diff --git a/browser_tests/menu.spec.ts b/browser_tests/menu.spec.ts index f55f16257..b27a871bd 100644 --- a/browser_tests/menu.spec.ts +++ b/browser_tests/menu.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Menu', () => { test.beforeEach(async ({ comfyPage }) => { diff --git a/browser_tests/nodeBadge.spec.ts b/browser_tests/nodeBadge.spec.ts index 7ebb06fd3..c8c7bfc16 100644 --- a/browser_tests/nodeBadge.spec.ts +++ b/browser_tests/nodeBadge.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' import type { ComfyApp } from '../src/scripts/app' import { NodeBadgeMode } from '../src/types/nodeSource' diff --git a/browser_tests/nodeDisplay.spec.ts b/browser_tests/nodeDisplay.spec.ts index 05d0157ce..d641322b0 100644 --- a/browser_tests/nodeDisplay.spec.ts +++ b/browser_tests/nodeDisplay.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' // If an input is optional by node definition, it should be shown as // a hollow circle no matter what shape it was defined in the workflow JSON. diff --git a/browser_tests/nodeSearchBox.spec.ts b/browser_tests/nodeSearchBox.spec.ts index c2529e57a..35d514b57 100644 --- a/browser_tests/nodeSearchBox.spec.ts +++ b/browser_tests/nodeSearchBox.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Node search box', () => { test.beforeEach(async ({ comfyPage }) => { diff --git a/browser_tests/primitiveNode.spec.ts b/browser_tests/primitiveNode.spec.ts index 5b556ea3c..8bfecffd1 100644 --- a/browser_tests/primitiveNode.spec.ts +++ b/browser_tests/primitiveNode.spec.ts @@ -1,5 +1,8 @@ import { expect } from '@playwright/test' -import { type NodeReference, comfyPageFixture as test } from './ComfyPage' +import { + type NodeReference, + comfyPageFixture as test +} from './fixtures/ComfyPage' test.describe('Primitive Node', () => { test('Can load with correct size', async ({ comfyPage }) => { diff --git a/browser_tests/propertiesPanel.spec.ts b/browser_tests/propertiesPanel.spec.ts index 8e997bdd8..96916c7bf 100644 --- a/browser_tests/propertiesPanel.spec.ts +++ b/browser_tests/propertiesPanel.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Properties Panel', () => { test.beforeEach(async ({ comfyPage }) => { diff --git a/browser_tests/rightClickMenu.spec.ts b/browser_tests/rightClickMenu.spec.ts index ab3ad57dd..5394ed439 100644 --- a/browser_tests/rightClickMenu.spec.ts +++ b/browser_tests/rightClickMenu.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' import { NodeBadgeMode } from '../src/types/nodeSource' test.describe('Canvas Right Click Menu', () => { diff --git a/browser_tests/templates.spec.ts b/browser_tests/templates.spec.ts index 75968bdf8..0507bba1b 100644 --- a/browser_tests/templates.spec.ts +++ b/browser_tests/templates.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Templates', () => { test.beforeEach(async ({ comfyPage }) => { diff --git a/browser_tests/textWidgetTruncate.spec.ts b/browser_tests/textWidgetTruncate.spec.ts index 0c2831cc2..772b7c417 100644 --- a/browser_tests/textWidgetTruncate.spec.ts +++ b/browser_tests/textWidgetTruncate.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './ComfyPage' +import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Combo text widget', () => { test('Truncates text when resized', async ({ comfyPage }) => {