From 2fe28ea0eeaf155ee01cf8ad48c9cd1ac58db7b2 Mon Sep 17 00:00:00 2001 From: Declan Carroll Date: Tue, 6 Oct 2026 13:20:30 +0000 Subject: [PATCH] test: Fix credential visibility timeouts on the coverage run (#40386) --- .../testing/playwright/playwright-projects.ts | 4 +- .../tests/e2e/sharing/access-control.spec.ts | 8 ++++ .../e2e/sharing/credential-visibility.spec.ts | 44 ------------------- 3 files changed, 11 insertions(+), 45 deletions(-) diff --git a/packages/quality/testing/playwright/playwright-projects.ts b/packages/quality/testing/playwright/playwright-projects.ts index 96d41eb48e2..a1d84ad3769 100644 --- a/packages/quality/testing/playwright/playwright-projects.ts +++ b/packages/quality/testing/playwright/playwright-projects.ts @@ -261,7 +261,9 @@ export function getProjects(): Project[] { projects.push({ name: 'coverage', testDir: './tests/e2e', - timeout: 60000, + // V8 collection adds per-test overhead (page load and fixture teardown), so + // UI tests that take ~30s elsewhere can take ~60s here. + timeout: 90_000, fullyParallel: true, use: { containerConfig: {}, diff --git a/packages/quality/testing/playwright/tests/e2e/sharing/access-control.spec.ts b/packages/quality/testing/playwright/tests/e2e/sharing/access-control.spec.ts index 619d67b8607..46e21a09750 100644 --- a/packages/quality/testing/playwright/tests/e2e/sharing/access-control.spec.ts +++ b/packages/quality/testing/playwright/tests/e2e/sharing/access-control.spec.ts @@ -113,6 +113,13 @@ test.describe( test('should enforce project isolation for team projects', async ({ n8n, api }) => { await api.setMaxTeamProjectsQuota(-1); + const personalCredName = `Personal Credential ${nanoid()}`; + await api.credentials.createCredential({ + name: personalCredName, + type: 'notionApi', + data: { apiKey: TEST_API_KEY }, + }); + const devProject = await api.projects.createProject(`Development ${nanoid()}`); const testProject = await api.projects.createProject(`Testing ${nanoid()}`); @@ -141,6 +148,7 @@ test.describe( await n8n.ndv.getNodeCredentialsSelect().click(); await expect(n8n.ndv.credentials.getOptionByText(testCredName)).toBeVisible(); + await expect(n8n.ndv.credentials.getOptionByText(personalCredName)).toBeHidden(); await expect(n8n.ndv.credentials.getOptionByText(devCredName)).toBeHidden(); }); diff --git a/packages/quality/testing/playwright/tests/e2e/sharing/credential-visibility.spec.ts b/packages/quality/testing/playwright/tests/e2e/sharing/credential-visibility.spec.ts index 67675066d0a..c296679e3f8 100644 --- a/packages/quality/testing/playwright/tests/e2e/sharing/credential-visibility.spec.ts +++ b/packages/quality/testing/playwright/tests/e2e/sharing/credential-visibility.spec.ts @@ -10,50 +10,6 @@ test.describe( annotation: [{ type: 'owner', description: 'Identity & Access' }], }, () => { - test('should only show credentials from the same team project', async ({ n8n, api }) => { - await n8n.navigate.toCredentials(); - const personalCredName = `Personal Credential ${nanoid()}`; - await n8n.credentialsComposer.createFromList( - 'Notion API', - { apiKey: TEST_API_KEY }, - { - name: personalCredName, - }, - ); - - const devProject = await n8n.projectComposer.createProject(`Development ${nanoid()}`); - await n8n.projectTabs.clickCredentialsTab(); - const devCredName = `Dev Credential ${nanoid()}`; - await n8n.credentialsComposer.createFromList( - 'Notion API', - { apiKey: TEST_API_KEY }, - { projectId: devProject.projectId, name: devCredName }, - ); - - const testProject = await api.projects.createProject(`Test ${nanoid()}`); - await n8n.navigate.toProject(testProject.id); - await n8n.projectTabs.clickCredentialsTab(); - const testCredName = `Test Credential ${nanoid()}`; - await n8n.credentialsComposer.createFromList( - 'Notion API', - { apiKey: TEST_API_KEY }, - { projectId: testProject.id, name: testCredName }, - ); - - await n8n.navigate.toProject(testProject.id); - await n8n.projectTabs.clickWorkflowsTab(); - await n8n.workflows.clickNewWorkflowButtonFromProject(); - await n8n.canvas.addNode('Manual Trigger'); - await n8n.canvas.addNode('Notion'); - await n8n.canvas.getFirstAction().click(); - - // Only test project credential should be visible - await n8n.ndv.getNodeCredentialsSelect().click(); - await expect(n8n.ndv.credentials.getOptionByText(testCredName)).toBeVisible(); - await expect(n8n.ndv.credentials.getOptionByText(personalCredName)).toBeHidden(); - await expect(n8n.ndv.credentials.getOptionByText(devCredName)).toBeHidden(); - }); - test('should show personal and shared credentials for members', async ({ n8n, api }) => { const member = await api.publicApi.createUser({ email: `member-${nanoid()}@test.com`,