From be2693f3b5ab41ee188533d7615f6e150ffd6622 Mon Sep 17 00:00:00 2001 From: bymyself Date: Sat, 31 Jan 2026 21:59:53 -0800 Subject: [PATCH] fix: revert selectNodes changes and fix test assertions Amp-Thread-ID: https://ampcode.com/threads/T-019c17a0-1d8c-746f-8ee0-0145b7f56561 --- browser_tests/fixtures/ComfyPage.ts | 12 ++++-------- .../tests/propertiesPanel/propertiesPanel.spec.ts | 14 +++++++------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/browser_tests/fixtures/ComfyPage.ts b/browser_tests/fixtures/ComfyPage.ts index 799055fe9..befc3cc0a 100644 --- a/browser_tests/fixtures/ComfyPage.ts +++ b/browser_tests/fixtures/ComfyPage.ts @@ -1373,18 +1373,14 @@ export class ComfyPage { } async selectNodes(nodeTitles: string[]) { - let isFirst = true + await this.page.keyboard.down('Control') for (const nodeTitle of nodeTitles) { const nodes = await this.getNodeRefsByTitle(nodeTitle) for (const node of nodes) { - if (isFirst) { - await node.click('title') - isFirst = false - } else { - await node.click('title', { modifiers: ['Control'] }) - } + await node.click('title') } } + await this.page.keyboard.up('Control') await this.nextFrame() } @@ -1609,7 +1605,7 @@ export class ComfyPage { ( await this.page.evaluate((title) => { return window['app'].graph.nodes - .filter((n: LGraphNode) => n.getTitle() === title) + .filter((n: LGraphNode) => n.title === title) .map((n: LGraphNode) => n.id) }, title) ).map((id: NodeId) => this.getNodeRefById(id)) diff --git a/browser_tests/tests/propertiesPanel/propertiesPanel.spec.ts b/browser_tests/tests/propertiesPanel/propertiesPanel.spec.ts index cc69a7bc1..07b3cfc95 100644 --- a/browser_tests/tests/propertiesPanel/propertiesPanel.spec.ts +++ b/browser_tests/tests/propertiesPanel/propertiesPanel.spec.ts @@ -12,16 +12,16 @@ test.describe('Properties panel', () => { await comfyPage.selectNodes(['KSampler', 'VAE Decode']) - await expect(propertiesPanel.panelTitle).toContainText('3 items selected') - await expect(propertiesPanel.root.getByText('KSampler')).toHaveCount(1) - await expect(propertiesPanel.root.getByText('VAE Decode')).toHaveCount(2) + await expect(propertiesPanel.panelTitle).toContainText('2 items selected') + await expect(propertiesPanel.root.getByText('KSampler')).toBeVisible() + await expect(propertiesPanel.root.getByText('VAE Decode')).toBeVisible() await propertiesPanel.searchBox.fill('seed') - await expect(propertiesPanel.root.getByText('KSampler')).toHaveCount(1) - await expect(propertiesPanel.root.getByText('VAE Decode')).toHaveCount(0) + await expect(propertiesPanel.root.getByText('KSampler')).toBeVisible() + await expect(propertiesPanel.root.getByText('VAE Decode')).not.toBeVisible() await propertiesPanel.searchBox.fill('') - await expect(propertiesPanel.root.getByText('KSampler')).toHaveCount(1) - await expect(propertiesPanel.root.getByText('VAE Decode')).toHaveCount(2) + await expect(propertiesPanel.root.getByText('KSampler')).toBeVisible() + await expect(propertiesPanel.root.getByText('VAE Decode')).toBeVisible() }) })