test(editor): Isolate the legacy workflow builder smoke test (#40576)

This commit is contained in:
Eugene
2026-10-07 16:04:19 +00:00
committed by GitHub
parent df8605e875
commit c194d22b5c
3 changed files with 32 additions and 25 deletions
@@ -2,9 +2,8 @@ import { INSTANCE_AI_DISABLED } from './ai-assistant-fixtures';
import type { TestRequirements } from '../Types';
/**
* Requirements for enabling the AI workflow builder feature.
* These tests use the real Anthropic API for workflow generation,
* requiring N8N_AI_ANTHROPIC_KEY to be set in the environment.
* Enable the legacy workflow builder with Instance AI disabled.
* Tests that generate workflows configure their API fixtures separately.
*/
export const workflowBuilderEnabledRequirements: TestRequirements = {
config: {
@@ -0,0 +1,30 @@
import { workflowBuilderEnabledRequirements } from '../../../config/ai-builder-fixtures';
import { test, expect } from '../../../fixtures/base';
test.describe(
'Legacy Workflow Builder @auth:owner @ai',
{
annotation: [{ type: 'owner', description: 'instanceAI' }],
},
() => {
test('opens from an empty canvas with an enabled suggestion', async ({
n8n,
setupRequirements,
}) => {
await setupRequirements(workflowBuilderEnabledRequirements);
await n8n.start.fromBlankCanvas();
await n8n.aiBuilder.waitForCanvasBuildEntry();
await n8n.aiBuilder.getCanvasBuildWithAIButton().click();
await expect(n8n.aiAssistant.getAskAssistantSidebar()).toBeVisible();
await expect(n8n.aiAssistant.getAskAssistantChat()).toBeVisible();
const suggestion = n8n.aiBuilder
.getSuggestionPills()
.filter({ hasText: 'Daily weather report' });
await expect(suggestion).toBeVisible();
await expect(suggestion).toBeEnabled();
});
},
);
@@ -44,28 +44,6 @@ test.describe(
await services.proxy.loadExpectations('workflow-builder');
});
test('should show Build with AI button on empty canvas', async ({ n8n }) => {
await n8n.start.fromBlankCanvas();
await n8n.aiBuilder.waitForCanvasBuildEntry();
await expect(n8n.aiBuilder.getCanvasBuildWithAIButton()).toBeVisible();
});
test('should open workflow builder and show suggestions', async ({ n8n }) => {
await n8n.start.fromBlankCanvas();
await n8n.aiBuilder.waitForCanvasBuildEntry();
await n8n.aiBuilder.getCanvasBuildWithAIButton().click();
await expect(n8n.aiAssistant.getAskAssistantSidebar()).toBeVisible();
await expect(n8n.aiAssistant.getAskAssistantChat()).toBeVisible();
await expect(n8n.aiBuilder.getWorkflowSuggestions()).toBeVisible();
await n8n.aiBuilder.getSuggestionPills().first().waitFor({ state: 'visible' });
const suggestions = n8n.aiBuilder.getSuggestionPills();
await expect(suggestions).toHaveCount(8);
});
// @AI team - investigated issues with this test, the replay of recorded events not working as expected
// doesn't appear to be matching in the correct order/some requests make it past the proxy leading to 401 error
test.fixme('should build workflow from suggested prompt', async ({ n8n }) => {