mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-05 15:40:10 +00:00
Co-authored-by: filtered <176114999+webfiltered@users.noreply.github.com> Co-authored-by: Terry Jia <terryjia88@gmail.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Jin Yi <jin12cc@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Comfy Org PR Bot <snomiao+comfy-pr@gmail.com>
41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
import { expect } from '@playwright/test'
|
|
|
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
|
|
|
test.describe('Graph Canvas Menu', () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
// Set link render mode to spline to make sure it's not affected by other tests'
|
|
// side effects.
|
|
await comfyPage.setSetting('Comfy.LinkRenderMode', 2)
|
|
})
|
|
|
|
test.skip('Can toggle link visibility', async ({ comfyPage }) => {
|
|
// Skipped for 1.24.x: Screenshot includes minimap button which has different visual state
|
|
// Note: `Comfy.Graph.CanvasMenu` is disabled in comfyPage setup.
|
|
// so no cleanup is needed.
|
|
await comfyPage.setSetting('Comfy.Graph.CanvasMenu', true)
|
|
|
|
const button = comfyPage.page.getByTestId('toggle-link-visibility-button')
|
|
await button.click()
|
|
await comfyPage.nextFrame()
|
|
await expect(comfyPage.canvas).toHaveScreenshot(
|
|
'canvas-with-hidden-links.png'
|
|
)
|
|
const hiddenLinkRenderMode = await comfyPage.page.evaluate(() => {
|
|
return window['LiteGraph'].HIDDEN_LINK
|
|
})
|
|
expect(await comfyPage.getSetting('Comfy.LinkRenderMode')).toBe(
|
|
hiddenLinkRenderMode
|
|
)
|
|
|
|
await button.click()
|
|
await comfyPage.nextFrame()
|
|
await expect(comfyPage.canvas).toHaveScreenshot(
|
|
'canvas-with-visible-links.png'
|
|
)
|
|
expect(await comfyPage.getSetting('Comfy.LinkRenderMode')).not.toBe(
|
|
hiddenLinkRenderMode
|
|
)
|
|
})
|
|
})
|