mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 22:09:37 +00:00
test: hide legacy floating menu globally via CSS in setup()
Hide .comfy-menu.no-drag.comfy-menu-manual-pos via addStyleTag in ComfyPage.setup(). This runs after every page load/reload, so the menu is always hidden in screenshots without needing per-test closeMenu() calls. Remove all closeMenu() calls from 16 test files.
This commit is contained in:
@@ -322,6 +322,9 @@ export class ComfyPage {
|
||||
window.app && window.app.extensionManager
|
||||
)
|
||||
await this.page.locator('.p-blockui-mask').waitFor({ state: 'hidden' })
|
||||
await this.page.addStyleTag({
|
||||
content: '.comfy-menu.no-drag.comfy-menu-manual-pos { display: none; }'
|
||||
})
|
||||
await this.nextFrame()
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import type { WorkspaceStore } from '@e2e/types/globals'
|
||||
|
||||
test.beforeEach(async ({ comfyPage }) => {
|
||||
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
||||
await comfyPage.closeMenu()
|
||||
})
|
||||
|
||||
const customColorPalettes = {
|
||||
@@ -155,7 +154,6 @@ test.describe('Color Palette', { tag: ['@screenshot', '@settings'] }, () => {
|
||||
// Reload to apply the new setting. Setting Comfy.CustomColorPalettes directly
|
||||
// doesn't update the store immediately.
|
||||
await comfyPage.setup()
|
||||
await comfyPage.closeMenu()
|
||||
|
||||
await comfyPage.workflow.loadWorkflow('nodes/every_node_color')
|
||||
await comfyPage.settings.setSetting('Comfy.ColorPalette', 'obsidian_dark')
|
||||
|
||||
@@ -5,7 +5,6 @@ import { DefaultGraphPositions } from '@e2e/fixtures/constants/defaultGraphPosit
|
||||
|
||||
test.beforeEach(async ({ comfyPage }) => {
|
||||
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
||||
await comfyPage.closeMenu()
|
||||
})
|
||||
|
||||
test.describe('Copy Paste', { tag: ['@screenshot', '@workflow'] }, () => {
|
||||
|
||||
@@ -6,7 +6,6 @@ import { getNodeClipRegion } from '@e2e/fixtures/utils/screenshotClip'
|
||||
|
||||
test.beforeEach(async ({ comfyPage }) => {
|
||||
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
||||
await comfyPage.closeMenu()
|
||||
})
|
||||
|
||||
test.describe('Execution', { tag: ['@smoke', '@workflow'] }, () => {
|
||||
|
||||
@@ -5,7 +5,6 @@ import { TestIds } from '@e2e/fixtures/selectors'
|
||||
|
||||
test.beforeEach(async ({ comfyPage }) => {
|
||||
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
||||
await comfyPage.closeMenu()
|
||||
})
|
||||
|
||||
test.describe('Graph Canvas Menu', { tag: ['@screenshot', '@canvas'] }, () => {
|
||||
|
||||
@@ -781,7 +781,6 @@ test.describe('Canvas Interaction', { tag: '@screenshot' }, () => {
|
||||
})
|
||||
|
||||
test('@mobile Can pan with touch', async ({ comfyPage }) => {
|
||||
await comfyPage.closeMenu()
|
||||
await comfyPage.canvasOps.panWithTouch({ x: 200, y: 200 })
|
||||
await expect(comfyPage.canvas).toHaveScreenshot('panned-touch.png')
|
||||
})
|
||||
@@ -845,18 +844,15 @@ test.describe('Load workflow', { tag: '@screenshot' }, () => {
|
||||
test('Restore workflow on reload (switch workflow)', async ({
|
||||
comfyPage
|
||||
}) => {
|
||||
await comfyPage.closeMenu()
|
||||
await comfyPage.workflow.loadWorkflow('nodes/single_ksampler')
|
||||
await expect(comfyPage.canvas).toHaveScreenshot('single_ksampler.png')
|
||||
await comfyPage.setup({ clearStorage: false })
|
||||
await comfyPage.closeMenu()
|
||||
await expect(comfyPage.canvas).toHaveScreenshot('single_ksampler.png')
|
||||
})
|
||||
|
||||
test('Restore workflow on reload (modify workflow)', async ({
|
||||
comfyPage
|
||||
}) => {
|
||||
await comfyPage.closeMenu()
|
||||
await comfyPage.workflow.loadWorkflow('nodes/single_ksampler')
|
||||
const node = (await comfyPage.nodeOps.getFirstNodeRef())!
|
||||
await node.click('collapse')
|
||||
@@ -884,7 +880,6 @@ test.describe('Load workflow', { tag: '@screenshot' }, () => {
|
||||
return false
|
||||
}, start)
|
||||
await comfyPage.setup({ clearStorage: false })
|
||||
await comfyPage.closeMenu()
|
||||
await expect(comfyPage.canvas).toHaveScreenshot(
|
||||
'single_ksampler_modified.png'
|
||||
)
|
||||
|
||||
@@ -4,7 +4,6 @@ import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage'
|
||||
|
||||
test.beforeEach(async ({ comfyPage }) => {
|
||||
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
||||
await comfyPage.closeMenu()
|
||||
})
|
||||
|
||||
test.describe(
|
||||
|
||||
@@ -4,7 +4,6 @@ import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage'
|
||||
|
||||
test.beforeEach(async ({ comfyPage }) => {
|
||||
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
||||
await comfyPage.closeMenu()
|
||||
})
|
||||
|
||||
test.describe('LOD Threshold', { tag: ['@screenshot', '@canvas'] }, () => {
|
||||
|
||||
@@ -6,7 +6,6 @@ import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage'
|
||||
|
||||
test.beforeEach(async ({ comfyPage }) => {
|
||||
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
||||
await comfyPage.closeMenu()
|
||||
})
|
||||
|
||||
test.describe('Node Badge', { tag: ['@screenshot', '@smoke', '@node'] }, () => {
|
||||
|
||||
@@ -6,7 +6,6 @@ import { getNodeClipRegion } from '@e2e/fixtures/utils/screenshotClip'
|
||||
|
||||
test.beforeEach(async ({ comfyPage }) => {
|
||||
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
||||
await comfyPage.closeMenu()
|
||||
})
|
||||
|
||||
// If an input is optional by node definition, it should be shown as
|
||||
|
||||
@@ -16,7 +16,6 @@ async function waitForSearchInsertion(
|
||||
|
||||
test.beforeEach(async ({ comfyPage }) => {
|
||||
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
||||
await comfyPage.closeMenu()
|
||||
})
|
||||
|
||||
test.describe('Node search box', { tag: '@node' }, () => {
|
||||
@@ -151,7 +150,6 @@ test.describe('Node search box', { tag: '@node' }, () => {
|
||||
})
|
||||
|
||||
test('@mobile Can trigger on empty canvas tap', async ({ comfyPage }) => {
|
||||
await comfyPage.closeMenu()
|
||||
await comfyPage.workflow.loadWorkflow('nodes/single_ksampler')
|
||||
const screenCenter = {
|
||||
x: 200,
|
||||
|
||||
@@ -6,7 +6,6 @@ import { getNodeClipRegion } from '@e2e/fixtures/utils/screenshotClip'
|
||||
|
||||
test.beforeEach(async ({ comfyPage }) => {
|
||||
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
||||
await comfyPage.closeMenu()
|
||||
})
|
||||
|
||||
test.describe('Note Node', { tag: '@node' }, () => {
|
||||
|
||||
@@ -5,7 +5,6 @@ import { getNodeClipRegion } from '@e2e/fixtures/utils/screenshotClip'
|
||||
|
||||
test.beforeEach(async ({ comfyPage }) => {
|
||||
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
||||
await comfyPage.closeMenu()
|
||||
await comfyPage.settings.setSetting('Comfy.NodeSearchBoxImpl', 'v1 (legacy)')
|
||||
})
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ test.describe(
|
||||
() => {
|
||||
test.beforeEach(async ({ comfyPage }) => {
|
||||
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
||||
await comfyPage.closeMenu()
|
||||
await comfyPage.settings.setSetting('LiteGraph.Reroute.SplineOffset', 80)
|
||||
})
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import { DefaultGraphPositions } from '@e2e/fixtures/constants/defaultGraphPosit
|
||||
|
||||
test.beforeEach(async ({ comfyPage }) => {
|
||||
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
||||
await comfyPage.closeMenu()
|
||||
})
|
||||
|
||||
test.describe(
|
||||
|
||||
@@ -8,7 +8,6 @@ const test = comfyPageFixture
|
||||
|
||||
test.beforeEach(async ({ comfyPage }) => {
|
||||
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
||||
await comfyPage.closeMenu()
|
||||
})
|
||||
|
||||
const BLUE_COLOR = 'rgb(51, 51, 85)'
|
||||
|
||||
@@ -6,7 +6,6 @@ import { getNodeClipRegion } from '@e2e/fixtures/utils/screenshotClip'
|
||||
|
||||
test.beforeEach(async ({ comfyPage }) => {
|
||||
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
||||
await comfyPage.closeMenu()
|
||||
})
|
||||
|
||||
test.describe('Combo text widget', { tag: ['@screenshot', '@widget'] }, () => {
|
||||
|
||||
Reference in New Issue
Block a user