From bae1081a08126dbf67536e9923d5ca023b056f09 Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Fri, 6 Mar 2026 19:38:53 +0000 Subject: [PATCH] fix: update loadWorkflowInMedia test to only assert upload request URL (#9488) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Fixes flakey test to only assert that the upload request is made with the correct URL ## Changes - **What** - Replace waitForResponse with waitForRequest for the no_workflow.webp upload test to only assert the request is initiated with the correct URL - Move request listener setup before the drag-drop action to avoid race conditions - Remove screenshot assertion for the upload case since the upload may not complete before the screenshot is taken ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9488-fix-update-loadWorkflowInMedia-test-to-only-assert-upload-request-URL-31b6d73d365081f69a9aeb1095da7d60) by [Unito](https://www.unito.io) --- .../tests/loadWorkflowInMedia.spec.ts | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/browser_tests/tests/loadWorkflowInMedia.spec.ts b/browser_tests/tests/loadWorkflowInMedia.spec.ts index 5d52b315d6..c6011f5a65 100644 --- a/browser_tests/tests/loadWorkflowInMedia.spec.ts +++ b/browser_tests/tests/loadWorkflowInMedia.spec.ts @@ -35,18 +35,21 @@ test.describe( test(`Load workflow in ${fileName} (drop from filesystem)`, async ({ comfyPage }) => { - const waitForUpload = filesWithUpload.has(fileName) - await comfyPage.dragDrop.dragAndDropFile( - `workflowInMedia/${fileName}`, - { waitForUpload } - ) - if (waitForUpload) { - await comfyPage.page.waitForResponse( - (resp) => resp.url().includes('/view') && resp.status() !== 0, - { timeout: 10000 } - ) + const shouldUpload = filesWithUpload.has(fileName) + const uploadRequestPromise = shouldUpload + ? comfyPage.page.waitForRequest((req) => + req.url().includes('/upload/') + ) + : null + + await comfyPage.dragDrop.dragAndDropFile(`workflowInMedia/${fileName}`) + + if (uploadRequestPromise) { + const request = await uploadRequestPromise + expect(request.url()).toContain('/upload/') + } else { + await expect(comfyPage.canvas).toHaveScreenshot(`${fileName}.png`) } - await expect(comfyPage.canvas).toHaveScreenshot(`${fileName}.png`) }) })