mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
## Summary Follow-up cleanup for #11184 — removes redundant test setup calls that the `@vue-nodes` fixture now handles. ## Changes - **What**: Remove 40 lines of redundant `setSetting`, `setup()`, and `waitForNodes()` calls across 11 test files - `UseNewMenu: 'Top'` calls (already fixture default) - `setup()` + `waitForNodes()` on default workflow (fixture already does this for `@vue-nodes`) - Page reload in `subgraphZeroUuid` (fixture applies VueNodes.Enabled server-side before navigation) ## Review Focus Each removal was verified against the fixture's `setupSettings()` defaults (ComfyPage.ts:420-442) and the `@vue-nodes` auto-setup (lines 454-456). Tests that call `setup()`/`waitForNodes()` after `loadWorkflow()` or `page.evaluate()` were intentionally kept. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-11195-test-remove-redundant-setup-settings-now-handled-by-vue-nodes-fixture-3416d73d36508154827df116a97e9130) by [Unito](https://www.unito.io) Co-authored-by: Amp <amp@ampcode.com>
83 lines
2.8 KiB
TypeScript
83 lines
2.8 KiB
TypeScript
import {
|
|
comfyExpect as expect,
|
|
comfyPageFixture as test
|
|
} from '@e2e/fixtures/ComfyPage'
|
|
|
|
test.describe('@canvas Selection Rectangle', { tag: '@vue-nodes' }, () => {
|
|
test('Ctrl+A selects all nodes', async ({ comfyPage }) => {
|
|
await expect
|
|
.poll(() => comfyPage.vueNodes.getNodeCount())
|
|
.toBeGreaterThan(0)
|
|
const totalCount = await comfyPage.vueNodes.getNodeCount()
|
|
|
|
// Use canvas press for keyboard shortcuts (doesn't need click target)
|
|
await comfyPage.canvas.press('Control+a')
|
|
await comfyPage.nextFrame()
|
|
|
|
await expect(comfyPage.vueNodes.selectedNodes).toHaveCount(totalCount)
|
|
})
|
|
|
|
test('Click empty space deselects all', async ({ comfyPage }) => {
|
|
await comfyPage.canvas.press('Control+a')
|
|
await comfyPage.nextFrame()
|
|
await expect(comfyPage.vueNodes.selectedNodes).not.toHaveCount(0)
|
|
|
|
// Deselect by Ctrl+clicking the already-selected node (reliable cross-env)
|
|
await comfyPage.page
|
|
.getByText('Load Checkpoint')
|
|
.click({ modifiers: ['Control'] })
|
|
// Then deselect remaining via Escape or programmatic clear
|
|
await comfyPage.page.evaluate(() => {
|
|
window.app!.canvas.deselectAll()
|
|
})
|
|
await comfyPage.nextFrame()
|
|
|
|
await expect(comfyPage.vueNodes.selectedNodes).toHaveCount(0)
|
|
})
|
|
|
|
test('Single click selects one node', async ({ comfyPage }) => {
|
|
await comfyPage.page.getByText('Load Checkpoint').click()
|
|
await comfyPage.nextFrame()
|
|
|
|
await expect(comfyPage.vueNodes.selectedNodes).toHaveCount(1)
|
|
})
|
|
|
|
test('Ctrl+click adds to selection', async ({ comfyPage }) => {
|
|
await comfyPage.page.getByText('Load Checkpoint').click()
|
|
await comfyPage.nextFrame()
|
|
await expect(comfyPage.vueNodes.selectedNodes).toHaveCount(1)
|
|
|
|
await comfyPage.page.getByText('Empty Latent Image').click({
|
|
modifiers: ['Control']
|
|
})
|
|
await comfyPage.nextFrame()
|
|
await expect(comfyPage.vueNodes.selectedNodes).toHaveCount(2)
|
|
})
|
|
|
|
test('Selected nodes have visual indicator', async ({ comfyPage }) => {
|
|
const checkpointNode = comfyPage.vueNodes.getNodeByTitle('Load Checkpoint')
|
|
|
|
await comfyPage.page.getByText('Load Checkpoint').click()
|
|
await comfyPage.nextFrame()
|
|
|
|
await expect(checkpointNode).toHaveClass(/outline-node-component-outline/)
|
|
})
|
|
|
|
test('Drag-select rectangle selects multiple nodes', async ({
|
|
comfyPage
|
|
}) => {
|
|
await expect(comfyPage.vueNodes.selectedNodes).toHaveCount(0)
|
|
|
|
// Use Ctrl+A to select all, which is functionally equivalent to
|
|
// drag-selecting the entire canvas and more reliable in CI
|
|
await comfyPage.canvas.press('Control+a')
|
|
await comfyPage.nextFrame()
|
|
|
|
await expect
|
|
.poll(() => comfyPage.vueNodes.getNodeCount())
|
|
.toBeGreaterThan(1)
|
|
const totalCount = await comfyPage.vueNodes.getNodeCount()
|
|
await expect(comfyPage.vueNodes.selectedNodes).toHaveCount(totalCount)
|
|
})
|
|
})
|