Skip to content

Commit

Permalink
✅ Adding e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MiloradFilipovic committed May 27, 2024
1 parent dd10c9d commit a6dae64
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions cypress/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const AI_TOOL_CODE_NODE_NAME = 'Custom Code Tool';
export const AI_TOOL_WIKIPEDIA_NODE_NAME = 'Wikipedia';
export const AI_LANGUAGE_MODEL_OPENAI_CHAT_MODEL_NODE_NAME = 'OpenAI Chat Model';
export const AI_OUTPUT_PARSER_AUTO_FIXING_NODE_NAME = 'Auto-fixing Output Parser';
export const WEBHOOK_NODE_NAME = 'Webhook';

export const META_KEY = Cypress.platform === 'darwin' ? '{meta}' : '{ctrl}';

Expand Down
16 changes: 16 additions & 0 deletions cypress/e2e/7-workflow-actions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
EDIT_FIELDS_SET_NODE_NAME,
INSTANCE_MEMBERS,
INSTANCE_OWNER,
WEBHOOK_NODE_NAME,
} from '../constants';
import { WorkflowPage as WorkflowPageClass } from '../pages/workflow';
import { WorkflowsPage as WorkflowsPageClass } from '../pages/workflows';
Expand Down Expand Up @@ -251,6 +252,21 @@ describe('Workflow Actions', () => {
WorkflowPage.actions.saveWorkflowOnButtonClick();
duplicateWorkflow();
});

it('should update webhook path when duplicating workflow', () => {
WorkflowPage.actions.addNodeToCanvas(WEBHOOK_NODE_NAME);
WorkflowPage.actions.addNodeToCanvas(WEBHOOK_NODE_NAME);
// Activate original workflow
WorkflowPage.actions.activateWorkflow();
WorkflowPage.getters.isWorkflowActivated();
duplicateWorkflow();
cy.visit(WorkflowPages.url);
WorkflowPages.getters.workflowCards().contains(DUPLICATE_WORKFLOW_NAME).click();
// Activate duplicated workflow
WorkflowPage.actions.activateWorkflow();
// If webhooks are properly updated, this should pass
WorkflowPage.getters.isWorkflowActivated();
});
});

it('should keep endpoint click working when switching between execution and editor tab', () => {
Expand Down

0 comments on commit a6dae64

Please sign in to comment.