fix: revert selectNodes changes and fix test assertions

Amp-Thread-ID: https://ampcode.com/threads/T-019c17a0-1d8c-746f-8ee0-0145b7f56561
This commit is contained in:
bymyself
2026-01-31 21:59:53 -08:00
parent 1d3d64c0eb
commit be2693f3b5
2 changed files with 11 additions and 15 deletions

View File

@@ -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))

View File

@@ -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()
})
})