mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-18 19:39:45 +00:00
Manual backport of #10856 to `core/1.43`. ## Conflicts resolved Two files had trivial conflicts from the same root cause — #10856 extracted the inline `cleanup_fake_model` block into a shared `cleanupFakeModel` helper in `browser_tests/tests/propertiesPanel/ErrorsTabHelper.ts`: - `browser_tests/tests/errorOverlay.spec.ts` - `browser_tests/tests/propertiesPanel/errorsTabMissingModels.spec.ts` `core/1.43` still carries the original inline `expect(cleanupOk).toBeTruthy()` form. main's version (post-#10967) uses an inline `expect.poll()` instead. #10856 replaces both with `await cleanupFakeModel(comfyPage)` calling the helper added by this same PR. Resolution: accepted the PR version (helper call) on both conflict sites. The helper itself is added as part of this backport, so no runtime behavior is lost. ## Verification - No residual conflict markers - Cherry-picked commit carries the entire #10856 squash (45 files, +3596/-209) ## Original PR summary See #10856 for full behavioral description, test plan, and screenshots. --- Fixes Comfy-Org/ComfyUI#13256 on core/1.43 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-11217-backport-core-1-43-fix-exclude-muted-bypassed-nodes-from-missing-asset-detection-10-3426d73d365081f0becbcf7d909f0021) by [Unito](https://www.unito.io) Co-authored-by: Christian Byrne <cbyrne@comfy.org>
206 lines
5.9 KiB
TypeScript
206 lines
5.9 KiB
TypeScript
import { expect } from '@playwright/test'
|
|
|
|
import type { ComfyPage } from '@e2e/fixtures/ComfyPage'
|
|
import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage'
|
|
import { TestIds } from '@e2e/fixtures/selectors'
|
|
import { loadWorkflowAndOpenErrorsTab } from '@e2e/tests/propertiesPanel/ErrorsTabHelper'
|
|
|
|
async function uploadFileViaDropzone(comfyPage: ComfyPage) {
|
|
const dropzone = comfyPage.page.getByTestId(
|
|
TestIds.dialogs.missingMediaUploadDropzone
|
|
)
|
|
const [fileChooser] = await Promise.all([
|
|
comfyPage.page.waitForEvent('filechooser'),
|
|
dropzone.click()
|
|
])
|
|
await fileChooser.setFiles(comfyPage.assetPath('test_upload_image.png'))
|
|
}
|
|
|
|
async function confirmPendingSelection(comfyPage: ComfyPage) {
|
|
const confirmButton = comfyPage.page.getByTestId(
|
|
TestIds.dialogs.missingMediaConfirmButton
|
|
)
|
|
await expect(confirmButton).toBeEnabled()
|
|
await confirmButton.click()
|
|
}
|
|
|
|
function getMediaRow(comfyPage: ComfyPage) {
|
|
return comfyPage.page.getByTestId(TestIds.dialogs.missingMediaRow)
|
|
}
|
|
|
|
function getStatusCard(comfyPage: ComfyPage) {
|
|
return comfyPage.page.getByTestId(TestIds.dialogs.missingMediaStatusCard)
|
|
}
|
|
|
|
function getDropzone(comfyPage: ComfyPage) {
|
|
return comfyPage.page.getByTestId(TestIds.dialogs.missingMediaUploadDropzone)
|
|
}
|
|
|
|
test.describe('Errors tab - Missing media', { tag: '@ui' }, () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Top')
|
|
await comfyPage.settings.setSetting(
|
|
'Comfy.RightSidePanel.ShowErrorsTab',
|
|
true
|
|
)
|
|
})
|
|
|
|
test.describe('Detection', () => {
|
|
test('Shows missing media group in errors tab', async ({ comfyPage }) => {
|
|
await loadWorkflowAndOpenErrorsTab(
|
|
comfyPage,
|
|
'missing/missing_media_single'
|
|
)
|
|
|
|
await expect(
|
|
comfyPage.page.getByTestId(TestIds.dialogs.missingMediaGroup)
|
|
).toBeVisible()
|
|
})
|
|
|
|
test('Shows correct number of missing media rows', async ({
|
|
comfyPage
|
|
}) => {
|
|
await loadWorkflowAndOpenErrorsTab(
|
|
comfyPage,
|
|
'missing/missing_media_multiple'
|
|
)
|
|
|
|
await expect(getMediaRow(comfyPage)).toHaveCount(2)
|
|
})
|
|
|
|
test('Shows upload dropzone and library select for each missing item', async ({
|
|
comfyPage
|
|
}) => {
|
|
await loadWorkflowAndOpenErrorsTab(
|
|
comfyPage,
|
|
'missing/missing_media_single'
|
|
)
|
|
|
|
await expect(getDropzone(comfyPage)).toBeVisible()
|
|
await expect(
|
|
comfyPage.page.getByTestId(TestIds.dialogs.missingMediaLibrarySelect)
|
|
).toBeVisible()
|
|
})
|
|
})
|
|
|
|
test.describe('Upload flow', () => {
|
|
test('Upload via file picker shows status card then allows confirm', async ({
|
|
comfyPage
|
|
}) => {
|
|
await loadWorkflowAndOpenErrorsTab(
|
|
comfyPage,
|
|
'missing/missing_media_single'
|
|
)
|
|
await uploadFileViaDropzone(comfyPage)
|
|
|
|
await expect(getStatusCard(comfyPage)).toBeVisible()
|
|
|
|
await confirmPendingSelection(comfyPage)
|
|
await expect(getMediaRow(comfyPage)).toHaveCount(0)
|
|
})
|
|
})
|
|
|
|
test.describe('Library select flow', () => {
|
|
test('Selecting from library shows status card then allows confirm', async ({
|
|
comfyPage
|
|
}) => {
|
|
await loadWorkflowAndOpenErrorsTab(
|
|
comfyPage,
|
|
'missing/missing_media_single'
|
|
)
|
|
|
|
const librarySelect = comfyPage.page.getByTestId(
|
|
TestIds.dialogs.missingMediaLibrarySelect
|
|
)
|
|
await librarySelect.getByRole('combobox').click()
|
|
|
|
const optionCount = await comfyPage.page.getByRole('option').count()
|
|
if (optionCount === 0) {
|
|
test.skip()
|
|
return
|
|
}
|
|
|
|
await comfyPage.page.getByRole('option').first().click()
|
|
|
|
await expect(getStatusCard(comfyPage)).toBeVisible()
|
|
|
|
await confirmPendingSelection(comfyPage)
|
|
await expect(getMediaRow(comfyPage)).toHaveCount(0)
|
|
})
|
|
})
|
|
|
|
test.describe('Cancel selection', () => {
|
|
test('Cancelling pending selection returns to upload/library UI', async ({
|
|
comfyPage
|
|
}) => {
|
|
await loadWorkflowAndOpenErrorsTab(
|
|
comfyPage,
|
|
'missing/missing_media_single'
|
|
)
|
|
await uploadFileViaDropzone(comfyPage)
|
|
|
|
await expect(getStatusCard(comfyPage)).toBeVisible()
|
|
await expect(getDropzone(comfyPage)).not.toBeVisible()
|
|
|
|
await comfyPage.page
|
|
.getByTestId(TestIds.dialogs.missingMediaCancelButton)
|
|
.click()
|
|
|
|
await expect(getStatusCard(comfyPage)).not.toBeVisible()
|
|
await expect(getDropzone(comfyPage)).toBeVisible()
|
|
})
|
|
})
|
|
|
|
test.describe('All resolved', () => {
|
|
test('Missing Inputs group disappears when all items are resolved', async ({
|
|
comfyPage
|
|
}) => {
|
|
await loadWorkflowAndOpenErrorsTab(
|
|
comfyPage,
|
|
'missing/missing_media_single'
|
|
)
|
|
await uploadFileViaDropzone(comfyPage)
|
|
await confirmPendingSelection(comfyPage)
|
|
|
|
await expect(
|
|
comfyPage.page.getByTestId(TestIds.dialogs.missingMediaGroup)
|
|
).not.toBeVisible()
|
|
})
|
|
})
|
|
|
|
test.describe('Locate node', () => {
|
|
test('Locate button navigates canvas to the missing media node', async ({
|
|
comfyPage
|
|
}) => {
|
|
await loadWorkflowAndOpenErrorsTab(
|
|
comfyPage,
|
|
'missing/missing_media_single'
|
|
)
|
|
|
|
const offsetBefore = await comfyPage.page.evaluate(() => {
|
|
const canvas = window['app']?.canvas
|
|
return canvas?.ds?.offset
|
|
? [canvas.ds.offset[0], canvas.ds.offset[1]]
|
|
: null
|
|
})
|
|
|
|
const locateButton = comfyPage.page.getByTestId(
|
|
TestIds.dialogs.missingMediaLocateButton
|
|
)
|
|
await expect(locateButton).toBeVisible()
|
|
await locateButton.click()
|
|
|
|
await expect
|
|
.poll(async () => {
|
|
return await comfyPage.page.evaluate(() => {
|
|
const canvas = window['app']?.canvas
|
|
return canvas?.ds?.offset
|
|
? [canvas.ds.offset[0], canvas.ds.offset[1]]
|
|
: null
|
|
})
|
|
})
|
|
.not.toEqual(offsetBefore)
|
|
})
|
|
})
|
|
})
|