mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
[test] fix flaky Vue upload widget browser tests using randomize url param (#5845)
## Summary Fix browser tests that use filenames in loader nodes. When the files don't exist, the fallback/error component shows the request URL which contains random cache-busting param which makes tests fail due to non-deterministic nature. [Context](https://github.com/Comfy-Org/ComfyUI_frontend/pull/5831#discussion_r2386582256) ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5845-test-fix-flaky-Vue-upload-widget-browser-tests-using-randomize-url-param-27d6d73d36508107a0d0d52d2764a028) by [Unito](https://www.unito.io) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -61,7 +61,7 @@
|
||||
"Node name for S&R": "LoadVideo"
|
||||
},
|
||||
"widgets_values": [
|
||||
"Dying for the right cause, is the most human thing we can do [sOBtQofXPDA].mp4",
|
||||
null,
|
||||
"image"
|
||||
]
|
||||
},
|
||||
@@ -96,7 +96,7 @@
|
||||
"Node name for S&R": "DevToolsLoadAnimatedImageTest"
|
||||
},
|
||||
"widgets_values": [
|
||||
"l0isitzgugt41.webp",
|
||||
null,
|
||||
"image"
|
||||
]
|
||||
},
|
||||
@@ -131,7 +131,7 @@
|
||||
"Node name for S&R": "LoadImage"
|
||||
},
|
||||
"widgets_values": [
|
||||
"ComfyUI_00084_.png",
|
||||
null,
|
||||
"image"
|
||||
]
|
||||
},
|
||||
@@ -161,7 +161,7 @@
|
||||
"Node name for S&R": "LoadImageMask"
|
||||
},
|
||||
"widgets_values": [
|
||||
"01. a lot.mp3",
|
||||
null,
|
||||
"alpha",
|
||||
"image"
|
||||
]
|
||||
@@ -197,7 +197,7 @@
|
||||
"Node name for S&R": "LoadImageOutput"
|
||||
},
|
||||
"widgets_values": [
|
||||
"ComfyUI_00509_.png [output]",
|
||||
null,
|
||||
false,
|
||||
"refresh",
|
||||
"image"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 67 KiB |
@@ -20,7 +20,9 @@
|
||||
>
|
||||
<i-lucide:image-off class="w-12 h-12 mb-2 text-gray-400" />
|
||||
<p class="text-sm text-gray-300">{{ $t('g.imageFailedToLoad') }}</p>
|
||||
<p class="text-xs text-gray-400 mt-1">{{ currentImageUrl }}</p>
|
||||
<p class="text-xs text-gray-400 mt-1">
|
||||
{{ getImageFilename(currentImageUrl) }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Loading State -->
|
||||
@@ -260,4 +262,12 @@ const handleKeyDown = (event: KeyboardEvent) => {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const getImageFilename = (url: string): string => {
|
||||
try {
|
||||
return new URL(url).searchParams.get('filename') || 'Unknown file'
|
||||
} catch {
|
||||
return 'Invalid URL'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user