mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
Stabilize flaky Playwright tests by improving test reliability. This PR aims to identify and fix flaky e2e tests. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10817-test-stabilize-flaky-Playwright-tests-3366d73d365081ada40de73ce11af625) by [Unito](https://www.unito.io) --------- Co-authored-by: Amp <amp@ampcode.com>
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
import { expect } from '@playwright/test'
|
|
|
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
|
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
await comfyPage.settings.setSetting('Comfy.NodeSearchBoxImpl', 'v1 (legacy)')
|
|
})
|
|
|
|
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('Record Audio', {
|
|
exact: true
|
|
})
|
|
await comfyPage.nextFrame()
|
|
|
|
// Verify the RecordAudio node was added
|
|
await expect
|
|
.poll(
|
|
async () =>
|
|
(await comfyPage.nodeOps.getNodeRefsByType('RecordAudio')).length,
|
|
{
|
|
timeout: 5000
|
|
}
|
|
)
|
|
.toBe(1)
|
|
|
|
// Take a screenshot of the canvas with the RecordAudio node
|
|
await expect(comfyPage.canvas).toHaveScreenshot('record_audio_node.png')
|
|
})
|
|
})
|