first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled

This commit is contained in:
2026-03-17 16:22:57 +03:30
commit 3d5eaf9445
15349 changed files with 2847338 additions and 0 deletions
@@ -0,0 +1,51 @@
import { test, expect } from '../../../fixtures/base';
import type { TestRequirements } from '../../../Types';
import simpleWorkflow from '../../../workflows/Manual_wait_set.json';
import workflowWithPinned from '../../../workflows/Webhook_set_pinned.json';
const requirements: TestRequirements = {
config: {
settings: {
previewMode: true,
},
},
};
test.describe('Demo', {
annotation: [
{ type: 'owner', description: 'Adore' },
],
}, () => {
test.beforeEach(async ({ setupRequirements }) => {
await setupRequirements(requirements);
});
test('can import template', async ({ n8n }) => {
await n8n.demo.goto();
expect(await n8n.notifications.getAllNotificationTexts()).toHaveLength(0);
await n8n.demo.importWorkflow(simpleWorkflow);
await expect(n8n.canvas.getCanvasNodes()).toHaveCount(3);
});
test('can import workflow with pin data', async ({ n8n }) => {
await n8n.demo.goto();
await expect(n8n.canvas.canvasPane()).toBeVisible();
await n8n.demo.importWorkflow(workflowWithPinned);
await expect(n8n.canvas.getCanvasNodes()).toHaveCount(2);
await n8n.canvas.openNode('Webhook');
await expect(n8n.ndv.outputPanel.getTableHeaders().first()).toContainText('headers');
await expect(n8n.ndv.outputPanel.getTbodyCell(0, 3)).toContainText('dragons');
});
test('can override theme to dark', async ({ n8n }) => {
await n8n.demo.goto('dark');
await expect(n8n.demo.getBody()).toHaveAttribute('data-theme', 'dark');
expect(await n8n.notifications.getAllNotificationTexts()).toHaveLength(0);
});
test('can override theme to light', async ({ n8n }) => {
await n8n.demo.goto('light');
await expect(n8n.demo.getBody()).toHaveAttribute('data-theme', 'light');
expect(await n8n.notifications.getAllNotificationTexts()).toHaveLength(0);
});
});
@@ -0,0 +1,48 @@
import { test, expect } from '../../../fixtures/base';
test.describe
.serial('Environment Feature Flags', {
annotation: [
{ type: 'owner', description: 'Adore' },
],
}, () => {
test('should set feature flags at runtime and load it back in envFeatureFlags from backend settings', async ({
api,
}) => {
const setResponse = await api.setEnvFeatureFlags({
N8N_ENV_FEAT_TEST: 'true',
});
expect(setResponse.data.success).toBe(true);
expect(setResponse.data.message).toBe('Environment feature flags updated');
expect(setResponse.data.flags).toBeInstanceOf(Object);
expect(setResponse.data.flags['N8N_ENV_FEAT_TEST']).toBe('true');
const currentFlags = await api.getEnvFeatureFlags();
expect(currentFlags).toBeInstanceOf(Object);
expect(currentFlags.data['N8N_ENV_FEAT_TEST']).toBe('true');
});
test('should reset feature flags at runtime', async ({ api }) => {
const setResponse1 = await api.setEnvFeatureFlags({
N8N_ENV_FEAT_TEST: 'true',
});
expect(setResponse1.data.success).toBe(true);
expect(setResponse1.data.flags['N8N_ENV_FEAT_TEST']).toBe('true');
const clearResponse = await api.clearEnvFeatureFlags();
expect(clearResponse.data.success).toBe(true);
expect(clearResponse.data.flags).toBeInstanceOf(Object);
expect(clearResponse.data.flags['N8N_ENV_FEAT_TEST']).toBeUndefined();
const currentFlags = await api.getEnvFeatureFlags();
expect(currentFlags).toBeInstanceOf(Object);
expect(currentFlags.data['N8N_ENV_FEAT_TEST']).toBeUndefined();
});
});
@@ -0,0 +1,183 @@
import { test, expect } from '../../../fixtures/base';
import type { TestRequirements } from '../../../Types';
const NOW = Date.now();
const ONE_DAY = 24 * 60 * 60 * 1000;
const THREE_DAYS = ONE_DAY * 3;
const SEVEN_DAYS = ONE_DAY * 7;
const ABOUT_SIX_MONTHS = ONE_DAY * 30 * 6 + ONE_DAY;
const ACTIVATED_USER_SETTINGS = {
userActivated: true,
userActivatedAt: NOW - THREE_DAYS - 1000,
};
const getNpsTestRequirements: TestRequirements = {
config: {
settings: {
telemetry: {
enabled: true,
},
},
},
intercepts: {
npsSurveyApi: {
url: '**/rest/user-settings/nps-survey',
response: { success: true },
},
telemetryTest: {
url: '**/test/telemetry',
response: { status: 'ok' },
},
telemetryProxy: {
url: '**/rest/telemetry/proxy',
response: { status: 'ok' },
},
telemetryRudderstack: {
url: '**/rest/telemetry/rudderstack',
response: { status: 'ok' },
},
},
};
test.fixme(
'NPS Survey',
{
annotation: [{ type: 'owner', description: 'Adore' }],
},
() => {
test.beforeEach(async ({ n8n }) => {
await n8n.page.route('**/rest/login', async (route) => {
const response = await route.fetch();
const originalJson = await response.json();
const modifiedData = {
...originalJson,
data: {
...originalJson.data,
settings: {
...originalJson.data?.settings,
...ACTIVATED_USER_SETTINGS,
},
},
};
await route.fulfill({
status: response.status(),
headers: response.headers(),
contentType: 'application/json',
body: JSON.stringify(modifiedData),
});
});
await n8n.goHome();
});
test('shows nps survey to recently activated user and can submit feedback', async ({
n8n,
setupRequirements,
}) => {
await setupRequirements(getNpsTestRequirements);
await n8n.canvas.visitWithTimestamp(NOW);
// Add a node to trigger autosave (required for NPS survey to show)
await n8n.canvas.addNode('Manual Trigger');
await n8n.page.keyboard.press('Escape');
await n8n.canvas.waitForSaveWorkflowCompleted();
await expect(n8n.npsSurvey.getNpsSurveyModal()).toBeVisible();
expect(await n8n.npsSurvey.getRatingButtonCount()).toBe(11);
await n8n.npsSurvey.clickRating(0);
await n8n.npsSurvey.fillFeedback('n8n is the best');
await n8n.npsSurvey.clickSubmitButton();
await n8n.canvas.visitWithTimestamp(NOW + ONE_DAY);
// Add a node to trigger autosave (required for NPS survey to show)
await n8n.canvas.addNode('Manual Trigger');
await n8n.page.keyboard.press('Escape');
await n8n.canvas.waitForSaveWorkflowCompleted();
await expect(n8n.npsSurvey.getNpsSurveyModal()).toBeHidden();
await n8n.canvas.visitWithTimestamp(NOW + ABOUT_SIX_MONTHS);
// Add a node to trigger autosave (required for NPS survey to show)
await n8n.canvas.addNode('Manual Trigger');
await n8n.page.keyboard.press('Escape');
await n8n.canvas.waitForSaveWorkflowCompleted();
await expect(n8n.npsSurvey.getNpsSurveyModal()).toBeVisible();
});
test('allows user to ignore survey 3 times before stopping to show until 6 months later', async ({
n8n,
setupRequirements,
}) => {
await setupRequirements(getNpsTestRequirements);
await n8n.canvas.visitWithTimestamp(NOW);
// Add a node to trigger autosave (required for NPS survey to show)
await n8n.canvas.addNode('Manual Trigger');
await n8n.page.keyboard.press('Escape');
await n8n.canvas.waitForSaveWorkflowCompleted();
await n8n.notifications.quickCloseAll();
await expect(n8n.npsSurvey.getNpsSurveyModal()).toBeVisible();
await n8n.npsSurvey.closeSurvey();
await expect(n8n.npsSurvey.getNpsSurveyModal()).toBeHidden();
await n8n.canvas.visitWithTimestamp(NOW + ONE_DAY);
// Add a node to trigger autosave (required for NPS survey to show)
await n8n.canvas.addNode('Manual Trigger');
await n8n.page.keyboard.press('Escape');
await n8n.canvas.waitForSaveWorkflowCompleted();
await expect(n8n.npsSurvey.getNpsSurveyModal()).toBeHidden();
await n8n.canvas.visitWithTimestamp(NOW + SEVEN_DAYS + 10000);
// Add a node to trigger autosave (required for NPS survey to show)
await n8n.canvas.addNode('Manual Trigger');
await n8n.page.keyboard.press('Escape');
await n8n.canvas.waitForSaveWorkflowCompleted();
await n8n.notifications.quickCloseAll();
await expect(n8n.npsSurvey.getNpsSurveyModal()).toBeVisible();
await n8n.npsSurvey.closeSurvey();
await expect(n8n.npsSurvey.getNpsSurveyModal()).toBeHidden();
await n8n.canvas.visitWithTimestamp(NOW + SEVEN_DAYS + 10000);
// Add a node to trigger autosave (required for NPS survey to show)
await n8n.canvas.addNode('Manual Trigger');
await n8n.page.keyboard.press('Escape');
await n8n.canvas.waitForSaveWorkflowCompleted();
await expect(n8n.npsSurvey.getNpsSurveyModal()).toBeHidden();
await n8n.canvas.visitWithTimestamp(NOW + (SEVEN_DAYS + 10000) * 2 + ONE_DAY);
// Add a node to trigger autosave (required for NPS survey to show)
await n8n.canvas.addNode('Manual Trigger');
await n8n.page.keyboard.press('Escape');
await n8n.canvas.waitForSaveWorkflowCompleted();
await n8n.notifications.quickCloseAll();
await expect(n8n.npsSurvey.getNpsSurveyModal()).toBeVisible();
await n8n.npsSurvey.closeSurvey();
await expect(n8n.npsSurvey.getNpsSurveyModal()).toBeHidden();
await n8n.canvas.visitWithTimestamp(NOW + (SEVEN_DAYS + 10000) * 2 + ONE_DAY * 2);
// Add a node to trigger autosave (required for NPS survey to show)
await n8n.canvas.addNode('Manual Trigger');
await n8n.page.keyboard.press('Escape');
await n8n.canvas.waitForSaveWorkflowCompleted();
await expect(n8n.npsSurvey.getNpsSurveyModal()).toBeHidden();
await n8n.canvas.visitWithTimestamp(NOW + (SEVEN_DAYS + 10000) * 3 + ONE_DAY * 3);
// Add a node to trigger autosave (required for NPS survey to show)
await n8n.canvas.addNode('Manual Trigger');
await n8n.page.keyboard.press('Escape');
await n8n.canvas.waitForSaveWorkflowCompleted();
await expect(n8n.npsSurvey.getNpsSurveyModal()).toBeHidden();
await n8n.canvas.visitWithTimestamp(NOW + (SEVEN_DAYS + 10000) * 3 + ABOUT_SIX_MONTHS);
// Add a node to trigger autosave (required for NPS survey to show)
await n8n.canvas.addNode('Manual Trigger');
await n8n.page.keyboard.press('Escape');
await n8n.canvas.waitForSaveWorkflowCompleted();
await expect(n8n.npsSurvey.getNpsSurveyModal()).toBeVisible();
});
},
);
@@ -0,0 +1,216 @@
import { test, expect } from '../../../fixtures/base';
import type { n8nPage } from '../../../pages/n8nPage';
test.describe('Security Notifications', {
annotation: [
{ type: 'owner', description: 'Adore' },
],
}, () => {
async function setupVersionsApiMock(
n8n: n8nPage,
options: {
hasSecurityIssue?: boolean;
hasSecurityFix?: boolean;
securityIssueFixVersion?: string;
} = {},
) {
const {
hasSecurityIssue = false,
hasSecurityFix = false,
securityIssueFixVersion = '',
} = options;
await n8n.page.route('**/api/versions/**', async (route) => {
// Extract current version from URL path
const url = route.request().url();
const currentVersion = url.split('/').pop() ?? '1.106.1';
// Parse version to create next version
const versionParts = currentVersion.split('.');
const nextPatchVersion = `${versionParts[0]}.${versionParts[1]}.${parseInt(versionParts[2]) + 1}`;
const mockVersions = [
{
name: currentVersion,
nodes: [],
createdAt: '2025-06-24T00:00:00Z',
description: hasSecurityIssue ? 'Current version with security issue' : 'Current version',
documentationUrl: 'https://docs.n8n.io',
hasBreakingChange: false,
hasSecurityFix: false,
hasSecurityIssue,
securityIssueFixVersion:
securityIssueFixVersion === 'useNextPatch' ? nextPatchVersion : securityIssueFixVersion,
},
{
name: nextPatchVersion,
nodes: [],
createdAt: '2025-06-25T00:00:00Z',
description: hasSecurityFix ? 'Fixed version' : 'Next version',
documentationUrl: 'https://docs.n8n.io',
hasBreakingChange: false,
hasSecurityFix,
hasSecurityIssue: false,
securityIssueFixVersion: '',
},
];
await route.fulfill({ json: mockVersions });
});
}
async function setupApiFailure(n8n: n8nPage) {
await n8n.page.route('**/api/versions/**', async (route) => {
await route.fulfill({
status: 500,
contentType: 'application/json',
body: JSON.stringify({ error: 'API Error' }),
});
});
}
test.describe('Notifications disabled', () => {
test.beforeEach(async ({ setupRequirements }) => {
await setupRequirements({
config: {
settings: {
versionNotifications: {
enabled: false,
endpoint: 'https://test.api.n8n.io/api/versions/',
whatsNewEnabled: false,
whatsNewEndpoint: 'https://test.api.n8n.io/api/whats-new',
infoUrl: 'https://test.docs.n8n.io/hosting/installation/updating/',
},
},
},
});
});
test('should not check for versions if feature is disabled', async ({ n8n }) => {
// Track whether any API requests are made to versions endpoint
let versionsApiCalled = false;
await n8n.page.route('**/api/versions/**', () => {
versionsApiCalled = true;
});
await n8n.goHome();
// Wait a moment for any potential API calls or notifications
// eslint-disable-next-line playwright/no-networkidle
await n8n.page.waitForLoadState('networkidle');
// Verify no API request was made to versions endpoint when notifications are disabled
expect(versionsApiCalled).toBe(false);
});
});
test.describe('Notifications enabled', () => {
test.beforeEach(async ({ setupRequirements }) => {
await setupRequirements({
config: {
settings: {
versionNotifications: {
enabled: true,
endpoint: 'https://test.api.n8n.io/api/versions/',
whatsNewEnabled: true,
whatsNewEndpoint: 'https://test.api.n8n.io/api/whats-new',
infoUrl: 'https://test.docs.n8n.io/hosting/installation/updating/',
},
},
},
});
});
test('should display security notification with correct messaging and styling', async ({
n8n,
}) => {
await setupVersionsApiMock(n8n, { hasSecurityIssue: true, hasSecurityFix: true });
// Reload to trigger version check
await n8n.page.reload();
await n8n.goHome();
// Verify security notification appears with default message
const notification = n8n.notifications.getNotificationByTitle('Critical update available');
await expect(notification).toBeVisible();
await expect(notification).toContainText('Please update to latest version.');
await expect(notification).toContainText('More info');
// Verify warning styling
await expect(n8n.notifications.getWarningNotifications()).toBeVisible();
// Close the notification
await n8n.notifications.closeNotificationByText('Critical update available');
// Now test with specific fix version
await setupVersionsApiMock(n8n, {
hasSecurityIssue: true,
hasSecurityFix: true,
securityIssueFixVersion: 'useNextPatch',
});
// Reload to trigger new version check with fix version
await n8n.goHome();
// Verify notification shows specific fix version (dynamically generated)
const notificationWithFixVersion = n8n.notifications.getNotificationByTitle(
'Critical update available',
);
await expect(notificationWithFixVersion).toBeVisible();
await expect(notificationWithFixVersion).toContainText('Please update to version');
await expect(notificationWithFixVersion).toContainText('or higher.');
});
test('should open versions modal when clicking security notification', async ({ n8n }) => {
await setupVersionsApiMock(n8n, {
hasSecurityIssue: true,
hasSecurityFix: true,
securityIssueFixVersion: 'useNextPatch',
});
await n8n.goHome();
// Wait for and click the security notification
const notification = n8n.notifications.getNotificationByTitle('Critical update available');
await expect(notification).toBeVisible();
await notification.click();
// Verify versions modal opens
const versionsModal = n8n.versions.getVersionUpdatesPanel();
await expect(versionsModal).toBeVisible();
// Verify security update badge exists for the new version
const versionCard = n8n.versions.getVersionCard().first();
const securityBadge = versionCard.locator('.el-tag--danger').getByText('Security update');
await expect(securityBadge).toBeVisible();
});
test('should not display security notification when theres no security issue', async ({
n8n,
}) => {
await setupVersionsApiMock(n8n, { hasSecurityIssue: false });
await n8n.goHome();
// Verify no security notification appears when no security issue
const notification = n8n.notifications.getNotificationByTitle('Critical update available');
await expect(notification).toBeHidden();
});
test('should handle API failure gracefully', async ({ n8n }) => {
// Enable notifications but mock API failure
await setupApiFailure(n8n);
await n8n.goHome();
const { projectId } = await n8n.projectComposer.createProject();
await n8n.page.goto(`projects/${projectId}/workflows`);
// Verify no security notification appears on API failure
const notification = n8n.notifications.getNotificationByTitle('Critical update available');
await expect(notification).toBeHidden();
// Verify the app still functions normally
await expect(n8n.workflows.getProjectName()).toBeVisible();
});
});
});
@@ -0,0 +1,72 @@
import { test, expect } from '../../../fixtures/base';
import type { TestRequirements } from '../../../Types';
const requirements: TestRequirements = {
config: {
settings: {
releaseChannel: 'stable',
versionCli: '1.0.0',
versionNotifications: {
enabled: true,
endpoint: 'https://api.n8n.io/api/versions/',
whatsNewEnabled: true,
whatsNewEndpoint: 'https://api.n8n.io/api/whats-new',
infoUrl: 'https://docs.n8n.io/getting-started/installation/updating.html',
},
},
},
intercepts: {
versions: {
url: '**/api/versions/**',
response: [
{
name: '1.0.0',
nodes: [],
createdAt: '2025-06-01T00:00:00Z',
description: 'Current version',
documentationUrl: 'https://docs.n8n.io',
hasBreakingChange: false,
hasSecurityFix: false,
hasSecurityIssue: false,
securityIssueFixVersion: '',
},
{
name: '1.0.1',
nodes: [],
createdAt: '2025-06-15T00:00:00Z',
description: 'Version 1.0.1',
documentationUrl: 'https://docs.n8n.io',
hasBreakingChange: false,
hasSecurityFix: false,
hasSecurityIssue: false,
securityIssueFixVersion: '',
},
{
name: '1.0.2',
nodes: [],
createdAt: '2025-06-30T00:00:00Z',
description: 'Version 1.0.2',
documentationUrl: 'https://docs.n8n.io',
hasBreakingChange: false,
hasSecurityFix: false,
hasSecurityIssue: false,
securityIssueFixVersion: '',
},
],
},
},
};
test.describe('Versions', {
annotation: [
{ type: 'owner', description: 'Adore' },
],
}, () => {
test('should show updates in help section', async ({ n8n, setupRequirements }) => {
await setupRequirements(requirements);
await n8n.goHome();
await n8n.sideBar.expand();
await n8n.sideBar.clickHelpMenuItem();
await expect(n8n.sideBar.getVersionUpdateItem()).toContainText('Update (2 versions behind)');
});
});