test: Fix credential visibility timeouts on the coverage run (#40386)

This commit is contained in:
Declan Carroll 2026-10-06 13:20:30 +00:00 committed by GitHub
parent c2f6920794
commit 2fe28ea0ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 45 deletions

View File

@ -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: {},

View File

@ -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();
});

View File

@ -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`,