mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 14:54:12 +00:00
- Remove 27 deprecated/wrapper methods from ComfyPage - Migrate callers to use helper classes directly: - keyboard.selectAll/bypass/undo/redo/moveUp/moveDown - clipboard.copy/paste - settings.setSetting/getSetting - workflow.loadWorkflow/deleteWorkflow/setupWorkflowsDirectory - contextMenu.clickMenuItem/clickLitegraphMenuItem - nodeOps.resizeNode with DefaultGraphPositions - canvasOps.clickEmptySpace with DefaultGraphPositions - Replace deprecated node click methods with direct canvas clicks - Replace position getter properties with DefaultGraphPositions imports Amp-Thread-ID: https://ampcode.com/threads/T-019c15e7-2319-76ec-855e-098ec75ef18a Co-authored-by: Amp <amp@ampcode.com>
79 lines
2.7 KiB
TypeScript
79 lines
2.7 KiB
TypeScript
import { expect } from '@playwright/test'
|
|
|
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
|
|
|
test.describe('Minimap', { tag: '@canvas' }, () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Top')
|
|
await comfyPage.settings.setSetting('Comfy.Minimap.Visible', true)
|
|
await comfyPage.settings.setSetting('Comfy.Graph.CanvasMenu', true)
|
|
await comfyPage.workflow.loadWorkflow('default')
|
|
await comfyPage.page.waitForFunction(
|
|
() => window['app'] && window['app'].canvas
|
|
)
|
|
})
|
|
|
|
test('Validate minimap is visible by default', async ({ comfyPage }) => {
|
|
const minimapContainer = comfyPage.page.locator('.litegraph-minimap')
|
|
|
|
await expect(minimapContainer).toBeVisible()
|
|
|
|
const minimapCanvas = minimapContainer.locator('.minimap-canvas')
|
|
await expect(minimapCanvas).toBeVisible()
|
|
|
|
const minimapViewport = minimapContainer.locator('.minimap-viewport')
|
|
await expect(minimapViewport).toBeVisible()
|
|
|
|
await expect(minimapContainer).toHaveCSS('position', 'relative')
|
|
|
|
// position and z-index validation moved to the parent container of the minimap
|
|
const minimapMainContainer = comfyPage.page.locator(
|
|
'.minimap-main-container'
|
|
)
|
|
await expect(minimapMainContainer).toHaveCSS('position', 'absolute')
|
|
await expect(minimapMainContainer).toHaveCSS('z-index', '1000')
|
|
})
|
|
|
|
test('Validate minimap toggle button state', async ({ comfyPage }) => {
|
|
const toggleButton = comfyPage.page.getByTestId('toggle-minimap-button')
|
|
|
|
await expect(toggleButton).toBeVisible()
|
|
|
|
const minimapContainer = comfyPage.page.locator('.litegraph-minimap')
|
|
await expect(minimapContainer).toBeVisible()
|
|
})
|
|
|
|
test('Validate minimap can be toggled off and on', async ({ comfyPage }) => {
|
|
const minimapContainer = comfyPage.page.locator('.litegraph-minimap')
|
|
const toggleButton = comfyPage.page.getByTestId('toggle-minimap-button')
|
|
|
|
await expect(minimapContainer).toBeVisible()
|
|
|
|
await toggleButton.click()
|
|
await comfyPage.nextFrame()
|
|
|
|
await expect(minimapContainer).not.toBeVisible()
|
|
|
|
await toggleButton.click()
|
|
await comfyPage.nextFrame()
|
|
|
|
await expect(minimapContainer).toBeVisible()
|
|
})
|
|
|
|
test('Validate minimap keyboard shortcut Alt+M', async ({ comfyPage }) => {
|
|
const minimapContainer = comfyPage.page.locator('.litegraph-minimap')
|
|
|
|
await expect(minimapContainer).toBeVisible()
|
|
|
|
await comfyPage.page.keyboard.press('Alt+KeyM')
|
|
await comfyPage.nextFrame()
|
|
|
|
await expect(minimapContainer).not.toBeVisible()
|
|
|
|
await comfyPage.page.keyboard.press('Alt+KeyM')
|
|
await comfyPage.nextFrame()
|
|
|
|
await expect(minimapContainer).toBeVisible()
|
|
})
|
|
})
|