Skip to content

Commit 287bd7d

Browse files
huchenleichristian-byrnegithub-actions
authored
Add test on text widget popover dismiss (#732)
* Add test on text widget popover dismiss (#719) * nit * Update test expectations [skip ci] --------- Co-authored-by: bymyself <[email protected]> Co-authored-by: github-actions <[email protected]>
1 parent b396d1a commit 287bd7d

File tree

4 files changed

+80
-5
lines changed

4 files changed

+80
-5
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"last_node_id": 9,
3+
"last_link_id": 9,
4+
"nodes": [
5+
{
6+
"id": 9,
7+
"type": "SaveImage",
8+
"pos": {
9+
"0": 64,
10+
"1": 104
11+
},
12+
"size": {
13+
"0": 210,
14+
"1": 58
15+
},
16+
"flags": {},
17+
"order": 0,
18+
"mode": 0,
19+
"inputs": [
20+
{
21+
"name": "images",
22+
"type": "IMAGE",
23+
"link": null
24+
}
25+
],
26+
"outputs": [],
27+
"properties": {},
28+
"widgets_values": [
29+
"ComfyUI"
30+
]
31+
}
32+
],
33+
"links": [],
34+
"groups": [],
35+
"config": {},
36+
"extra": {
37+
"ds": {
38+
"scale": 1,
39+
"offset": [
40+
0,
41+
0
42+
]
43+
}
44+
},
45+
"version": 0.4
46+
}

browser_tests/interaction.spec.ts

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,15 @@ test.describe('Node Interaction', () => {
111111
)
112112
})
113113

114-
test('Can close prompt dialog with canvas click', async ({ comfyPage }) => {
114+
test('Can close prompt dialog with canvas click (number widget)', async ({
115+
comfyPage
116+
}) => {
117+
const numberWidgetPos = {
118+
x: 724,
119+
y: 645
120+
}
115121
await comfyPage.canvas.click({
116-
position: {
117-
x: 724,
118-
y: 645
119-
}
122+
position: numberWidgetPos
120123
})
121124
await expect(comfyPage.canvas).toHaveScreenshot('prompt-dialog-opened.png')
122125
// Wait for 1s so that it does not trigger the search box by double click.
@@ -130,6 +133,32 @@ test.describe('Node Interaction', () => {
130133
await expect(comfyPage.canvas).toHaveScreenshot('prompt-dialog-closed.png')
131134
})
132135

136+
test('Can close prompt dialog with canvas click (text widget)', async ({
137+
comfyPage
138+
}) => {
139+
const textWidgetPos = {
140+
x: 167,
141+
y: 143
142+
}
143+
await comfyPage.loadWorkflow('single_save_image_node')
144+
await comfyPage.canvas.click({
145+
position: textWidgetPos
146+
})
147+
await expect(comfyPage.canvas).toHaveScreenshot(
148+
'prompt-dialog-opened-text.png'
149+
)
150+
await comfyPage.page.waitForTimeout(1000)
151+
await comfyPage.canvas.click({
152+
position: {
153+
x: 10,
154+
y: 10
155+
}
156+
})
157+
await expect(comfyPage.canvas).toHaveScreenshot(
158+
'prompt-dialog-closed-text.png'
159+
)
160+
})
161+
133162
test('Can double click node title to edit', async ({ comfyPage }) => {
134163
await comfyPage.loadWorkflow('single_ksampler')
135164
await comfyPage.canvas.dblclick({
41.8 KB
Loading
46.9 KB
Loading

0 commit comments

Comments
 (0)