Re-enable add node / add group tests (#2815)

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2025-03-02 21:58:43 -05:00
committed by GitHub
parent 8584f982a0
commit f16ef00055
12 changed files with 18 additions and 23 deletions

View File

@@ -4,25 +4,19 @@ import { NodeBadgeMode } from '../src/types/nodeSource'
import { comfyPageFixture as test } from './fixtures/ComfyPage'
test.describe('Canvas Right Click Menu', () => {
// See https://github.com/comfyanonymous/ComfyUI/issues/3883
// Right-click menu on canvas's option sequence is not stable.
test.skip('Can add node', async ({ comfyPage }) => {
test('Can add node', async ({ comfyPage }) => {
await comfyPage.rightClickCanvas()
await expect(comfyPage.canvas).toHaveScreenshot('right-click-menu.png')
await comfyPage.page.getByText('Add Node').click()
await comfyPage.nextFrame()
await expect(comfyPage.canvas).toHaveScreenshot('add-node-menu.png')
await comfyPage.page.getByText('loaders').click()
await comfyPage.nextFrame()
await expect(comfyPage.canvas).toHaveScreenshot('add-node-menu-loaders.png')
await comfyPage.page.getByText('Load VAE').click()
await comfyPage.nextFrame()
await expect(comfyPage.canvas).toHaveScreenshot('add-node-node-added.png')
})
// See https://github.com/comfyanonymous/ComfyUI/issues/3883
// Right-click menu on canvas's option sequence is not stable.
test.skip('Can add group', async ({ comfyPage }) => {
test('Can add group', async ({ comfyPage }) => {
await comfyPage.rightClickCanvas()
await expect(comfyPage.canvas).toHaveScreenshot('right-click-menu.png')
await comfyPage.page.getByText('Add Group', { exact: true }).click()

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 107 KiB

8
package-lock.json generated
View File

@@ -11,7 +11,7 @@
"dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
"@comfyorg/comfyui-electron-types": "^0.4.20",
"@comfyorg/litegraph": "^0.9.0",
"@comfyorg/litegraph": "^0.9.2",
"@primevue/forms": "^4.2.5",
"@primevue/themes": "^4.2.5",
"@sentry/vue": "^8.48.0",
@@ -297,9 +297,9 @@
"license": "GPL-3.0-only"
},
"node_modules/@comfyorg/litegraph": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/@comfyorg/litegraph/-/litegraph-0.9.0.tgz",
"integrity": "sha512-pdQVFqxTQQno2pJlOQtzKsDSoOPUKy4CYpGGf7gyhfjGuXNEwtCrkNwHljGIvBXTTL2txBYklQu/lLqTLG5ASQ==",
"version": "0.9.2",
"resolved": "https://registry.npmjs.org/@comfyorg/litegraph/-/litegraph-0.9.2.tgz",
"integrity": "sha512-b7DPy9ScM9zYIqaQzjIIJzcoIcyDgoKhF9xXsZ8bQu8VpKgbKZ7mfz6Ecxm9+xMIbMSJKy/ErnAHtYKAY76C5g==",
"license": "MIT"
},
"node_modules/@cspotcode/source-map-support": {

View File

@@ -72,7 +72,7 @@
"dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
"@comfyorg/comfyui-electron-types": "^0.4.20",
"@comfyorg/litegraph": "^0.9.0",
"@comfyorg/litegraph": "^0.9.2",
"@primevue/forms": "^4.2.5",
"@primevue/themes": "^4.2.5",
"@sentry/vue": "^8.48.0",

View File

@@ -32,16 +32,17 @@ app.registerExtension({
this.graph_mouse[1]
)
if (!group) {
options.push({
content: 'Add Group For Selected Nodes',
disabled: !this.selectedItems?.size,
callback: () => {
const group = new LGraphGroup()
addNodesToGroup(group, this.selectedItems)
this.graph.add(group)
this.graph.change()
}
})
if (this.selectedItems.size > 0) {
options.push({
content: 'Add Group For Selected Nodes',
callback: () => {
const group = new LGraphGroup()
addNodesToGroup(group, this.selectedItems)
this.graph.add(group)
this.graph.change()
}
})
}
return options
}