From e6985f79dbdc87a35bcc0cad7a8c1e3b4ab2f830 Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Wed, 11 Dec 2024 12:12:47 +0200 Subject: [PATCH] test: Update `20-workflow-executions` e2e tests for new canvas (#12136) --- cypress/pages/workflow-executions-tab.ts | 6 ++++++ cypress/pages/workflow.ts | 2 +- packages/editor-ui/src/views/NodeView.v2.vue | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cypress/pages/workflow-executions-tab.ts b/cypress/pages/workflow-executions-tab.ts index 5e8c36c055..be022e6cdf 100644 --- a/cypress/pages/workflow-executions-tab.ts +++ b/cypress/pages/workflow-executions-tab.ts @@ -30,6 +30,12 @@ export class WorkflowExecutionsTab extends BasePage { actions = { toggleNodeEnabled: (nodeName: string) => { + cy.ifCanvasVersion( + () => {}, + () => { + cy.get('body').click(); // Cancel selection if it exists + }, + ); workflowPage.getters.canvasNodeByName(nodeName).click(); cy.get('body').type('d', { force: true }); }, diff --git a/cypress/pages/workflow.ts b/cypress/pages/workflow.ts index 8707783ca1..86af76189d 100644 --- a/cypress/pages/workflow.ts +++ b/cypress/pages/workflow.ts @@ -97,7 +97,7 @@ export class WorkflowPage extends BasePage { disabledNodes: () => cy.ifCanvasVersion( () => cy.get('.node-box.disabled'), - () => cy.get('[data-test-id="canvas-trigger-node"][class*="disabled"]'), + () => cy.get('[data-test-id*="node"][class*="disabled"]'), ), selectedNodes: () => cy.ifCanvasVersion( diff --git a/packages/editor-ui/src/views/NodeView.v2.vue b/packages/editor-ui/src/views/NodeView.v2.vue index e8a4c8b67f..65a141295e 100644 --- a/packages/editor-ui/src/views/NodeView.v2.vue +++ b/packages/editor-ui/src/views/NodeView.v2.vue @@ -1485,6 +1485,13 @@ function unregisterCustomActions() { unregisterCustomAction('showNodeCreator'); } +function showAddFirstStepIfEnabled() { + if (uiStore.addFirstStepOnLoad) { + void onOpenNodeCreatorForTriggerNodes(NODE_CREATOR_OPEN_SOURCES.TRIGGER_PLACEHOLDER_BUTTON); + uiStore.addFirstStepOnLoad = false; + } +} + /** * Routing */ @@ -1547,6 +1554,7 @@ onMounted(() => { onActivated(async () => { addUndoRedoEventBindings(); + showAddFirstStepIfEnabled(); }); onDeactivated(() => {