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)
104 lines
3.1 KiB
TypeScript
104 lines
3.1 KiB
TypeScript
import { expect } from '@playwright/test'
|
|
|
|
import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage'
|
|
import { TestIds } from '@e2e/fixtures/selectors'
|
|
import {
|
|
interceptClipboardWrite,
|
|
getClipboardText
|
|
} from '@e2e/helpers/clipboardSpy'
|
|
import {
|
|
cleanupFakeModel,
|
|
loadWorkflowAndOpenErrorsTab
|
|
} from '@e2e/tests/propertiesPanel/ErrorsTabHelper'
|
|
|
|
test.describe('Errors tab - Missing models', { tag: '@ui' }, () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.settings.setSetting(
|
|
'Comfy.RightSidePanel.ShowErrorsTab',
|
|
true
|
|
)
|
|
await cleanupFakeModel(comfyPage)
|
|
})
|
|
|
|
test('Should show missing models group in errors tab', async ({
|
|
comfyPage
|
|
}) => {
|
|
await loadWorkflowAndOpenErrorsTab(comfyPage, 'missing/missing_models')
|
|
|
|
await expect(
|
|
comfyPage.page.getByTestId(TestIds.dialogs.missingModelsGroup)
|
|
).toBeVisible()
|
|
})
|
|
|
|
test('Should display model name with referencing node count', async ({
|
|
comfyPage
|
|
}) => {
|
|
await loadWorkflowAndOpenErrorsTab(comfyPage, 'missing/missing_models')
|
|
|
|
const modelsGroup = comfyPage.page.getByTestId(
|
|
TestIds.dialogs.missingModelsGroup
|
|
)
|
|
await expect(modelsGroup).toContainText(/fake_model\.safetensors\s*\(\d+\)/)
|
|
})
|
|
|
|
test('Should expand model row to show referencing nodes', async ({
|
|
comfyPage
|
|
}) => {
|
|
await loadWorkflowAndOpenErrorsTab(
|
|
comfyPage,
|
|
'missing/missing_models_with_nodes'
|
|
)
|
|
|
|
const locateButton = comfyPage.page.getByTestId(
|
|
TestIds.dialogs.missingModelLocate
|
|
)
|
|
await expect(locateButton.first()).toBeHidden()
|
|
|
|
const expandButton = comfyPage.page.getByTestId(
|
|
TestIds.dialogs.missingModelExpand
|
|
)
|
|
await expect(expandButton.first()).toBeVisible()
|
|
await expandButton.first().click()
|
|
|
|
await expect(locateButton.first()).toBeVisible()
|
|
})
|
|
|
|
test('Should copy model name to clipboard', async ({ comfyPage }) => {
|
|
await loadWorkflowAndOpenErrorsTab(comfyPage, 'missing/missing_models')
|
|
await interceptClipboardWrite(comfyPage.page)
|
|
|
|
const copyButton = comfyPage.page.getByTestId(
|
|
TestIds.dialogs.missingModelCopyName
|
|
)
|
|
await expect(copyButton.first()).toBeVisible()
|
|
await copyButton.first().dispatchEvent('click')
|
|
|
|
const copiedText = await getClipboardText(comfyPage.page)
|
|
expect(copiedText).toContain('fake_model.safetensors')
|
|
})
|
|
|
|
test.describe('OSS-specific', { tag: '@oss' }, () => {
|
|
test('Should show Copy URL button for non-asset models', async ({
|
|
comfyPage
|
|
}) => {
|
|
await loadWorkflowAndOpenErrorsTab(comfyPage, 'missing/missing_models')
|
|
|
|
const copyUrlButton = comfyPage.page.getByTestId(
|
|
TestIds.dialogs.missingModelCopyUrl
|
|
)
|
|
await expect(copyUrlButton.first()).toBeVisible()
|
|
})
|
|
|
|
test('Should show Download button for downloadable models', async ({
|
|
comfyPage
|
|
}) => {
|
|
await loadWorkflowAndOpenErrorsTab(comfyPage, 'missing/missing_models')
|
|
|
|
const downloadButton = comfyPage.page.getByTestId(
|
|
TestIds.dialogs.missingModelDownload
|
|
)
|
|
await expect(downloadButton.first()).toBeVisible()
|
|
})
|
|
})
|
|
})
|