[BrowserTest] Add test on boolean widget (#2421)
Co-authored-by: github-actions <github-actions@github.com>
35
browser_tests/assets/widgets/boolean_widget.json
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"last_node_id": 11,
|
||||||
|
"last_link_id": 9,
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"id": 11,
|
||||||
|
"type": "DevToolsNodeWithBooleanInput",
|
||||||
|
"pos": [
|
||||||
|
0,
|
||||||
|
30
|
||||||
|
],
|
||||||
|
"size": [
|
||||||
|
315,
|
||||||
|
58
|
||||||
|
],
|
||||||
|
"flags": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"order": 0,
|
||||||
|
"mode": 0,
|
||||||
|
"inputs": [],
|
||||||
|
"outputs": [],
|
||||||
|
"properties": {
|
||||||
|
"Node name for S&R": "DevToolsNodeWithBooleanInput"
|
||||||
|
},
|
||||||
|
"widgets_values": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"links": [],
|
||||||
|
"groups": [],
|
||||||
|
"config": {},
|
||||||
|
"version": 0.4
|
||||||
|
}
|
||||||
@@ -83,6 +83,12 @@ export class NodeWidgetReference {
|
|||||||
y: pos[1]
|
y: pos[1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async click() {
|
||||||
|
await this.node.comfyPage.canvas.click({
|
||||||
|
position: await this.getPosition()
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NodeReference {
|
export class NodeReference {
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 100 KiB |
|
Before Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 100 KiB |
|
Before Width: | Height: | Size: 96 KiB |
@@ -27,3 +27,16 @@ test.describe('Combo text widget', () => {
|
|||||||
await expect(comfyPage.canvas).toHaveScreenshot('resized-to-original.png')
|
await expect(comfyPage.canvas).toHaveScreenshot('resized-to-original.png')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test.describe('Boolean widget', () => {
|
||||||
|
test('Can toggle', async ({ comfyPage }) => {
|
||||||
|
await comfyPage.loadWorkflow('widgets/boolean_widget')
|
||||||
|
await expect(comfyPage.canvas).toHaveScreenshot('boolean_widget.png')
|
||||||
|
const node = (await comfyPage.getFirstNodeRef())!
|
||||||
|
const widget = await node.getWidget(0)
|
||||||
|
await widget.click()
|
||||||
|
await expect(comfyPage.canvas).toHaveScreenshot(
|
||||||
|
'boolean_widget_toggled.png'
|
||||||
|
)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 101 KiB |
|
After Width: | Height: | Size: 98 KiB |
|
After Width: | Height: | Size: 93 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 106 KiB |
|
After Width: | Height: | Size: 103 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 97 KiB |