Skip to content

Commit

Permalink
Add playwright test
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei committed Sep 12, 2024
1 parent c44d0c6 commit db816f9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions browser_tests/rightClickMenu.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect } from '@playwright/test'
import { comfyPageFixture as test } from './ComfyPage'
import { NodeBadgeMode } from '../src/types/nodeSource'

test.describe('Canvas Right Click Menu', () => {
// See https://github.com/comfyanonymous/ComfyUI/issues/3883
Expand Down Expand Up @@ -64,6 +65,24 @@ test.describe('Node Right Click Menu', () => {
)
})

test('Can collapse (Node Badge)', async ({ comfyPage }) => {
await comfyPage.setSetting(
'Comfy.NodeBadge.NodeIdBadgeMode',
NodeBadgeMode.ShowAll
)
await comfyPage.setSetting(
'Comfy.NodeBadge.NodeSourceBadgeMode',
NodeBadgeMode.ShowAll
)

await comfyPage.rightClickEmptyLatentNode()
await comfyPage.page.getByText('Collapse').click()
await comfyPage.nextFrame()
await expect(comfyPage.canvas).toHaveScreenshot(
'right-click-node-collapsed-badge.png'
)
})

test('Can bypass', async ({ comfyPage }) => {
await comfyPage.rightClickEmptyLatentNode()
await expect(comfyPage.canvas).toHaveScreenshot('right-click-node.png')
Expand Down

0 comments on commit db816f9

Please sign in to comment.