diff --git a/cypress/e2e/34-template-credentials-setup.cy.ts b/cypress/e2e/34-template-credentials-setup.cy.ts index 386c83eb0a..8d372acac0 100644 --- a/cypress/e2e/34-template-credentials-setup.cy.ts +++ b/cypress/e2e/34-template-credentials-setup.cy.ts @@ -3,6 +3,7 @@ import * as formStep from '../composables/setup-template-form-step'; import { getSetupWorkflowCredentialsButton } from '../composables/setup-workflow-credentials-button'; import TestTemplate1 from '../fixtures/Test_Template_1.json'; import TestTemplate2 from '../fixtures/Test_Template_2.json'; +import { clearNotifications } from '../pages/notifications'; import { clickUseWorkflowButtonByTitle, visitTemplateCollectionPage, @@ -111,16 +112,19 @@ describe('Template credentials setup', () => { templateCredentialsSetupPage.fillInDummyCredentialsForAppWithConfirm('X (Formerly Twitter)'); templateCredentialsSetupPage.fillInDummyCredentialsForApp('Telegram'); + clearNotifications(); + templateCredentialsSetupPage.finishCredentialSetup(); workflowPage.getters.canvasNodes().should('have.length', 3); + cy.grantBrowserPermissions('clipboardReadWrite', 'clipboardSanitizedWrite'); + // Focus the canvas so the copy to clipboard works workflowPage.getters.canvasNodes().eq(0).realClick(); workflowPage.actions.hitSelectAll(); workflowPage.actions.hitCopy(); - cy.grantBrowserPermissions('clipboardReadWrite', 'clipboardSanitizedWrite'); // Check workflow JSON by copying it to clipboard cy.readClipboard().then((workflowJSON) => { const workflow = JSON.parse(workflowJSON); @@ -154,6 +158,8 @@ describe('Template credentials setup', () => { templateCredentialsSetupPage.fillInDummyCredentialsForApp('Email (IMAP)'); templateCredentialsSetupPage.fillInDummyCredentialsForApp('Nextcloud'); + clearNotifications(); + templateCredentialsSetupPage.finishCredentialSetup(); workflowPage.getters.canvasNodes().should('have.length', 3); @@ -176,6 +182,8 @@ describe('Template credentials setup', () => { templateCredentialsSetupPage.visitTemplateCredentialSetupPage(testTemplate.id); templateCredentialsSetupPage.fillInDummyCredentialsForApp('Shopify'); + clearNotifications(); + templateCredentialsSetupPage.finishCredentialSetup(); getSetupWorkflowCredentialsButton().should('be.visible'); @@ -192,6 +200,8 @@ describe('Template credentials setup', () => { templateCredentialsSetupPage.fillInDummyCredentialsForAppWithConfirm('X (Formerly Twitter)'); templateCredentialsSetupPage.fillInDummyCredentialsForApp('Telegram'); + clearNotifications(); + setupCredsModal.closeModalFromContinueButton(); setupCredsModal.getWorkflowCredentialsModal().should('not.exist'); diff --git a/cypress/pages/notifications.ts b/cypress/pages/notifications.ts index 162c536007..af2a51e369 100644 --- a/cypress/pages/notifications.ts +++ b/cypress/pages/notifications.ts @@ -13,5 +13,10 @@ export const infoToast = () => cy.get('.el-notification:has(.el-notification--in * Actions */ export const clearNotifications = () => { - successToast().find('.el-notification__closeBtn').click({ multiple: true }); + const buttons = successToast().find('.el-notification__closeBtn'); + buttons.then(($buttons) => { + if ($buttons.length) { + buttons.click({ multiple: true }); + } + }); }; diff --git a/packages/editor-ui/src/composables/__snapshots__/useCanvasOperations.test.ts.snap b/packages/editor-ui/src/composables/__snapshots__/useCanvasOperations.test.ts.snap index 079a5d2f51..821da444d4 100644 --- a/packages/editor-ui/src/composables/__snapshots__/useCanvasOperations.test.ts.snap +++ b/packages/editor-ui/src/composables/__snapshots__/useCanvasOperations.test.ts.snap @@ -29,7 +29,10 @@ exports[`useCanvasOperations > copyNodes > should copy nodes 1`] = ` } ], "connections": {}, - "pinData": {} + "pinData": {}, + "meta": { + "instanceId": "" + } }", ], ] @@ -64,7 +67,10 @@ exports[`useCanvasOperations > cutNodes > should copy and delete nodes 1`] = ` } ], "connections": {}, - "pinData": {} + "pinData": {}, + "meta": { + "instanceId": "" + } }", ], ] diff --git a/packages/editor-ui/src/composables/useCanvasOperations.ts b/packages/editor-ui/src/composables/useCanvasOperations.ts index 38db98fe01..dacac9cd2c 100644 --- a/packages/editor-ui/src/composables/useCanvasOperations.ts +++ b/packages/editor-ui/src/composables/useCanvasOperations.ts @@ -1887,6 +1887,12 @@ export function useCanvasOperations({ router }: { router: ReturnType await import('@/components/NodeDetailsView.vue'), ); +const LazySetupWorkflowCredentialsButton = defineAsyncComponent( + async () => + await import('@/components/SetupWorkflowCredentialsButton/SetupWorkflowCredentialsButton.vue'), +); + const $style = useCssModule(); const router = useRouter(); const route = useRoute(); @@ -1696,6 +1701,9 @@ onBeforeUnmount(() => { @viewport-change="onViewportChange" @drag-and-drop="onDragAndDrop" > + + +
{ } } +.setupCredentialsButtonWrapper { + position: absolute; + left: var(--spacing-s); + top: var(--spacing-s); +} + .readOnlyEnvironmentNotification { position: absolute; bottom: 16px;