Skip to content

Commit

Permalink
Add playwright test
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei committed Aug 29, 2024
1 parent aa26f19 commit 51b863c
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 0 deletions.
145 changes: 145 additions & 0 deletions browser_tests/assets/primitive_node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
{
"last_node_id": 2,
"last_link_id": 1,
"nodes": [
{
"id": 2,
"type": "KSampler",
"pos": {
"0": 521.0906982421875,
"1": 40.999996185302734,
"2": 0,
"3": 0,
"4": 0,
"5": 0,
"6": 0,
"7": 0,
"8": 0,
"9": 0
},
"size": {
"0": 315,
"1": 262
},
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": null
},
{
"name": "positive",
"type": "CONDITIONING",
"link": null
},
{
"name": "negative",
"type": "CONDITIONING",
"link": null
},
{
"name": "latent_image",
"type": "LATENT",
"link": null
},
{
"name": "steps",
"type": "INT",
"link": 1,
"widget": {
"name": "steps"
}
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
0,
"randomize",
20,
8,
"euler",
"normal",
1
]
},
{
"id": 1,
"type": "PrimitiveNode",
"pos": {
"0": 15,
"1": 46,
"2": 0,
"3": 0,
"4": 0,
"5": 0,
"6": 0,
"7": 0,
"8": 0,
"9": 0
},
"size": [
446.96645387135936,
108.34243389566905
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "INT",
"type": "INT",
"links": [
1
],
"slot_index": 0,
"widget": {
"name": "steps"
}
}
],
"properties": {
"Run widget replace on values": false
},
"widgets_values": [
20,
"fixed"
]
}
],
"links": [
[
1,
1,
0,
2,
4,
"INT"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 1,
"offset": [
0,
0
]
}
},
"version": 0.4
}
9 changes: 9 additions & 0 deletions browser_tests/primitiveNode.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { expect } from '@playwright/test'
import { comfyPageFixture as test } from './ComfyPage'

test.describe('Primitive Node', () => {
test('Can load with correct size', async ({ comfyPage }) => {
await comfyPage.loadWorkflow('primitive_node')
await expect(comfyPage.canvas).toHaveScreenshot('primitive_node.png')
})
})

0 comments on commit 51b863c

Please sign in to comment.