From 2724840feabe050c5ee3b5d0310cf5970bef5cd9 Mon Sep 17 00:00:00 2001 From: AustinMroz Date: Thu, 18 Dec 2025 21:17:38 -0800 Subject: [PATCH] Fix animated webp test and remove screenshot (#7632) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove screenshot expectation and restore test. We care that it's displaying an image not what frame of the image is being displayed. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7632-Fix-animated-webp-test-and-remove-screenshot-2ce6d73d365081a59d38dc9d82fa1a51) by [Unito](https://www.unito.io) --- browser_tests/tests/widget.spec.ts | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/browser_tests/tests/widget.spec.ts b/browser_tests/tests/widget.spec.ts index 002ad2924..61031e79e 100644 --- a/browser_tests/tests/widget.spec.ts +++ b/browser_tests/tests/widget.spec.ts @@ -262,13 +262,7 @@ test.describe('Animated image widget', () => { expect(filename).toContain('animated_webp.webp') }) - // FIXME: This test keeps flip-flopping because it relies on animated webp timing, - // which is inherently unreliable in CI environments. The test asset is an animated - // webp with 2 frames, and the test depends on animation frame timing to verify that - // animated webp images are properly displayed (as opposed to being treated as static webp). - // While the underlying functionality works (animated webp are correctly distinguished - // from static webp), the test is flaky due to timing dependencies with webp animation frames. - test.fixme('Can preview saved animated webp image', async ({ comfyPage }) => { + test('Can preview saved animated webp image', async ({ comfyPage }) => { await comfyPage.loadWorkflow('widgets/save_animated_webp') // Get position of the load animated webp node @@ -295,18 +289,13 @@ test.describe('Animated image widget', () => { ([loadId, saveId]) => { // Set the output of the SaveAnimatedWEBP node to equal the loader node's image window['app'].nodeOutputs[saveId] = window['app'].nodeOutputs[loadId] + app.canvas.setDirty(true) }, [loadAnimatedWebpNode.id, saveAnimatedWebpNode.id] ) - await comfyPage.nextFrame() - - // Move mouse and click on canvas to trigger render - await comfyPage.page.mouse.click(64, 64) - - // Expect the SaveAnimatedWEBP node to have an output preview - await expect(comfyPage.canvas).toHaveScreenshot( - 'animated_image_preview_saved_webp.png' - ) + await expect( + comfyPage.page.locator('.dom-widget').locator('img') + ).toHaveCount(2) }) })