Skip to content

Commit fb59369

Browse files
christian-byrneclaudegithub-actions
authored andcommitted
[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](#5831 (comment)) ┆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 <[email protected]> Co-authored-by: github-actions <[email protected]>
1 parent 6d677cc commit fb59369

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

browser_tests/assets/widgets/all_load_widgets.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"Node name for S&R": "LoadVideo"
6262
},
6363
"widgets_values": [
64-
"Dying for the right cause, is the most human thing we can do [sOBtQofXPDA].mp4",
64+
null,
6565
"image"
6666
]
6767
},
@@ -96,7 +96,7 @@
9696
"Node name for S&R": "DevToolsLoadAnimatedImageTest"
9797
},
9898
"widgets_values": [
99-
"l0isitzgugt41.webp",
99+
null,
100100
"image"
101101
]
102102
},
@@ -131,7 +131,7 @@
131131
"Node name for S&R": "LoadImage"
132132
},
133133
"widgets_values": [
134-
"ComfyUI_00084_.png",
134+
null,
135135
"image"
136136
]
137137
},
@@ -161,7 +161,7 @@
161161
"Node name for S&R": "LoadImageMask"
162162
},
163163
"widgets_values": [
164-
"01. a lot.mp3",
164+
null,
165165
"alpha",
166166
"image"
167167
]
@@ -197,7 +197,7 @@
197197
"Node name for S&R": "LoadImageOutput"
198198
},
199199
"widgets_values": [
200-
"ComfyUI_00509_.png [output]",
200+
null,
201201
false,
202202
"refresh",
203203
"image"
-2.16 KB
Loading

src/renderer/extensions/vueNodes/components/ImagePreview.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
>
2121
<i-lucide:image-off class="w-12 h-12 mb-2 text-gray-400" />
2222
<p class="text-sm text-gray-300">{{ $t('g.imageFailedToLoad') }}</p>
23-
<p class="text-xs text-gray-400 mt-1">{{ currentImageUrl }}</p>
23+
<p class="text-xs text-gray-400 mt-1">
24+
{{ getImageFilename(currentImageUrl) }}
25+
</p>
2426
</div>
2527

2628
<!-- Loading State -->
@@ -260,4 +262,12 @@ const handleKeyDown = (event: KeyboardEvent) => {
260262
break
261263
}
262264
}
265+
266+
const getImageFilename = (url: string): string => {
267+
try {
268+
return new URL(url).searchParams.get('filename') || 'Unknown file'
269+
} catch {
270+
return 'Invalid URL'
271+
}
272+
}
263273
</script>

0 commit comments

Comments
 (0)