From 32694573a9a53b22b3fd0be15727c189e0ee51bd Mon Sep 17 00:00:00 2001 From: bymyself Date: Sat, 31 Jan 2026 21:27:08 -0800 Subject: [PATCH] fix: correct selectNodes multi-selection and tab name assertions Amp-Thread-ID: https://ampcode.com/threads/T-019c17a0-1d8c-746f-8ee0-0145b7f56561 --- browser_tests/fixtures/ComfyPage.ts | 10 +++++++--- .../tests/propertiesPanel/propertiesPanelBasic.spec.ts | 6 +++--- .../tests/propertiesPanel/propertiesPanelTabs.spec.ts | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/browser_tests/fixtures/ComfyPage.ts b/browser_tests/fixtures/ComfyPage.ts index befc3cc0a3..d126e04d4c 100644 --- a/browser_tests/fixtures/ComfyPage.ts +++ b/browser_tests/fixtures/ComfyPage.ts @@ -1373,14 +1373,18 @@ export class ComfyPage { } async selectNodes(nodeTitles: string[]) { - await this.page.keyboard.down('Control') + let isFirst = true for (const nodeTitle of nodeTitles) { const nodes = await this.getNodeRefsByTitle(nodeTitle) for (const node of nodes) { - await node.click('title') + if (isFirst) { + await node.click('title') + isFirst = false + } else { + await node.click('title', { modifiers: ['Control'] }) + } } } - await this.page.keyboard.up('Control') await this.nextFrame() } diff --git a/browser_tests/tests/propertiesPanel/propertiesPanelBasic.spec.ts b/browser_tests/tests/propertiesPanel/propertiesPanelBasic.spec.ts index 57790aff02..84045ff238 100644 --- a/browser_tests/tests/propertiesPanel/propertiesPanelBasic.spec.ts +++ b/browser_tests/tests/propertiesPanel/propertiesPanelBasic.spec.ts @@ -125,19 +125,19 @@ test.describe('Properties panel basic functionality', { tag: ['@ui'] }, () => { await expect(propertiesPanel.panelTitle).toContainText('items selected') }) - test('shows Parameters and Settings tabs for multiple selection', async ({ + test('shows Nodes and Settings tabs for multiple selection', async ({ comfyPage }) => { const { propertiesPanel } = comfyPage await comfyPage.selectNodes(['KSampler', 'VAE Decode']) - await expect(propertiesPanel.getTab('Parameters')).toBeVisible() + await expect(propertiesPanel.getTab('Nodes')).toBeVisible() await expect(propertiesPanel.getTab('Settings')).toBeVisible() await expect(propertiesPanel.getTab('Info')).not.toBeVisible() }) - test('lists all selected nodes in Parameters tab', async ({ + test('lists all selected nodes in Nodes tab', async ({ comfyPage }) => { const { propertiesPanel } = comfyPage diff --git a/browser_tests/tests/propertiesPanel/propertiesPanelTabs.spec.ts b/browser_tests/tests/propertiesPanel/propertiesPanelTabs.spec.ts index 1c810bd108..3a921edc3d 100644 --- a/browser_tests/tests/propertiesPanel/propertiesPanelTabs.spec.ts +++ b/browser_tests/tests/propertiesPanel/propertiesPanelTabs.spec.ts @@ -68,10 +68,10 @@ test.describe('Properties panel tab navigation', { tag: ['@ui'] }, () => { await expect(propertiesPanel.getTab('Nodes')).not.toBeVisible() await comfyPage.selectNodes(['KSampler', 'VAE Decode']) - await expect(propertiesPanel.getTab('Parameters')).toBeVisible() + await expect(propertiesPanel.getTab('Nodes')).toBeVisible() await expect(propertiesPanel.getTab('Settings')).toBeVisible() await expect(propertiesPanel.getTab('Info')).not.toBeVisible() - await expect(propertiesPanel.getTab('Nodes')).not.toBeVisible() + await expect(propertiesPanel.getTab('Parameters')).not.toBeVisible() }) test('first tab updates for multiple selection', async ({ comfyPage }) => {