test: Use identity-based assertion in node search test (no-changelog) (#29426)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Declan Carroll 2026-04-28 20:16:30 +01:00 committed by GitHub
parent ded94a5124
commit d461ec3e9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -488,6 +488,10 @@ export class CanvasPage extends BasePage {
return this.page.getByTestId('node-creator-item-name');
}
nodeCreatorNodeItem(name: string): Locator {
return this.nodeCreatorNodeItems().getByText(name, { exact: true });
}
nodeCreatorActionItems(): Locator {
return this.page.getByTestId('node-creator-action-item');
}

View File

@ -47,8 +47,8 @@ test.describe(
test('should clear search and show all nodes', async ({ n8n }) => {
await n8n.canvas.clickCanvasPlusButton();
await n8n.canvas.fillNodeCreatorSearchBar('Linear');
await expect(n8n.canvas.nodeCreatorNodeItem('Linear')).toBeVisible();
const searchCount = await n8n.canvas.nodeCreatorNodeItems().count();
await expect(n8n.canvas.nodeCreatorNodeItems()).toHaveCount(1);
await n8n.canvas.nodeCreatorSearchBar().clear();
const nodeCount = await n8n.canvas.nodeCreatorNodeItems().count();