mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
## Summary More simplification ## Changes - **What**: - Remove more UseNewMenu settings calls - Remove `await comfyPage.setup()` - Remove `waitForNodes` in vue node tagged tests ┆Issue is synchronized with this [Notion page](https://app.notion.com/p/PR-11237-test-Remove-unnecessary-setup-UseNewMenu-and-waitForNodes-calls-3426d73d36508198a100c218420d479c) by [Unito](https://www.unito.io)
58 lines
1.9 KiB
TypeScript
58 lines
1.9 KiB
TypeScript
import { expect } from '@playwright/test'
|
|
|
|
import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage'
|
|
import type { WorkspaceStore } from '@e2e/types/globals'
|
|
|
|
test.describe('Browser tab title', { tag: '@smoke' }, () => {
|
|
test.describe('Beta Menu', () => {
|
|
test('Can display workflow name', async ({ comfyPage }) => {
|
|
const workflowName = await comfyPage.page.evaluate(async () => {
|
|
return (window.app!.extensionManager as WorkspaceStore).workflow
|
|
.activeWorkflow?.filename
|
|
})
|
|
await expect
|
|
.poll(() => comfyPage.page.title())
|
|
.toBe(`*${workflowName} - ComfyUI`)
|
|
})
|
|
|
|
test('Can display workflow name with unsaved changes', async ({
|
|
comfyPage
|
|
}) => {
|
|
const workflowName = `test-${Date.now()}`
|
|
await comfyPage.menu.topbar.saveWorkflow(workflowName)
|
|
await expect
|
|
.poll(() => comfyPage.page.title())
|
|
.toBe(`${workflowName} - ComfyUI`)
|
|
|
|
await comfyPage.page.evaluate(async () => {
|
|
const node = window.app!.graph!.nodes[0]
|
|
node.pos[0] += 50
|
|
window.app!.graph!.setDirtyCanvas(true, true)
|
|
;(
|
|
window.app!.extensionManager as WorkspaceStore
|
|
).workflow.activeWorkflow?.changeTracker?.checkState()
|
|
})
|
|
await expect
|
|
.poll(() => comfyPage.page.title())
|
|
.toBe(`*${workflowName} - ComfyUI`)
|
|
|
|
// Delete the saved workflow for cleanup.
|
|
await comfyPage.page.evaluate(async () => {
|
|
return (
|
|
window.app!.extensionManager as WorkspaceStore
|
|
).workflow.activeWorkflow?.delete()
|
|
})
|
|
})
|
|
})
|
|
|
|
test.describe('Legacy Menu', () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
})
|
|
|
|
test('Can display default title', async ({ comfyPage }) => {
|
|
await expect.poll(() => comfyPage.page.title()).toBe('ComfyUI')
|
|
})
|
|
})
|
|
})
|