mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-25 01:04:06 +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>
47 lines
1.7 KiB
TypeScript
47 lines
1.7 KiB
TypeScript
import { comfyExpect as expect, comfyPageFixture as test } from '../../../../fixtures/ComfyPage';
|
|
import type { ComfyPage } from '../../../../fixtures/ComfyPage';
|
|
|
|
test.describe('Vue Multiline String Widget', () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.settings.setSetting('Comfy.VueNodes.Enabled', true)
|
|
await comfyPage.vueNodes.waitForNodes()
|
|
})
|
|
|
|
const getFirstClipNode = (comfyPage: ComfyPage) =>
|
|
comfyPage.vueNodes.getNodeByTitle('CLIP Text Encode (Prompt)').first()
|
|
|
|
const getFirstMultilineStringWidget = (comfyPage: ComfyPage) =>
|
|
getFirstClipNode(comfyPage).getByRole('textbox', { name: 'text' })
|
|
|
|
test('should allow entering text', async ({ comfyPage }) => {
|
|
const textarea = getFirstMultilineStringWidget(comfyPage)
|
|
await textarea.fill('Hello World')
|
|
await expect(textarea).toHaveValue('Hello World')
|
|
await textarea.fill('Hello World 2')
|
|
await expect(textarea).toHaveValue('Hello World 2')
|
|
})
|
|
|
|
test('should support entering multiline content', async ({ comfyPage }) => {
|
|
const textarea = getFirstMultilineStringWidget(comfyPage)
|
|
|
|
const multilineValue = ['Line 1', 'Line 2', 'Line 3'].join('\n')
|
|
|
|
await textarea.fill(multilineValue)
|
|
await expect(textarea).toHaveValue(multilineValue)
|
|
})
|
|
|
|
test('should retain value after focus changes', async ({ comfyPage }) => {
|
|
const textarea = getFirstMultilineStringWidget(comfyPage)
|
|
|
|
await textarea.fill('Keep me around')
|
|
|
|
// Click another node
|
|
const loadCheckpointNode =
|
|
comfyPage.vueNodes.getNodeByTitle('Load Checkpoint')
|
|
await loadCheckpointNode.click()
|
|
await getFirstClipNode(comfyPage).click()
|
|
|
|
await expect(textarea).toHaveValue('Keep me around')
|
|
})
|
|
})
|