test: Remove redundant E2E page loads and the fixed reset delay (no-changelog) (#39681)

This commit is contained in:
Declan Carroll 2026-09-28 08:41:09 +00:00 committed by GitHub
parent 1fe19db437
commit de4fb8d6a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 841 additions and 811 deletions

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,6 @@ import type {
} from '@n8n/api-types';
import { request, type APIRequestContext } from '@playwright/test';
import type { IWorkflowSettings } from 'n8n-workflow';
import { setTimeout as wait } from 'node:timers/promises';
import type { UserCredentials } from '../config/test-users';
import {
@ -212,12 +211,12 @@ export class ApiHelpers {
},
});
// The endpoint responds only after the reset and the user seeding complete,
// so no extra wait is necessary.
if (!response.ok()) {
const errorText = await response.text();
throw new TestError(errorText);
}
// Adding small delay to ensure database is reset
await wait(1000);
}
async signin(role: UserRole, memberIndex: number = 0): Promise<LoginResponseData> {

View File

@ -8,10 +8,6 @@ test.describe(
annotation: [{ type: 'owner', description: 'Identity & Access' }],
},
() => {
test.beforeEach(async ({ n8n }) => {
await n8n.goHome();
});
test('should create a new credential using empty state', async ({ n8n }) => {
const projectId = await n8n.start.fromNewProject();
const credentialName = `My awesome Notion account ${nanoid()}`;

View File

@ -16,7 +16,6 @@ test.describe(
test.describe.configure({ mode: 'serial' });
test.beforeEach(async ({ n8n }) => {
await n8n.goHome();
// Enable features required for project workflows and moving resources
await n8n.api.enableFeature('sharing');
await n8n.api.enableFeature('folders');

View File

@ -61,9 +61,8 @@ test.describe(
annotation: [{ type: 'owner', description: 'Adore' }],
},
() => {
test.beforeEach(async ({ setupRequirements, n8n }) => {
test.beforeEach(async ({ setupRequirements }) => {
await setupRequirements(createTemplateRequirements());
await n8n.goHome();
});
test('Should take users to canvas when importing template', async ({ n8n }) => {

View File

@ -33,7 +33,6 @@ test.describe
});
test('should show up in the menu sidebar', async ({ n8n }) => {
await n8n.goHome();
await n8n.workerView.goto();
await expect(n8n.workerView.getWorkerMenuItem()).toBeVisible();
});

View File

@ -21,10 +21,6 @@ test.describe(
annotation: [{ type: 'owner', description: 'Catalysts' }],
},
() => {
test.beforeEach(async ({ n8n }) => {
await n8n.goHome();
});
test('should populate logs as manual execution progresses', async ({
n8n,
setupRequirements,

View File

@ -11,13 +11,10 @@ test.describe(
annotation: [{ type: 'owner', description: 'Adore' }],
},
() => {
test.beforeEach(async ({ n8n }) => {
await n8n.start.fromBlankCanvas();
});
test('should show up when double clicked on a node and close when Back to canvas clicked', async ({
n8n,
}) => {
await n8n.start.fromBlankCanvas();
await n8n.canvas.addNode('Manual Trigger');
const canvasNodes = n8n.canvas.getCanvasNodes();
await canvasNodes.first().dblclick();
@ -27,6 +24,7 @@ test.describe(
});
test('should show input panel when node is not connected', async ({ n8n }) => {
await n8n.start.fromBlankCanvas();
await n8n.canvas.addNode('Manual Trigger');
await n8n.canvas.deselectAll();
await n8n.canvas.addNode('Edit Fields (Set)', { closeNDV: true });
@ -53,6 +51,7 @@ test.describe(
});
test('should show correct validation state for resource locator params', async ({ n8n }) => {
await n8n.start.fromBlankCanvas();
await n8n.canvas.addNode('Typeform Trigger', { closeNDV: false });
await expect(n8n.ndv.container).toBeVisible();
@ -63,6 +62,7 @@ test.describe(
});
test('should show validation errors only after blur or re-opening of NDV', async ({ n8n }) => {
await n8n.start.fromBlankCanvas();
await n8n.canvas.addNode('Manual Trigger');
await n8n.canvas.addNode('Airtable', { closeNDV: false, action: 'Search records' });
await expect(n8n.ndv.container).toBeVisible();
@ -110,6 +110,7 @@ test.describe(
});
test('webhook should fallback to webhookId if path is empty', async ({ n8n }) => {
await n8n.start.fromBlankCanvas();
await n8n.canvas.addNode('Webhook', { closeNDV: false });
await expect(n8n.canvas.getNodeIssuesByName('Webhook')).toBeHidden();
@ -134,6 +135,7 @@ test.describe(
});
test('should properly show node execution indicator', async ({ n8n }) => {
await n8n.start.fromBlankCanvas();
await n8n.canvas.addNode('Manual Trigger');
await n8n.canvas.addNode('Code', { action: 'Code in JavaScript', closeNDV: false });
@ -172,6 +174,7 @@ test.describe(
test('should not push NDV header out with a lot of code in Code node editor', async ({
n8n,
}) => {
await n8n.start.fromBlankCanvas();
await n8n.canvas.addNode('Manual Trigger');
await n8n.canvas.addNode('Code', { action: 'Code in JavaScript', closeNDV: false });
@ -192,6 +195,7 @@ test.describe(
});
test('should allow editing code in fullscreen in the code editors', async ({ n8n }) => {
await n8n.start.fromBlankCanvas();
await n8n.canvas.addNode('Manual Trigger');
await n8n.canvas.addNode('Code', { action: 'Code in JavaScript', closeNDV: false });
@ -213,6 +217,7 @@ test.describe(
test('ADO-2931 - should handle multiple branches of the same input with the first branch empty correctly', async ({
n8n,
}) => {
await n8n.start.fromBlankCanvas();
await n8n.canvas.importWorkflow(
'Test_ndv_two_branches_of_same_parent_false_populated.json',
'Multiple Branches Test',
@ -230,6 +235,7 @@ test.describe(
test.describe('Execution Indicators - Multi-Node', () => {
test('should properly show node execution indicator for multiple nodes', async ({ n8n }) => {
await n8n.start.fromBlankCanvas();
await n8n.canvas.addNode(CODE_NODE_NAME, { action: 'Code in JavaScript' });
await n8n.ndv.clickBackToCanvasButton();

View File

@ -7,10 +7,6 @@ test.describe(
annotation: [{ type: 'owner', description: 'Adore' }],
},
() => {
test.beforeEach(async ({ n8n }) => {
await n8n.start.fromBlankCanvas();
});
test.describe('Schema View', () => {
const schemaKeys = [
'id',
@ -201,6 +197,7 @@ test.describe(
test.describe('Schema & Data Views', () => {
test('should show data from the correct output in schema view', async ({ n8n }) => {
await n8n.start.fromBlankCanvas();
await n8n.canvas.importWorkflow('Test_workflow_multiple_outputs.json', 'Multiple outputs');
await n8n.workflowComposer.executeWorkflowAndWaitForNotification(
'Workflow executed successfully',
@ -228,6 +225,7 @@ test.describe(
test.describe('Search Functionality - Advanced', () => {
test('should not show items count when searching in schema view', async ({ n8n }) => {
await n8n.start.fromBlankCanvas();
await n8n.canvas.importWorkflow('Test_ndv_search.json', 'NDV Search Test');
await n8n.canvas.openNode('Edit Fields');
await expect(n8n.ndv.outputPanel.get()).toBeVisible();
@ -242,6 +240,7 @@ test.describe(
test('should show additional tooltip when searching in schema view if no matches', async ({
n8n,
}) => {
await n8n.start.fromBlankCanvas();
await n8n.canvas.importWorkflow('Test_ndv_search.json', 'NDV Search Test');
await n8n.canvas.openNode('Edit Fields');

View File

@ -6,10 +6,6 @@ test.describe(
annotation: [{ type: 'owner', description: 'Adore' }],
},
() => {
test.beforeEach(async ({ n8n }) => {
await n8n.start.fromBlankCanvas();
});
test('should traverse floating nodes with mouse', async ({ n8n }) => {
await n8n.start.fromImportedWorkflow('Floating_Nodes.json');
await n8n.canvas.getCanvasNodes().first().dblclick();
@ -86,6 +82,7 @@ test.describe(
});
test('should connect floating sub-nodes', async ({ n8n }) => {
await n8n.start.fromBlankCanvas();
await n8n.canvas.addNode('AI Agent', { closeNDV: false });
await expect(n8n.ndv.container).toBeVisible();