mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
- Merge latest main to resolve conflicts
- Fix asset browser filtering: pass target input name (e.g.,
'ckpt_name') instead of PrimitiveNode's widget name ('value')
**Changes:**
- Add `inputNameForBrowser` param to `createAssetWidget`
- Pass `targetInputName` from `PrimitiveNode._createAssetWidget`
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8596-fix-merge-main-and-pass-target-input-name-to-asset-browser-2fd6d73d36508112bb17cf5d3fe54687)
by [Unito](https://www.unito.io)
---------
Co-authored-by: Subagent 5 <subagent@example.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: guill <jacob.e.segal@gmail.com>
Co-authored-by: Jin Yi <jin12cc@gmail.com>
Co-authored-by: Alexander Brown <drjkl@comfy.org>
Co-authored-by: AustinMroz <austin@comfy.org>
Co-authored-by: Comfy Org PR Bot <snomiao+comfy-pr@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Johnpaul Chiwetelu <49923152+Myestery@users.noreply.github.com>
Co-authored-by: Rizumu Ayaka <rizumu@ayaka.moe>
Co-authored-by: Kelly Yang <124ykl@gmail.com>
Co-authored-by: sno <snomiao@gmail.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Benjamin Lu <benjaminlu1107@gmail.com>
Co-authored-by: Terry Jia <terryjia88@gmail.com>
Co-authored-by: Luke Mino-Altherr <luke@comfy.org>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
53 lines
1.6 KiB
TypeScript
53 lines
1.6 KiB
TypeScript
import { test as base } from '@playwright/test'
|
|
|
|
export const webSocketFixture = base.extend<{
|
|
ws: { trigger(data: unknown, url?: string): Promise<void> }
|
|
}>({
|
|
ws: [
|
|
async ({ page }, use) => {
|
|
// Each time a page loads, to catch navigations
|
|
page.on('load', async () => {
|
|
await page.evaluate(function () {
|
|
// Create a wrapper for WebSocket that stores them globally
|
|
// so we can look it up to trigger messages
|
|
const store: Record<string, WebSocket> = (window.__ws__ = {})
|
|
window.WebSocket = class extends window.WebSocket {
|
|
constructor(
|
|
...rest: ConstructorParameters<typeof window.WebSocket>
|
|
) {
|
|
super(...rest)
|
|
store[this.url] = this
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
await use({
|
|
async trigger(data, url) {
|
|
// Trigger a websocket event on the page
|
|
await page.evaluate(
|
|
function ([data, url]) {
|
|
if (!url) {
|
|
// If no URL specified, use page URL
|
|
const u = new URL(window.location.toString())
|
|
u.protocol = 'ws:'
|
|
u.pathname = '/'
|
|
url = u.toString() + 'ws'
|
|
}
|
|
const ws: WebSocket = window.__ws__![url]
|
|
ws.dispatchEvent(
|
|
new MessageEvent('message', {
|
|
data
|
|
})
|
|
)
|
|
},
|
|
[JSON.stringify(data), url]
|
|
)
|
|
}
|
|
})
|
|
},
|
|
// We need this to run automatically as the first thing so it adds handlers as soon as the page loads
|
|
{ auto: true }
|
|
]
|
|
})
|