2023-01-27 01:18:15 -08:00
|
|
|
import {
|
|
|
|
CODE_NODE_NAME,
|
|
|
|
MANUAL_TRIGGER_NODE_NAME,
|
|
|
|
SCHEDULE_TRIGGER_NODE_NAME,
|
2023-09-19 03:16:35 -07:00
|
|
|
EDIT_FIELDS_SET_NODE_NAME,
|
2024-06-04 04:26:57 -07:00
|
|
|
NOTION_NODE_NAME,
|
2023-01-27 01:18:15 -08:00
|
|
|
} from '../constants';
|
2024-09-18 00:19:33 -07:00
|
|
|
import { WorkflowExecutionsTab } from '../pages';
|
|
|
|
import { errorToast, successToast } from '../pages/notifications';
|
2022-12-05 05:31:14 -08:00
|
|
|
import { WorkflowPage as WorkflowPageClass } from '../pages/workflow';
|
2023-06-27 04:05:20 -07:00
|
|
|
import { WorkflowsPage as WorkflowsPageClass } from '../pages/workflows';
|
2023-09-13 00:00:35 -07:00
|
|
|
import { getVisibleSelect } from '../utils';
|
2022-12-05 05:31:14 -08:00
|
|
|
|
|
|
|
const NEW_WORKFLOW_NAME = 'Something else';
|
2022-12-20 01:33:20 -08:00
|
|
|
const DUPLICATE_WORKFLOW_NAME = 'Duplicated workflow';
|
2023-01-27 01:18:15 -08:00
|
|
|
const DUPLICATE_WORKFLOW_TAG = 'Duplicate';
|
2022-12-05 05:31:14 -08:00
|
|
|
|
|
|
|
const WorkflowPage = new WorkflowPageClass();
|
2023-06-27 04:05:20 -07:00
|
|
|
const WorkflowPages = new WorkflowsPageClass();
|
2023-09-13 00:00:35 -07:00
|
|
|
const executionsTab = new WorkflowExecutionsTab();
|
2022-12-05 05:31:14 -08:00
|
|
|
|
|
|
|
describe('Workflow Actions', () => {
|
2023-02-24 09:07:35 -08:00
|
|
|
beforeEach(() => {
|
2022-12-05 05:31:14 -08:00
|
|
|
WorkflowPage.actions.visit();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should be able to save on button click', () => {
|
|
|
|
WorkflowPage.actions.saveWorkflowOnButtonClick();
|
|
|
|
WorkflowPage.getters.isWorkflowSaved();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should save workflow on keyboard shortcut', () => {
|
|
|
|
WorkflowPage.actions.saveWorkflowUsingKeyboardShortcut();
|
|
|
|
WorkflowPage.getters.isWorkflowSaved();
|
|
|
|
});
|
|
|
|
|
2024-06-11 02:12:12 -07:00
|
|
|
it('should not save already saved workflow', () => {
|
2024-06-10 07:00:21 -07:00
|
|
|
cy.intercept('PATCH', '/rest/workflows/*').as('saveWorkflow');
|
|
|
|
WorkflowPage.actions.saveWorkflowOnButtonClick();
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(MANUAL_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.saveWorkflowOnButtonClick();
|
|
|
|
cy.wait('@saveWorkflow');
|
|
|
|
WorkflowPage.getters.isWorkflowSaved();
|
|
|
|
// Try to save a few times
|
|
|
|
WorkflowPage.actions.saveWorkflowUsingKeyboardShortcut();
|
|
|
|
WorkflowPage.actions.saveWorkflowUsingKeyboardShortcut();
|
|
|
|
// Should be saved only once
|
|
|
|
cy.get('@saveWorkflow.all').should('have.length', 1);
|
|
|
|
});
|
|
|
|
|
2022-12-05 05:31:14 -08:00
|
|
|
it('should not be able to activate unsaved workflow', () => {
|
|
|
|
WorkflowPage.getters.activatorSwitch().find('input').first().should('be.disabled');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not be able to activate workflow without trigger node', () => {
|
|
|
|
// Manual trigger is not enough to activate the workflow
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(MANUAL_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.saveWorkflowOnButtonClick();
|
|
|
|
WorkflowPage.getters.activatorSwitch().find('input').first().should('be.disabled');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should be able to activate workflow', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.saveWorkflowOnButtonClick();
|
|
|
|
WorkflowPage.actions.activateWorkflow();
|
|
|
|
WorkflowPage.getters.isWorkflowActivated();
|
|
|
|
});
|
|
|
|
|
2024-06-04 04:26:57 -07:00
|
|
|
it('should not be be able to activate workflow when nodes have errors', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(NOTION_NODE_NAME);
|
|
|
|
WorkflowPage.actions.saveWorkflowOnButtonClick();
|
2024-06-11 01:23:30 -07:00
|
|
|
successToast().should('exist');
|
2024-06-04 04:26:57 -07:00
|
|
|
WorkflowPage.actions.clickWorkflowActivator();
|
2024-06-11 01:23:30 -07:00
|
|
|
errorToast().should('exist');
|
2024-06-04 04:26:57 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should be be able to activate workflow when nodes with errors are disabled', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(NOTION_NODE_NAME);
|
|
|
|
WorkflowPage.actions.saveWorkflowOnButtonClick();
|
2024-06-11 01:23:30 -07:00
|
|
|
successToast().should('exist');
|
2024-06-04 04:26:57 -07:00
|
|
|
// First, try to activate the workflow with errors
|
|
|
|
WorkflowPage.actions.clickWorkflowActivator();
|
2024-06-11 01:23:30 -07:00
|
|
|
errorToast().should('exist');
|
2024-06-04 04:26:57 -07:00
|
|
|
// Now, disable the node with errors
|
|
|
|
WorkflowPage.getters.canvasNodes().last().click();
|
|
|
|
WorkflowPage.actions.hitDisableNodeShortcut();
|
|
|
|
WorkflowPage.actions.activateWorkflow();
|
|
|
|
WorkflowPage.getters.isWorkflowActivated();
|
|
|
|
});
|
|
|
|
|
2022-12-05 05:31:14 -08:00
|
|
|
it('should save new workflow after renaming', () => {
|
|
|
|
WorkflowPage.actions.renameWorkflow(NEW_WORKFLOW_NAME);
|
|
|
|
WorkflowPage.getters.isWorkflowSaved();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should rename workflow', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.saveWorkflowOnButtonClick();
|
|
|
|
WorkflowPage.actions.renameWorkflow(NEW_WORKFLOW_NAME);
|
|
|
|
WorkflowPage.getters.isWorkflowSaved();
|
2022-12-15 07:39:59 -08:00
|
|
|
WorkflowPage.getters
|
|
|
|
.workflowNameInputContainer()
|
|
|
|
.invoke('attr', 'title')
|
|
|
|
.should('eq', NEW_WORKFLOW_NAME);
|
2022-12-05 05:31:14 -08:00
|
|
|
});
|
|
|
|
|
2023-06-27 04:05:20 -07:00
|
|
|
it('should not save workflow if canvas is loading', () => {
|
|
|
|
let interceptCalledCount = 0;
|
|
|
|
|
2023-07-28 00:51:07 -07:00
|
|
|
// There's no way in Cypress to check if intercept was not called
|
2023-06-27 04:05:20 -07:00
|
|
|
// so we'll count the number of times it was called
|
2023-07-28 00:51:07 -07:00
|
|
|
cy.intercept('PATCH', '/rest/workflows/*', () => {
|
|
|
|
interceptCalledCount++;
|
|
|
|
}).as('saveWorkflow');
|
2023-06-27 04:05:20 -07:00
|
|
|
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(MANUAL_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.saveWorkflowOnButtonClick();
|
|
|
|
cy.intercept(
|
|
|
|
{
|
|
|
|
url: '/rest/workflows/*',
|
|
|
|
method: 'GET',
|
|
|
|
middleware: true,
|
|
|
|
},
|
|
|
|
(req) => {
|
|
|
|
// Delay the response to give time for the save to be triggered
|
|
|
|
req.on('response', async (res) => {
|
2023-07-28 00:51:07 -07:00
|
|
|
await new Promise((resolve) => setTimeout(resolve, 2000));
|
2023-06-27 04:05:20 -07:00
|
|
|
res.send();
|
2023-07-28 00:51:07 -07:00
|
|
|
});
|
|
|
|
},
|
|
|
|
);
|
2023-06-27 04:05:20 -07:00
|
|
|
cy.reload();
|
|
|
|
cy.get('.el-loading-mask').should('exist');
|
2024-06-11 05:45:15 -07:00
|
|
|
WorkflowPage.actions.hitSaveWorkflow();
|
|
|
|
WorkflowPage.actions.hitSaveWorkflow();
|
|
|
|
WorkflowPage.actions.hitSaveWorkflow();
|
2023-06-27 04:05:20 -07:00
|
|
|
cy.wrap(null).then(() => expect(interceptCalledCount).to.eq(0));
|
2023-11-03 07:22:37 -07:00
|
|
|
cy.waitForLoad();
|
2023-06-27 04:05:20 -07:00
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
2024-06-11 05:45:15 -07:00
|
|
|
WorkflowPage.actions.hitSaveWorkflow();
|
2023-06-27 04:05:20 -07:00
|
|
|
cy.wait('@saveWorkflow');
|
|
|
|
cy.wrap(null).then(() => expect(interceptCalledCount).to.eq(1));
|
2023-07-28 00:51:07 -07:00
|
|
|
});
|
2024-04-04 00:59:02 -07:00
|
|
|
|
|
|
|
it('should not save workflow twice when save is in progress', () => {
|
|
|
|
// This happens when users click save button from workflow name input
|
|
|
|
// In this case blur on the input saves the workflow and then click on the button saves it again
|
|
|
|
WorkflowPage.actions.visit();
|
2024-04-18 22:50:18 -07:00
|
|
|
WorkflowPage.getters
|
|
|
|
.workflowNameInput()
|
|
|
|
.invoke('val')
|
|
|
|
.then((oldName) => {
|
|
|
|
WorkflowPage.getters.workflowNameInputContainer().click();
|
|
|
|
WorkflowPage.getters.workflowNameInput().type('{selectall}');
|
|
|
|
WorkflowPage.getters.workflowNameInput().type('Test');
|
|
|
|
WorkflowPage.getters.saveButton().click();
|
|
|
|
WorkflowPage.getters.workflowNameInput().should('have.value', 'Test');
|
|
|
|
cy.visit(WorkflowPages.url);
|
|
|
|
// There should be no workflow with the old name (duplicate save)
|
|
|
|
WorkflowPages.getters.workflowCards().contains(String(oldName)).should('not.exist');
|
|
|
|
});
|
2024-04-04 00:59:02 -07:00
|
|
|
});
|
|
|
|
|
2022-12-05 05:31:14 -08:00
|
|
|
it('should copy nodes', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
2022-12-14 01:33:44 -08:00
|
|
|
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
|
2022-12-07 09:16:38 -08:00
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 2);
|
|
|
|
|
2022-12-15 07:39:59 -08:00
|
|
|
cy.get('#node-creator').should('not.exist');
|
2024-06-11 05:45:15 -07:00
|
|
|
|
|
|
|
WorkflowPage.actions.hitSelectAll();
|
2022-12-07 09:16:38 -08:00
|
|
|
cy.get('.jtk-drag-selected').should('have.length', 2);
|
2024-06-11 05:45:15 -07:00
|
|
|
WorkflowPage.actions.hitCopy();
|
2024-06-11 01:23:30 -07:00
|
|
|
successToast().should('exist');
|
2022-12-05 05:31:14 -08:00
|
|
|
});
|
|
|
|
|
2024-01-26 06:09:50 -08:00
|
|
|
it('should paste nodes (both current and old node versions)', () => {
|
2022-12-15 07:39:59 -08:00
|
|
|
cy.fixture('Test_workflow-actions_paste-data.json').then((data) => {
|
2022-12-05 05:31:14 -08:00
|
|
|
cy.get('body').paste(JSON.stringify(data));
|
2024-01-26 06:09:50 -08:00
|
|
|
WorkflowPage.actions.zoomToFit();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.length', 5);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 5);
|
2022-12-05 05:31:14 -08:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2024-05-30 06:25:14 -07:00
|
|
|
it('should allow importing nodes without names', () => {
|
|
|
|
cy.fixture('Test_workflow-actions_import_nodes_empty_name.json').then((data) => {
|
|
|
|
cy.get('body').paste(JSON.stringify(data));
|
|
|
|
WorkflowPage.actions.zoomToFit();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.length', 3);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 2);
|
|
|
|
// Check if all nodes have names
|
|
|
|
WorkflowPage.getters.canvasNodes().each((node) => {
|
|
|
|
cy.wrap(node).should('have.attr', 'data-name');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2022-12-14 08:13:03 -08:00
|
|
|
it('should update workflow settings', () => {
|
2023-06-27 04:05:20 -07:00
|
|
|
cy.visit(WorkflowPages.url);
|
2024-06-04 04:26:57 -07:00
|
|
|
cy.intercept('GET', '/rest/workflows', (req) => {
|
|
|
|
req.on('response', (res) => {
|
|
|
|
const totalWorkflows = res.body.count ?? 0;
|
|
|
|
|
|
|
|
WorkflowPage.actions.visit();
|
|
|
|
// Open settings dialog
|
|
|
|
WorkflowPage.actions.saveWorkflowOnButtonClick();
|
|
|
|
WorkflowPage.getters.workflowMenu().should('be.visible');
|
|
|
|
WorkflowPage.getters.workflowMenu().click();
|
|
|
|
WorkflowPage.getters.workflowMenuItemSettings().should('be.visible');
|
|
|
|
WorkflowPage.getters.workflowMenuItemSettings().click();
|
|
|
|
// Change all settings
|
|
|
|
// totalWorkflows + 1 (current workflow) + 1 (no workflow option)
|
|
|
|
WorkflowPage.getters.workflowSettingsErrorWorkflowSelect().click();
|
|
|
|
getVisibleSelect()
|
|
|
|
.find('li')
|
|
|
|
.should('have.length', totalWorkflows + 2);
|
|
|
|
getVisibleSelect().find('li').last().click({ force: true });
|
|
|
|
WorkflowPage.getters.workflowSettingsTimezoneSelect().click();
|
|
|
|
getVisibleSelect().find('li').should('exist');
|
|
|
|
getVisibleSelect().find('li').eq(1).click({ force: true });
|
|
|
|
WorkflowPage.getters.workflowSettingsSaveFiledExecutionsSelect().click();
|
|
|
|
getVisibleSelect().find('li').should('have.length', 3);
|
|
|
|
getVisibleSelect().find('li').last().click({ force: true });
|
|
|
|
WorkflowPage.getters.workflowSettingsSaveSuccessExecutionsSelect().click();
|
|
|
|
getVisibleSelect().find('li').should('have.length', 3);
|
|
|
|
getVisibleSelect().find('li').last().click({ force: true });
|
|
|
|
WorkflowPage.getters.workflowSettingsSaveManualExecutionsSelect().click();
|
|
|
|
getVisibleSelect().find('li').should('have.length', 3);
|
|
|
|
getVisibleSelect().find('li').last().click({ force: true });
|
|
|
|
WorkflowPage.getters.workflowSettingsSaveExecutionProgressSelect().click();
|
|
|
|
getVisibleSelect().find('li').should('have.length', 3);
|
|
|
|
getVisibleSelect().find('li').last().click({ force: true });
|
|
|
|
WorkflowPage.getters.workflowSettingsTimeoutWorkflowSwitch().click();
|
|
|
|
WorkflowPage.getters.workflowSettingsTimeoutForm().find('input').first().type('1');
|
|
|
|
// Save settings
|
|
|
|
WorkflowPage.getters.workflowSettingsSaveButton().click();
|
|
|
|
WorkflowPage.getters.workflowSettingsModal().should('not.exist');
|
2024-06-11 01:23:30 -07:00
|
|
|
successToast().should('exist');
|
2024-06-04 04:26:57 -07:00
|
|
|
});
|
|
|
|
}).as('loadWorkflows');
|
2022-12-14 08:13:03 -08:00
|
|
|
});
|
2022-12-20 01:33:20 -08:00
|
|
|
|
|
|
|
it('should not be able to delete unsaved workflow', () => {
|
|
|
|
WorkflowPage.getters.workflowMenu().should('be.visible');
|
|
|
|
WorkflowPage.getters.workflowMenu().click();
|
2023-01-27 01:18:15 -08:00
|
|
|
WorkflowPage.getters.workflowMenuItemDelete().closest('li').should('have.class', 'is-disabled');
|
2022-12-20 01:33:20 -08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should delete workflow', () => {
|
|
|
|
WorkflowPage.actions.saveWorkflowOnButtonClick();
|
|
|
|
WorkflowPage.getters.workflowMenu().should('be.visible');
|
|
|
|
WorkflowPage.getters.workflowMenu().click();
|
|
|
|
WorkflowPage.getters.workflowMenuItemDelete().click();
|
|
|
|
cy.get('div[role=dialog][aria-modal=true]').should('be.visible');
|
|
|
|
cy.get('button.btn--confirm').should('be.visible').click();
|
2024-06-11 01:23:30 -07:00
|
|
|
successToast().should('exist');
|
2024-05-30 02:12:56 -07:00
|
|
|
cy.url().should('include', WorkflowPages.url);
|
2022-12-20 01:33:20 -08:00
|
|
|
});
|
|
|
|
|
2023-03-30 05:34:04 -07:00
|
|
|
describe('duplicate workflow', () => {
|
|
|
|
function duplicateWorkflow() {
|
|
|
|
WorkflowPage.getters.workflowMenu().should('be.visible');
|
|
|
|
WorkflowPage.getters.workflowMenu().click();
|
|
|
|
WorkflowPage.getters.workflowMenuItemDuplicate().click();
|
|
|
|
WorkflowPage.getters.duplicateWorkflowModal().should('be.visible');
|
|
|
|
WorkflowPage.getters.duplicateWorkflowModal().find('input').first().should('be.visible');
|
|
|
|
WorkflowPage.getters.duplicateWorkflowModal().find('input').first().type('{selectall}');
|
|
|
|
WorkflowPage.getters
|
|
|
|
.duplicateWorkflowModal()
|
|
|
|
.find('input')
|
|
|
|
.first()
|
|
|
|
.type(DUPLICATE_WORKFLOW_NAME);
|
|
|
|
WorkflowPage.getters
|
|
|
|
.duplicateWorkflowModal()
|
|
|
|
.find('.el-select__tags input')
|
|
|
|
.type(DUPLICATE_WORKFLOW_TAG);
|
|
|
|
WorkflowPage.getters.duplicateWorkflowModal().find('.el-select__tags input').type('{enter}');
|
2023-07-28 00:51:07 -07:00
|
|
|
WorkflowPage.getters.duplicateWorkflowModal().find('.el-select__tags input').type('{esc}');
|
2023-03-30 05:34:04 -07:00
|
|
|
WorkflowPage.getters
|
|
|
|
.duplicateWorkflowModal()
|
|
|
|
.find('button')
|
|
|
|
.contains('Duplicate')
|
|
|
|
.should('be.visible');
|
|
|
|
WorkflowPage.getters.duplicateWorkflowModal().find('button').contains('Duplicate').click();
|
2024-06-11 01:23:30 -07:00
|
|
|
errorToast().should('not.exist');
|
2023-03-30 05:34:04 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
// Stub window.open so new tab is not getting opened
|
|
|
|
cy.window().then((win) => {
|
|
|
|
cy.stub(win, 'open').as('open');
|
|
|
|
});
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(MANUAL_TRIGGER_NODE_NAME);
|
2023-01-27 01:18:15 -08:00
|
|
|
});
|
2022-12-20 01:33:20 -08:00
|
|
|
|
2023-03-30 05:34:04 -07:00
|
|
|
it('should duplicate unsaved workflow', () => {
|
|
|
|
duplicateWorkflow();
|
|
|
|
});
|
2023-05-26 08:15:06 -07:00
|
|
|
|
2023-03-30 05:34:04 -07:00
|
|
|
it('should duplicate saved workflow', () => {
|
|
|
|
WorkflowPage.actions.saveWorkflowOnButtonClick();
|
|
|
|
duplicateWorkflow();
|
|
|
|
});
|
2022-12-20 01:33:20 -08:00
|
|
|
});
|
2023-09-13 00:00:35 -07:00
|
|
|
|
|
|
|
it('should keep endpoint click working when switching between execution and editor tab', () => {
|
|
|
|
cy.intercept('GET', '/rest/executions?filter=*').as('getExecutions');
|
|
|
|
|
|
|
|
WorkflowPage.actions.addInitialNodeToCanvas(MANUAL_TRIGGER_NODE_NAME);
|
2023-09-19 03:16:35 -07:00
|
|
|
WorkflowPage.actions.addNodeToCanvas(EDIT_FIELDS_SET_NODE_NAME);
|
2023-09-13 00:00:35 -07:00
|
|
|
WorkflowPage.actions.saveWorkflowOnButtonClick();
|
|
|
|
|
2023-09-19 03:16:35 -07:00
|
|
|
WorkflowPage.getters.canvasNodePlusEndpointByName(EDIT_FIELDS_SET_NODE_NAME).click();
|
2023-09-13 00:00:35 -07:00
|
|
|
WorkflowPage.getters.nodeCreatorSearchBar().should('be.visible');
|
|
|
|
cy.get('body').type('{esc}');
|
|
|
|
|
|
|
|
executionsTab.actions.switchToExecutionsTab();
|
2024-04-18 22:50:18 -07:00
|
|
|
cy.wait(['@getExecutions']);
|
2023-09-13 00:00:35 -07:00
|
|
|
cy.wait(500);
|
|
|
|
executionsTab.actions.switchToEditorTab();
|
|
|
|
|
2023-09-19 03:16:35 -07:00
|
|
|
WorkflowPage.getters.canvasNodePlusEndpointByName(EDIT_FIELDS_SET_NODE_NAME).click();
|
2023-09-13 00:00:35 -07:00
|
|
|
WorkflowPage.getters.nodeCreatorSearchBar().should('be.visible');
|
|
|
|
});
|
2024-06-06 01:41:40 -07:00
|
|
|
|
|
|
|
it('should run workflow on button click', () => {
|
|
|
|
WorkflowPage.actions.addInitialNodeToCanvas(MANUAL_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.saveWorkflowOnButtonClick();
|
|
|
|
WorkflowPage.getters.executeWorkflowButton().click();
|
2024-06-11 01:23:30 -07:00
|
|
|
successToast().should('contain.text', 'Workflow executed successfully');
|
2024-06-06 01:41:40 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should run workflow using keyboard shortcut', () => {
|
|
|
|
WorkflowPage.actions.addInitialNodeToCanvas(MANUAL_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.saveWorkflowOnButtonClick();
|
2024-06-11 05:45:15 -07:00
|
|
|
WorkflowPage.actions.hitExecuteWorkflow();
|
2024-06-11 01:23:30 -07:00
|
|
|
successToast().should('contain.text', 'Workflow executed successfully');
|
2024-06-06 01:41:40 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should not run empty workflows', () => {
|
|
|
|
// Clear the canvas
|
2024-06-11 05:45:15 -07:00
|
|
|
WorkflowPage.actions.hitDeleteAllNodes();
|
2024-06-06 01:41:40 -07:00
|
|
|
WorkflowPage.getters.canvasNodes().should('have.length', 0);
|
|
|
|
// Button should be disabled
|
|
|
|
WorkflowPage.getters.executeWorkflowButton().should('be.disabled');
|
|
|
|
// Keyboard shortcut should not work
|
2024-06-11 05:45:15 -07:00
|
|
|
WorkflowPage.actions.hitExecuteWorkflow();
|
2024-06-11 01:23:30 -07:00
|
|
|
successToast().should('not.exist');
|
2024-06-06 01:41:40 -07:00
|
|
|
});
|
2022-12-05 05:31:14 -08:00
|
|
|
});
|
2023-11-21 06:20:15 -08:00
|
|
|
|
|
|
|
describe('Menu entry Push To Git', () => {
|
|
|
|
it('should not show up in the menu for members', () => {
|
2024-06-11 05:45:15 -07:00
|
|
|
cy.signinAsMember(0);
|
2023-11-21 06:20:15 -08:00
|
|
|
cy.visit(WorkflowPages.url);
|
|
|
|
WorkflowPage.actions.visit();
|
|
|
|
WorkflowPage.getters.workflowMenuItemGitPush().should('not.exist');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should show up for owners', () => {
|
2024-06-11 05:45:15 -07:00
|
|
|
cy.signinAsOwner();
|
2023-11-21 06:20:15 -08:00
|
|
|
cy.visit(WorkflowPages.url);
|
|
|
|
WorkflowPage.actions.visit();
|
|
|
|
WorkflowPage.getters.workflowMenuItemGitPush().should('exist');
|
|
|
|
});
|
|
|
|
});
|