mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 22:09:37 +00:00
## Summary Simplifies test setup for common settings ## Changes - **What**: - add vue-nodes tag to auto enable nodes 2.0 - remove UseNewMenu Top as this is default ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-11184-test-Simplify-vue-node-menu-test-setup-3416d73d3650815487e0c357d28761fe) by [Unito](https://www.unito.io)
71 lines
2.3 KiB
TypeScript
71 lines
2.3 KiB
TypeScript
import { expect } from '@playwright/test'
|
|
|
|
import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage'
|
|
import { TestIds } from '@e2e/fixtures/selectors'
|
|
import { PropertiesPanelHelper } from '@e2e/tests/propertiesPanel/PropertiesPanelHelper'
|
|
|
|
test.describe('Errors tab - common', { tag: '@ui' }, () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.settings.setSetting(
|
|
'Comfy.RightSidePanel.ShowErrorsTab',
|
|
true
|
|
)
|
|
})
|
|
|
|
test.describe('Tab visibility', () => {
|
|
test('Should show Errors tab when errors exist', async ({ comfyPage }) => {
|
|
await comfyPage.workflow.loadWorkflow('missing/missing_nodes')
|
|
await comfyPage.actionbar.propertiesButton.click()
|
|
|
|
const panel = new PropertiesPanelHelper(comfyPage.page)
|
|
await expect(panel.errorsTabIcon).toBeVisible()
|
|
})
|
|
|
|
test('Should not show Errors tab when setting is disabled', async ({
|
|
comfyPage
|
|
}) => {
|
|
await comfyPage.workflow.loadWorkflow('missing/missing_nodes')
|
|
await comfyPage.settings.setSetting(
|
|
'Comfy.RightSidePanel.ShowErrorsTab',
|
|
false
|
|
)
|
|
await comfyPage.actionbar.propertiesButton.click()
|
|
|
|
const panel = new PropertiesPanelHelper(comfyPage.page)
|
|
await expect(panel.errorsTabIcon).toBeHidden()
|
|
})
|
|
})
|
|
|
|
test.describe('Search and filter', () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.setup()
|
|
})
|
|
|
|
test('Should filter execution errors by search query', async ({
|
|
comfyPage
|
|
}) => {
|
|
await comfyPage.workflow.loadWorkflow('nodes/execution_error')
|
|
await comfyPage.command.executeCommand('Comfy.QueuePrompt')
|
|
|
|
const errorOverlay = comfyPage.page.getByTestId(
|
|
TestIds.dialogs.errorOverlay
|
|
)
|
|
await expect(errorOverlay).toBeVisible()
|
|
await errorOverlay
|
|
.getByTestId(TestIds.dialogs.errorOverlaySeeErrors)
|
|
.click()
|
|
await expect(errorOverlay).toBeHidden()
|
|
|
|
const runtimePanel = comfyPage.page.getByTestId(
|
|
TestIds.dialogs.runtimeErrorPanel
|
|
)
|
|
await expect(runtimePanel).toBeVisible()
|
|
|
|
const searchInput = comfyPage.page.getByPlaceholder(/^Search/)
|
|
await searchInput.fill('nonexistent_query_xyz_12345')
|
|
|
|
await expect(runtimePanel).toHaveCount(0)
|
|
})
|
|
})
|
|
})
|