Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions browser_tests/tests/widget.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Prefer consistent global accessor pattern.

Within the same page.evaluate block, line 291 uses window['app'] while line 292 uses app. Both work, but consistent style improves readability.

🔎 Proposed fix for consistency
-        app.canvas.setDirty(true)
+        window['app'].canvas.setDirty(true)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
app.canvas.setDirty(true)
window['app'].canvas.setDirty(true)
🤖 Prompt for AI Agents
In browser_tests/tests/widget.spec.ts around line 292, the code uses
app.canvas.setDirty(true) while the previous line in the same page.evaluate
block uses window['app']; make the accessor consistent by replacing the plain
global reference with the same window['app'] pattern (i.e., call
window['app'].canvas.setDirty(true)) so both lines use the same global accessor
style.

},
[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)
})
})

Expand Down
Loading