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:
Johnpaul
2026-04-14 17:30:49 +01:00
parent 485de05548
commit 7a01408ecf
17 changed files with 3 additions and 22 deletions

View File

@@ -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()
}

View File

@@ -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')

View File

@@ -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'] }, () => {

View File

@@ -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'] }, () => {

View File

@@ -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'] }, () => {

View File

@@ -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'
)

View File

@@ -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(

View File

@@ -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'] }, () => {

View File

@@ -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'] }, () => {

View File

@@ -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

View File

@@ -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,

View File

@@ -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' }, () => {

View File

@@ -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)')
})

View File

@@ -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)
})

View File

@@ -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(

View File

@@ -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)'

View File

@@ -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'] }, () => {