|
1 | | -import { test, expect } from '../../fixtures/base'; |
| 1 | +import { test, expect } from '../../../fixtures/base'; |
2 | 2 |
|
3 | 3 | const OWNER_EMAIL = '[email protected]'; |
4 | 4 | const ADMIN_EMAIL = '[email protected]'; |
@@ -302,172 +302,4 @@ test.describe('@isolated', () => { |
302 | 302 | ).toHaveCount(1); |
303 | 303 | }); |
304 | 304 | }); |
305 | | - |
306 | | - test.describe('Credential Usage in Cross Shared Workflows', () => { |
307 | | - test.beforeEach(async ({ n8n, api }) => { |
308 | | - await api.resetDatabase(); |
309 | | - await api.enableFeature('sharing'); |
310 | | - await api.enableFeature('advancedPermissions'); |
311 | | - await api.enableFeature('projectRole:admin'); |
312 | | - await api.enableFeature('projectRole:editor'); |
313 | | - await api.setMaxTeamProjectsQuota(-1); |
314 | | - |
315 | | - await n8n.api.signin('owner'); |
316 | | - await n8n.navigate.toCredentials(); |
317 | | - }); |
318 | | - |
319 | | - test('should only show credentials from the same team project', async ({ n8n }) => { |
320 | | - await n8n.credentialsComposer.createFromList('Notion API', { apiKey: 'test' }); |
321 | | - |
322 | | - const devProject = await n8n.projectComposer.createProject('Development'); |
323 | | - await n8n.projectTabs.clickCredentialsTab(); |
324 | | - await n8n.credentialsComposer.createFromList( |
325 | | - 'Notion API', |
326 | | - { apiKey: 'test' }, |
327 | | - { projectId: devProject.projectId }, |
328 | | - ); |
329 | | - |
330 | | - const testProject = await n8n.projectComposer.createProject('Test'); |
331 | | - await n8n.projectTabs.clickCredentialsTab(); |
332 | | - await n8n.credentialsComposer.createFromList( |
333 | | - 'Notion API', |
334 | | - { apiKey: 'test' }, |
335 | | - { projectId: testProject.projectId }, |
336 | | - ); |
337 | | - |
338 | | - await n8n.projectTabs.clickWorkflowsTab(); |
339 | | - await n8n.workflows.clickNewWorkflowCard(); |
340 | | - |
341 | | - await n8n.canvas.addNode('Notion'); |
342 | | - await n8n.canvas.getFirstAction().click(); |
343 | | - |
344 | | - // Only Test project credential visible |
345 | | - await n8n.ndv.getNodeCredentialsSelect().click(); |
346 | | - await expect(n8n.ndv.getVisiblePopper().locator('li')).toHaveCount(1); |
347 | | - }); |
348 | | - |
349 | | - test('should only show credentials in their personal project for members', async ({ n8n }) => { |
350 | | - await n8n.credentialsComposer.createFromList('Notion API', { apiKey: 'test' }); |
351 | | - |
352 | | - await n8n.navigate.toCredentials(); |
353 | | - await n8n.credentials.addResource.credential(); |
354 | | - await n8n.credentials.selectCredentialType('Notion API'); |
355 | | - await n8n.credentials.credentialModal.fillField('apiKey', 'test'); |
356 | | - await n8n.credentials.credentialModal.save(); |
357 | | - |
358 | | - await n8n.credentials.credentialModal.changeTab('Sharing'); |
359 | | - await n8n.credentials.credentialModal.addUserToSharing(MEMBER_0_EMAIL); |
360 | | - await n8n.credentials.credentialModal.saveSharing(); |
361 | | - await n8n.credentials.credentialModal.close(); |
362 | | - |
363 | | - await n8n.api.signin('member', 0); |
364 | | - await n8n.navigate.toCredentials(); |
365 | | - await n8n.credentialsComposer.createFromList('Notion API', { apiKey: 'test' }); |
366 | | - |
367 | | - await n8n.navigate.toWorkflow('new'); |
368 | | - |
369 | | - await n8n.canvas.addNode('Notion'); |
370 | | - await n8n.canvas.getFirstAction().click(); |
371 | | - |
372 | | - // Own credential and shared credential visible |
373 | | - await n8n.ndv.getNodeCredentialsSelect().click(); |
374 | | - await expect(n8n.ndv.getVisiblePopper().locator('li')).toHaveCount(2); |
375 | | - }); |
376 | | - |
377 | | - test('should only show credentials in their personal project for members if the workflow was shared with them', async ({ |
378 | | - n8n, |
379 | | - }) => { |
380 | | - const workflowName = 'Test workflow'; |
381 | | - |
382 | | - await n8n.credentialsComposer.createFromList('Notion API', { apiKey: 'test' }); |
383 | | - |
384 | | - await n8n.navigate.toWorkflow('new'); |
385 | | - await n8n.canvas.setWorkflowName(workflowName); |
386 | | - await n8n.page.keyboard.press('Enter'); |
387 | | - await n8n.canvas.openShareModal(); |
388 | | - await n8n.workflowSharingModal.addUser(MEMBER_0_EMAIL); |
389 | | - await n8n.workflowSharingModal.save(); |
390 | | - |
391 | | - await n8n.api.signin('member', 0); |
392 | | - await n8n.navigate.toCredentials(); |
393 | | - await n8n.credentialsComposer.createFromList('Notion API', { apiKey: 'test' }); |
394 | | - |
395 | | - await n8n.navigate.toWorkflows(); |
396 | | - await n8n.workflows.cards.getWorkflow(workflowName).click(); |
397 | | - |
398 | | - await n8n.canvas.addNode('Notion'); |
399 | | - await n8n.canvas.getFirstAction().click(); |
400 | | - |
401 | | - // Only own credential visible (not owner's) |
402 | | - await n8n.ndv.getNodeCredentialsSelect().click(); |
403 | | - await expect(n8n.ndv.getVisiblePopper().locator('li')).toHaveCount(1); |
404 | | - }); |
405 | | - |
406 | | - test("should show all credentials from all personal projects the workflow's been shared into for the global owner", async ({ |
407 | | - n8n, |
408 | | - }) => { |
409 | | - const workflowName = 'Test workflow'; |
410 | | - |
411 | | - await n8n.api.signin('member', 1); |
412 | | - await n8n.navigate.toCredentials(); |
413 | | - await n8n.credentials.addResource.credential(); |
414 | | - await n8n.credentials.selectCredentialType('Notion API'); |
415 | | - await n8n.credentials.credentialModal.fillField('apiKey', 'test'); |
416 | | - await n8n.credentials.credentialModal.save(); |
417 | | - await n8n.credentials.credentialModal.close(); |
418 | | - |
419 | | - await n8n.api.signin('admin'); |
420 | | - await n8n.navigate.toCredentials(); |
421 | | - await n8n.credentials.addResource.credential(); |
422 | | - await n8n.credentials.selectCredentialType('Notion API'); |
423 | | - await n8n.credentials.credentialModal.fillField('apiKey', 'test'); |
424 | | - await n8n.credentials.credentialModal.save(); |
425 | | - await n8n.credentials.credentialModal.close(); |
426 | | - |
427 | | - await n8n.api.signin('member', 0); |
428 | | - await n8n.navigate.toCredentials(); |
429 | | - await n8n.credentialsComposer.createFromList('Notion API', { apiKey: 'test' }); |
430 | | - await n8n.navigate.toWorkflow('new'); |
431 | | - await n8n.canvas.setWorkflowName(workflowName); |
432 | | - await n8n.page.keyboard.press('Enter'); |
433 | | - await n8n.canvas.openShareModal(); |
434 | | - await n8n.workflowSharingModal.addUser(OWNER_EMAIL); |
435 | | - await n8n.workflowSharingModal.addUser(ADMIN_EMAIL); |
436 | | - await n8n.workflowSharingModal.save(); |
437 | | - |
438 | | - await n8n.api.signin('owner'); |
439 | | - await n8n.navigate.toCredentials(); |
440 | | - await n8n.credentialsComposer.createFromList('Notion API', { apiKey: 'test' }); |
441 | | - await n8n.navigate.toWorkflows(); |
442 | | - await n8n.workflows.cards.getWorkflow(workflowName).click(); |
443 | | - |
444 | | - await n8n.canvas.addNode('Notion'); |
445 | | - await n8n.canvas.getFirstAction().click(); |
446 | | - |
447 | | - // Owner sees 3 credentials: admin's, U2's, owner's |
448 | | - await n8n.ndv.getNodeCredentialsSelect().click(); |
449 | | - await expect(n8n.ndv.getVisiblePopper().locator('li')).toHaveCount(3); |
450 | | - }); |
451 | | - |
452 | | - test('should show all personal credentials if the global owner owns the workflow', async ({ |
453 | | - n8n, |
454 | | - }) => { |
455 | | - await n8n.api.signin('member', 0); |
456 | | - await n8n.navigate.toCredentials(); |
457 | | - await n8n.credentials.addResource.credential(); |
458 | | - await n8n.credentials.selectCredentialType('Notion API'); |
459 | | - await n8n.credentials.credentialModal.fillField('apiKey', 'test'); |
460 | | - await n8n.credentials.credentialModal.save(); |
461 | | - await n8n.credentials.credentialModal.close(); |
462 | | - |
463 | | - await n8n.api.signin('owner'); |
464 | | - await n8n.navigate.toWorkflow('new'); |
465 | | - await n8n.canvas.addNode('Notion'); |
466 | | - await n8n.canvas.getFirstAction().click(); |
467 | | - |
468 | | - // Owner sees member's credential (global owner privilege) |
469 | | - await n8n.ndv.getNodeCredentialsSelect().click(); |
470 | | - await expect(n8n.ndv.getVisiblePopper().locator('li')).toHaveCount(1); |
471 | | - }); |
472 | | - }); |
473 | 305 | }); |
0 commit comments