Skip to content

Commit b0d2b44

Browse files
[test] add browser tests for Vue node multiline string widgets (#5819)
## Summary Added Playwright E2E tests for Vue multiline string widget functionality to ensure text input and persistence work correctly. ## Changes - **What**: Created browser tests for multiline string widget in Vue nodes implementation, covering text input, multiline text input, and focus change behavior. ## Review Focus Test coverage for text input persistence across focus changes and multiline content handling in the CLIP Text Encode widget. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5819-test-add-browser-tests-for-Vue-node-multiline-string-widgets-27b6d73d365081e2916ae663e2d44899) by [Unito](https://www.unito.io)
1 parent 976b1a6 commit b0d2b44

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import {
2+
type ComfyPage,
3+
comfyExpect as expect,
4+
comfyPageFixture as test
5+
} from '../../../../fixtures/ComfyPage'
6+
7+
test.describe('Vue Multiline String Widget', () => {
8+
test.beforeEach(async ({ comfyPage }) => {
9+
await comfyPage.setSetting('Comfy.VueNodes.Enabled', true)
10+
await comfyPage.vueNodes.waitForNodes()
11+
})
12+
13+
const getFirstClipNode = (comfyPage: ComfyPage) =>
14+
comfyPage.vueNodes.getNodeByTitle('CLIP Text Encode (Prompt)').first()
15+
16+
const getFirstMultilineStringWidget = (comfyPage: ComfyPage) =>
17+
getFirstClipNode(comfyPage).getByRole('textbox', { name: 'text' })
18+
19+
test('should allow entering text', async ({ comfyPage }) => {
20+
const textarea = getFirstMultilineStringWidget(comfyPage)
21+
await textarea.fill('Hello World')
22+
await expect(textarea).toHaveValue('Hello World')
23+
await textarea.fill('Hello World 2')
24+
await expect(textarea).toHaveValue('Hello World 2')
25+
})
26+
27+
test('should support entering multiline content', async ({ comfyPage }) => {
28+
const textarea = getFirstMultilineStringWidget(comfyPage)
29+
30+
const multilineValue = ['Line 1', 'Line 2', 'Line 3'].join('\n')
31+
32+
await textarea.fill(multilineValue)
33+
await expect(textarea).toHaveValue(multilineValue)
34+
})
35+
36+
test('should retain value after focus changes', async ({ comfyPage }) => {
37+
const textarea = getFirstMultilineStringWidget(comfyPage)
38+
39+
await textarea.fill('Keep me around')
40+
41+
// Click another node
42+
const loadCheckpointNode =
43+
comfyPage.vueNodes.getNodeByTitle('Load Checkpoint')
44+
await loadCheckpointNode.click()
45+
await getFirstClipNode(comfyPage).click()
46+
47+
await expect(textarea).toHaveValue('Keep me around')
48+
})
49+
})

0 commit comments

Comments
 (0)