Skip to content

Commit bc45492

Browse files
benceruleanlugithub-actions
andauthored
test(e2e): align test default menu to Top; make legacy specs explicit (#5746)
## Summary UseNewMenu has been defaulted to Top in the app for over a year; Playwright’s test default lagged behind. This PR aligns the test default with reality and keeps legacy specs stable. ## Changes - tests(e2e): default to 'Top' via fixture; specs that previously relied on the old implicit default now explicitly set 'Comfy.UseNewMenu' to 'Disabled'. - docs(browser-tests): remove outdated README note suggesting tests set 'Top' manually. ## Review Focus - Intentional uses of 'Top' and 'Bottom' remain unchanged. - Confirm ComfyPage default remains 'Top' (see browser_tests/fixtures/ComfyPage.ts). ## Screenshots (if applicable) N/A ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5746-test-e2e-align-test-default-menu-to-Top-make-legacy-specs-explicit-2786d73d365081218d06c1346f3ae18e) by [Unito](https://www.unito.io) --------- Co-authored-by: github-actions <[email protected]>
1 parent f3e6880 commit bc45492

37 files changed

+129
-9
lines changed

browser_tests/README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,6 @@ TEST_COMFYUI_DIR=/path/to/your/ComfyUI
5656

5757
### Common Setup Issues
5858

59-
**Most tests require the new menu system** - Add to your test:
60-
61-
```typescript
62-
test.beforeEach(async ({ comfyPage }) => {
63-
await comfyPage.setSetting('Comfy.UseNewMenu', 'Top')
64-
})
65-
```
66-
6759
### Release API Mocking
6860

6961
By default, all tests mock the release API (`api.comfy.org/releases`) to prevent release notification popups from interfering with test execution. This is necessary because the release notifications can appear over UI elements and block test interactions.

browser_tests/fixtures/ComfyPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ export const comfyPageFixture = base.extend<{
16431643

16441644
try {
16451645
await comfyPage.setupSettings({
1646-
'Comfy.UseNewMenu': 'Disabled',
1646+
'Comfy.UseNewMenu': 'Top',
16471647
// Hide canvas menu/info/selection toolbox by default.
16481648
'Comfy.Graph.CanvasInfo': false,
16491649
'Comfy.Graph.CanvasMenu': false,

browser_tests/tests/backgroundImageUpload.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { expect } from '@playwright/test'
22

33
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
44

5+
test.beforeEach(async ({ comfyPage }) => {
6+
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
7+
})
8+
59
test.describe('Background Image Upload', () => {
610
test.beforeEach(async ({ comfyPage }) => {
711
// Reset the background image setting before each test

browser_tests/tests/changeTracker.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ async function afterChange(comfyPage: ComfyPage) {
1515
})
1616
}
1717

18+
test.beforeEach(async ({ comfyPage }) => {
19+
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
20+
})
21+
1822
test.describe('Change Tracker', () => {
1923
test.describe('Undo/Redo', () => {
2024
test.beforeEach(async ({ comfyPage }) => {

browser_tests/tests/chatHistory.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import { expect } from '@playwright/test'
33

44
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
55

6+
test.beforeEach(async ({ comfyPage }) => {
7+
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
8+
})
9+
610
interface ChatHistoryEntry {
711
prompt: string
812
response: string

browser_tests/tests/colorPalette.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import { expect } from '@playwright/test'
33
import type { Palette } from '../../src/schemas/colorPaletteSchema'
44
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
55

6+
test.beforeEach(async ({ comfyPage }) => {
7+
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
8+
})
9+
610
const customColorPalettes: Record<string, Palette> = {
711
obsidian: {
812
version: 102,

browser_tests/tests/commands.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { expect } from '@playwright/test'
22

33
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
44

5+
test.beforeEach(async ({ comfyPage }) => {
6+
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
7+
})
8+
59
test.describe('Keybindings', () => {
610
test('Should execute command', async ({ comfyPage }) => {
711
await comfyPage.registerCommand('TestCommand', () => {

browser_tests/tests/copyPaste.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { expect } from '@playwright/test'
22

33
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
44

5+
test.beforeEach(async ({ comfyPage }) => {
6+
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
7+
})
8+
59
test.describe('Copy Paste', () => {
610
test('Can copy and paste node', async ({ comfyPage }) => {
711
await comfyPage.clickEmptyLatentNode()

browser_tests/tests/dialog.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import { expect } from '@playwright/test'
44
import type { Keybinding } from '../../src/schemas/keyBindingSchema'
55
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
66

7+
test.beforeEach(async ({ comfyPage }) => {
8+
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
9+
})
10+
711
test.describe('Load workflow warning', () => {
812
test('Should display a warning when loading a workflow with missing nodes', async ({
913
comfyPage

browser_tests/tests/domWidget.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { expect } from '@playwright/test'
22

33
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
44

5+
test.beforeEach(async ({ comfyPage }) => {
6+
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
7+
})
8+
59
test.describe('DOM Widget', () => {
610
test('Collapsed multiline textarea is not visible', async ({ comfyPage }) => {
711
await comfyPage.loadWorkflow('widgets/collapsed_multiline')

0 commit comments

Comments
 (0)