test: Clean up janitor violations and update baseline (#27823)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Declan Carroll
2026-04-01 11:36:58 +01:00
committed by GitHub
parent a061bc6c65
commit daf233f24e
5 changed files with 316 additions and 401 deletions
File diff suppressed because it is too large Load Diff
@@ -1,17 +1,17 @@
import { expect, type Page } from '@playwright/test';
import { BuilderSetupWizardPage } from './BuilderSetupWizardPage';
import { BuilderSetupWizard } from './components/BuilderSetupWizard';
/**
* Page object for AI Workflow Builder interactions
*/
export class AIBuilderPage {
readonly page: Page;
readonly wizard: BuilderSetupWizardPage;
readonly wizard: BuilderSetupWizard;
constructor(page: Page) {
this.page = page;
this.wizard = new BuilderSetupWizardPage(page);
this.wizard = new BuilderSetupWizard(page);
}
// #region Locators
@@ -30,10 +30,6 @@ export class NodeDetailsViewPage extends BasePage {
return this.page.getByTestId('node-credentials-empty-state');
}
getQuickConnectEmptyState() {
return this.page.getByTestId('quick-connect-empty-state');
}
credentialDropdownCreateNewCredential() {
return this.page.getByText('Create new credential');
}
@@ -50,10 +46,6 @@ export class NodeDetailsViewPage extends BasePage {
return this.page.getByRole('combobox', { name: 'Select Credential' });
}
getCredentialSelectInput() {
return this.getNodeCredentialsSelect().locator('input');
}
async clickBackToCanvasButton() {
await this.clickByTestId('ndv-close-button');
}
@@ -4,7 +4,7 @@ import type { Page, Locator } from '@playwright/test';
* Page object for the AI Builder Setup Wizard card UI.
* Encapsulates all wizard locators so specs don't use raw selectors.
*/
export class BuilderSetupWizardPage {
export class BuilderSetupWizard {
readonly page: Page;
constructor(page: Page) {
@@ -74,26 +74,4 @@ export class BuilderSetupWizardPage {
}
// #endregion
// #region Node Group Card Locators
/** The node group card (shown instead of regular card for agent nodes) */
getNodeGroupCard(): Locator {
return this.page.getByTestId('builder-node-group-card');
}
/** Node group card title (agent node name) */
getNodeGroupTitle(name: string): Locator {
return this.getNodeGroupCard().getByText(name, { exact: true });
}
/** A specific sub-node section header by name (clickable to expand/collapse) */
getNodeGroupSectionHeader(name: string): Locator {
return this.page
.getByTestId('builder-node-group-section')
.filter({ hasText: name })
.getByTestId('builder-node-group-section-header');
}
// #endregion
}
@@ -66,15 +66,6 @@ test.describe(
await expect(n8n.canvas.nodeConnections()).toHaveCount(0);
});
test('should add disconnected node if nothing is selected', async ({ n8n }) => {
await n8n.canvas.addNode(MANUAL_TRIGGER_NODE_NAME);
await n8n.canvas.deselectAll();
await n8n.canvas.addNode(CODE_NODE_NAME, { action: 'Code in JavaScript', closeNDV: true });
await expect(n8n.canvas.getCanvasNodes()).toHaveCount(2);
await expect(n8n.canvas.nodeConnections()).toHaveCount(0);
});
test('should add node between two connected nodes', async ({ n8n }) => {
await n8n.canvas.addNode(MANUAL_TRIGGER_NODE_NAME);
await n8n.canvas.nodeByName(MANUAL_TRIGGER_NODE_DISPLAY_NAME).click();