diff --git a/browser_tests/fixtures/ComfyPage.ts b/browser_tests/fixtures/ComfyPage.ts index 2bf4770e0..befc3cc0a 100644 --- a/browser_tests/fixtures/ComfyPage.ts +++ b/browser_tests/fixtures/ComfyPage.ts @@ -1384,18 +1384,6 @@ export class ComfyPage { await this.nextFrame() } - async selectFirstNodeByTitles(nodeTitles: string[]) { - await this.page.keyboard.down('Control') - for (const nodeTitle of nodeTitles) { - const nodes = await this.getNodeRefsByTitle(nodeTitle) - if (nodes.length > 0) { - await nodes[0].click('title') - } - } - await this.page.keyboard.up('Control') - await this.nextFrame() - } - async select2Nodes() { // Select 2 CLIP nodes. await this.page.keyboard.down('Control') diff --git a/browser_tests/tests/propertiesPanel/propertiesPanel.spec.ts b/browser_tests/tests/propertiesPanel/propertiesPanel.spec.ts index 58120bcb6..ff452b54a 100644 --- a/browser_tests/tests/propertiesPanel/propertiesPanel.spec.ts +++ b/browser_tests/tests/propertiesPanel/propertiesPanel.spec.ts @@ -6,20 +6,17 @@ test.describe('Properties panel', () => { test('opens and updates title based on selection', async ({ comfyPage }) => { await comfyPage.actionbar.propertiesButton.click() - const { propertiesPanel } = comfyPage + const { propertiesPanel } = comfyPage.menu await expect(propertiesPanel.panelTitle).toContainText('Workflow Overview') - await comfyPage.selectFirstNodeByTitles([ - 'KSampler', - 'CLIP Text Encode (Prompt)' - ]) + await comfyPage.selectNodes(['KSampler', 'CLIP Text Encode (Prompt)']) - await expect(propertiesPanel.panelTitle).toContainText('items selected') + await expect(propertiesPanel.panelTitle).toContainText('3 items selected') await expect(propertiesPanel.root.getByText('KSampler')).toHaveCount(1) await expect( - propertiesPanel.root.getByText('CLIP Text Encode (Prompt)').first() - ).toBeVisible() + propertiesPanel.root.getByText('CLIP Text Encode (Prompt)') + ).toHaveCount(2) await propertiesPanel.searchBox.fill('seed') await expect(propertiesPanel.root.getByText('KSampler')).toHaveCount(1) @@ -30,7 +27,7 @@ test.describe('Properties panel', () => { await propertiesPanel.searchBox.fill('') await expect(propertiesPanel.root.getByText('KSampler')).toHaveCount(1) await expect( - propertiesPanel.root.getByText('CLIP Text Encode (Prompt)').first() - ).toBeVisible() + propertiesPanel.root.getByText('CLIP Text Encode (Prompt)') + ).toHaveCount(2) }) }) diff --git a/browser_tests/tests/propertiesPanel/propertiesPanelBasic.spec.ts b/browser_tests/tests/propertiesPanel/propertiesPanelBasic.spec.ts index 44d8f1ee0..75a4db419 100644 --- a/browser_tests/tests/propertiesPanel/propertiesPanelBasic.spec.ts +++ b/browser_tests/tests/propertiesPanel/propertiesPanelBasic.spec.ts @@ -120,7 +120,7 @@ test.describe('Properties panel basic functionality', { tag: ['@ui'] }, () => { }) => { const { propertiesPanel } = comfyPage - await comfyPage.select2Nodes() + await comfyPage.selectNodes(['KSampler', 'CLIP Text Encode (Prompt)']) await expect(propertiesPanel.panelTitle).toContainText('items selected') }) @@ -130,7 +130,7 @@ test.describe('Properties panel basic functionality', { tag: ['@ui'] }, () => { }) => { const { propertiesPanel } = comfyPage - await comfyPage.select2Nodes() + await comfyPage.selectNodes(['KSampler', 'CLIP Text Encode (Prompt)']) await expect(propertiesPanel.getTab('Parameters')).toBeVisible() await expect(propertiesPanel.getTab('Settings')).toBeVisible() @@ -142,10 +142,11 @@ test.describe('Properties panel basic functionality', { tag: ['@ui'] }, () => { }) => { const { propertiesPanel } = comfyPage - await comfyPage.select2Nodes() + await comfyPage.selectNodes(['KSampler', 'CLIP Text Encode (Prompt)']) + await expect(propertiesPanel.root.getByText('KSampler')).toBeVisible() await expect( - propertiesPanel.root.getByText('CLIP Text Encode (Prompt)').first() + propertiesPanel.root.getByText('CLIP Text Encode (Prompt)') ).toBeVisible() }) }) diff --git a/browser_tests/tests/propertiesPanel/propertiesPanelSearch.spec.ts b/browser_tests/tests/propertiesPanel/propertiesPanelSearch.spec.ts index cac14fd61..8e88aa679 100644 --- a/browser_tests/tests/propertiesPanel/propertiesPanelSearch.spec.ts +++ b/browser_tests/tests/propertiesPanel/propertiesPanelSearch.spec.ts @@ -10,10 +10,7 @@ test.describe('Properties panel search functionality', { tag: ['@ui'] }, () => { test.describe('Search with multiple nodes selected', () => { test.beforeEach(async ({ comfyPage }) => { - await comfyPage.selectFirstNodeByTitles([ - 'KSampler', - 'CLIP Text Encode (Prompt)' - ]) + await comfyPage.selectNodes(['KSampler', 'CLIP Text Encode (Prompt)']) }) test('filters widgets by search query', async ({ comfyPage }) => { diff --git a/browser_tests/tests/propertiesPanel/propertiesPanelTabs.spec.ts b/browser_tests/tests/propertiesPanel/propertiesPanelTabs.spec.ts index fa1b621ae..b9ca6cb7c 100644 --- a/browser_tests/tests/propertiesPanel/propertiesPanelTabs.spec.ts +++ b/browser_tests/tests/propertiesPanel/propertiesPanelTabs.spec.ts @@ -67,10 +67,7 @@ test.describe('Properties panel tab navigation', { tag: ['@ui'] }, () => { await expect(propertiesPanel.getTab('Settings')).toBeVisible() await expect(propertiesPanel.getTab('Nodes')).not.toBeVisible() - await comfyPage.selectFirstNodeByTitles([ - 'KSampler', - 'CLIP Text Encode (Prompt)' - ]) + await comfyPage.selectNodes(['KSampler', 'CLIP Text Encode (Prompt)']) await expect(propertiesPanel.getTab('Parameters')).toBeVisible() await expect(propertiesPanel.getTab('Settings')).toBeVisible() await expect(propertiesPanel.getTab('Info')).not.toBeVisible() @@ -80,13 +77,10 @@ test.describe('Properties panel tab navigation', { tag: ['@ui'] }, () => { test('first tab updates for multiple selection', async ({ comfyPage }) => { const { propertiesPanel } = comfyPage - await comfyPage.selectFirstNodeByTitles(['KSampler']) + await comfyPage.selectNodes(['KSampler']) await expect(propertiesPanel.getTab('Parameters')).toBeVisible() - await comfyPage.selectFirstNodeByTitles([ - 'KSampler', - 'CLIP Text Encode (Prompt)' - ]) + await comfyPage.selectNodes(['KSampler', 'CLIP Text Encode (Prompt)']) const firstTab = propertiesPanel.tabList.locator('[role="tab"]').first() await expect(firstTab).toBeVisible() }) @@ -98,10 +92,10 @@ test.describe('Properties panel tab navigation', { tag: ['@ui'] }, () => { }) => { const { propertiesPanel } = comfyPage - await comfyPage.selectFirstNodeByTitles(['KSampler']) + await comfyPage.selectNodes(['KSampler']) await propertiesPanel.clickTab('Settings') - await comfyPage.selectFirstNodeByTitles(['CLIP Text Encode (Prompt)']) + await comfyPage.selectNodes(['CLIP Text Encode (Prompt)']) await expect(propertiesPanel.getTab('Settings')).toBeVisible() }) @@ -111,13 +105,10 @@ test.describe('Properties panel tab navigation', { tag: ['@ui'] }, () => { }) => { const { propertiesPanel } = comfyPage - await comfyPage.selectFirstNodeByTitles(['KSampler']) + await comfyPage.selectNodes(['KSampler']) await propertiesPanel.clickTab('Info') - await comfyPage.selectFirstNodeByTitles([ - 'KSampler', - 'CLIP Text Encode (Prompt)' - ]) + await comfyPage.selectNodes(['KSampler', 'CLIP Text Encode (Prompt)']) await expect(propertiesPanel.getTab('Info')).not.toBeVisible() const firstTab = propertiesPanel.tabList.locator('[role="tab"]').first() diff --git a/browser_tests/tests/propertiesPanel/propertiesPanelTitleEdit.spec.ts b/browser_tests/tests/propertiesPanel/propertiesPanelTitleEdit.spec.ts index c8535e947..99268fc47 100644 --- a/browser_tests/tests/propertiesPanel/propertiesPanelTitleEdit.spec.ts +++ b/browser_tests/tests/propertiesPanel/propertiesPanelTitleEdit.spec.ts @@ -72,10 +72,7 @@ test.describe('Properties panel title editing', { tag: ['@ui'] }, () => { }) => { const { propertiesPanel } = comfyPage - await comfyPage.selectFirstNodeByTitles([ - 'KSampler', - 'CLIP Text Encode (Prompt)' - ]) + await comfyPage.selectNodes(['KSampler', 'CLIP Text Encode (Prompt)']) await propertiesPanel.panelTitle.click() await expect(propertiesPanel.nodeTitleInput).not.toBeVisible()