mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 15:10:06 +00:00
Migrate all test callers to use helper classes directly: - nodeOps: getGraphNodesCount, getNodeRefById, selectNodes, etc. - canvasOps: dragAndDrop, zoom, pan, resetView, etc. - subgraph: rightClickInputSlot, connectToOutput, etc. Reduces ComfyPage.ts from 1335 to 1085 lines (-250 lines). Amp-Thread-ID: https://ampcode.com/threads/T-019c1318-58b7-757f-801c-5b676f0d3421 Co-authored-by: Amp <amp@ampcode.com>
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
import { expect } from '@playwright/test'
|
|
|
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
|
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
})
|
|
|
|
test.describe('Record Audio Node', { tag: '@screenshot' }, () => {
|
|
test('should add a record audio node and take a screenshot', async ({
|
|
comfyPage
|
|
}) => {
|
|
// Open the search box by double clicking on the canvas
|
|
await comfyPage.canvasOps.doubleClick()
|
|
await expect(comfyPage.searchBox.input).toHaveCount(1)
|
|
|
|
// Search for and add the RecordAudio node
|
|
await comfyPage.searchBox.fillAndSelectFirstNode('RecordAudio')
|
|
await comfyPage.nextFrame()
|
|
|
|
// Verify the RecordAudio node was added
|
|
const recordAudioNodes =
|
|
await comfyPage.nodeOps.getNodeRefsByType('RecordAudio')
|
|
expect(recordAudioNodes.length).toBe(1)
|
|
|
|
// Take a screenshot of the canvas with the RecordAudio node
|
|
await expect(comfyPage.canvas).toHaveScreenshot('record_audio_node.png')
|
|
})
|
|
})
|