2023-09-19 03:16:35 -07:00
|
|
|
import { CODE_NODE_NAME, SET_NODE_NAME, EDIT_FIELDS_SET_NODE_NAME } from './../constants';
|
2022-12-14 01:33:44 -08:00
|
|
|
import { SCHEDULE_TRIGGER_NODE_NAME } from '../constants';
|
|
|
|
import { WorkflowPage as WorkflowPageClass } from '../pages/workflow';
|
2023-01-18 06:48:36 -08:00
|
|
|
import { NDV } from '../pages/ndv';
|
2022-12-14 01:33:44 -08:00
|
|
|
|
|
|
|
// Suite-specific constants
|
|
|
|
const CODE_NODE_NEW_NAME = 'Something else';
|
|
|
|
|
|
|
|
const WorkflowPage = new WorkflowPageClass();
|
2023-01-18 06:48:36 -08:00
|
|
|
const ndv = new NDV();
|
2022-12-14 01:33:44 -08:00
|
|
|
|
|
|
|
describe('Undo/Redo', () => {
|
2023-02-24 09:07:35 -08:00
|
|
|
beforeEach(() => {
|
2022-12-14 01:33:44 -08:00
|
|
|
WorkflowPage.actions.visit();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should undo/redo adding nodes', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.hitUndo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 0);
|
|
|
|
WorkflowPage.actions.hitRedo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 1);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should undo/redo adding connected nodes', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
|
|
|
|
WorkflowPage.actions.hitUndo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 1);
|
|
|
|
WorkflowPage.actions.hitRedo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 2);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 1);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should undo/redo adding node in the middle', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
|
2023-02-24 09:07:35 -08:00
|
|
|
WorkflowPage.actions.addNodeBetweenNodes(
|
|
|
|
SCHEDULE_TRIGGER_NODE_NAME,
|
|
|
|
CODE_NODE_NAME,
|
|
|
|
SET_NODE_NAME,
|
|
|
|
);
|
2022-12-14 01:33:44 -08:00
|
|
|
WorkflowPage.actions.zoomToFit();
|
2023-08-02 03:48:55 -07:00
|
|
|
WorkflowPage.getters
|
|
|
|
.canvasNodeByName('Code')
|
2023-10-25 05:34:47 -07:00
|
|
|
.should('have.css', 'left', '860px')
|
|
|
|
.should('have.css', 'top', '220px')
|
|
|
|
|
2023-08-02 03:48:55 -07:00
|
|
|
WorkflowPage.actions.hitUndo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 2);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 1);
|
2022-12-14 01:33:44 -08:00
|
|
|
WorkflowPage.actions.hitUndo();
|
2023-08-02 03:48:55 -07:00
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 1);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 0);
|
|
|
|
WorkflowPage.actions.hitRedo();
|
2023-02-06 07:33:59 -08:00
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 2);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 1);
|
|
|
|
WorkflowPage.actions.hitRedo();
|
2022-12-14 01:33:44 -08:00
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 3);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 2);
|
2023-08-02 03:48:55 -07:00
|
|
|
// Last node should be added back to original position
|
|
|
|
WorkflowPage.getters
|
|
|
|
.canvasNodeByName('Code')
|
2023-10-25 05:34:47 -07:00
|
|
|
.should('have.css', 'left', '860px')
|
|
|
|
.should('have.css', 'top', '220px')
|
2022-12-14 01:33:44 -08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should undo/redo deleting node using delete button', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
|
2022-12-15 07:39:59 -08:00
|
|
|
WorkflowPage.getters
|
|
|
|
.canvasNodeByName(CODE_NODE_NAME)
|
|
|
|
.find('[data-test-id=delete-node-button]')
|
|
|
|
.click({ force: true });
|
2022-12-14 01:33:44 -08:00
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 1);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 0);
|
|
|
|
WorkflowPage.actions.hitUndo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 2);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 1);
|
|
|
|
WorkflowPage.actions.hitRedo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 1);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 0);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should undo/redo deleting node using keyboard shortcut', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
|
|
|
|
WorkflowPage.getters.canvasNodeByName(CODE_NODE_NAME).click();
|
|
|
|
cy.get('body').type('{backspace}');
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 1);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 0);
|
|
|
|
WorkflowPage.actions.hitUndo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 2);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 1);
|
|
|
|
WorkflowPage.actions.hitRedo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 1);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 0);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should undo/redo deleting node between two connected nodes', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SET_NODE_NAME);
|
|
|
|
WorkflowPage.getters.canvasNodeByName(CODE_NODE_NAME).click();
|
|
|
|
WorkflowPage.actions.zoomToFit();
|
|
|
|
cy.get('body').type('{backspace}');
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 2);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 1);
|
|
|
|
WorkflowPage.actions.hitUndo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 3);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 2);
|
|
|
|
WorkflowPage.actions.hitRedo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 2);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 1);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should undo/redo deleting whole workflow', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
|
|
|
|
cy.get('body').type('{esc}');
|
|
|
|
cy.get('body').type('{esc}');
|
|
|
|
WorkflowPage.actions.selectAll();
|
|
|
|
cy.get('body').type('{backspace}');
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 0);
|
|
|
|
WorkflowPage.actions.hitUndo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 2);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 1);
|
|
|
|
WorkflowPage.actions.hitRedo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 0);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 0);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should undo/redo moving nodes', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
|
2023-08-02 03:48:55 -07:00
|
|
|
cy.drag('[data-test-id="canvas-node"].jtk-drag-selected', [50, 150], { clickToFinish: true });
|
2022-12-15 07:39:59 -08:00
|
|
|
WorkflowPage.getters
|
2023-07-28 00:51:07 -07:00
|
|
|
.canvasNodeByName('Code')
|
2023-10-25 05:34:47 -07:00
|
|
|
.should('have.css', 'left', '740px')
|
|
|
|
.should('have.css', 'top', '320px')
|
|
|
|
|
2022-12-14 01:33:44 -08:00
|
|
|
WorkflowPage.actions.hitUndo();
|
2022-12-15 07:39:59 -08:00
|
|
|
WorkflowPage.getters
|
2023-07-28 00:51:07 -07:00
|
|
|
.canvasNodeByName('Code')
|
2023-10-25 05:34:47 -07:00
|
|
|
.should('have.css', 'left', '640px')
|
|
|
|
.should('have.css', 'top', '220px')
|
2022-12-14 01:33:44 -08:00
|
|
|
WorkflowPage.actions.hitRedo();
|
2022-12-15 07:39:59 -08:00
|
|
|
WorkflowPage.getters
|
2023-07-28 00:51:07 -07:00
|
|
|
.canvasNodeByName('Code')
|
2023-10-25 05:34:47 -07:00
|
|
|
.should('have.css', 'left', '740px')
|
|
|
|
.should('have.css', 'top', '320px')
|
2022-12-14 01:33:44 -08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should undo/redo deleting a connection by pressing delete button', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
|
2023-01-30 09:20:50 -08:00
|
|
|
WorkflowPage.getters.nodeConnections().realHover();
|
2023-07-28 00:51:07 -07:00
|
|
|
cy.get('.connection-actions .delete')
|
|
|
|
.filter(':visible')
|
|
|
|
.should('be.visible')
|
|
|
|
.click({ force: true });
|
2022-12-14 01:33:44 -08:00
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 0);
|
|
|
|
WorkflowPage.actions.hitUndo();
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 1);
|
|
|
|
WorkflowPage.actions.hitRedo();
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 0);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should undo/redo deleting a connection by moving it away', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
|
2023-02-06 20:47:37 -08:00
|
|
|
cy.drag('.rect-input-endpoint.jtk-endpoint-connected', [0, -100]);
|
2022-12-14 01:33:44 -08:00
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 0);
|
|
|
|
WorkflowPage.actions.hitUndo();
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 1);
|
|
|
|
WorkflowPage.actions.hitRedo();
|
2022-12-15 07:39:59 -08:00
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 0);
|
2022-12-14 01:33:44 -08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should undo/redo disabling a node using disable button', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
|
2022-12-15 07:39:59 -08:00
|
|
|
WorkflowPage.getters
|
|
|
|
.canvasNodes()
|
|
|
|
.last()
|
|
|
|
.find('[data-test-id="disable-node-button"]')
|
|
|
|
.click({ force: true });
|
2022-12-14 01:33:44 -08:00
|
|
|
WorkflowPage.getters.disabledNodes().should('have.length', 1);
|
|
|
|
WorkflowPage.actions.hitUndo();
|
|
|
|
WorkflowPage.getters.disabledNodes().should('have.length', 0);
|
|
|
|
WorkflowPage.actions.hitRedo();
|
|
|
|
WorkflowPage.getters.disabledNodes().should('have.length', 1);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should undo/redo disabling a node using keyboard shortcut', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
|
|
|
|
WorkflowPage.getters.canvasNodes().last().click();
|
|
|
|
WorkflowPage.actions.hitDisableNodeShortcut();
|
|
|
|
WorkflowPage.getters.disabledNodes().should('have.length', 1);
|
|
|
|
WorkflowPage.actions.hitUndo();
|
|
|
|
WorkflowPage.getters.disabledNodes().should('have.length', 0);
|
|
|
|
WorkflowPage.actions.hitRedo();
|
|
|
|
WorkflowPage.getters.disabledNodes().should('have.length', 1);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should undo/redo disabling multiple nodes', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
|
|
|
|
cy.get('body').type('{esc}');
|
|
|
|
cy.get('body').type('{esc}');
|
|
|
|
WorkflowPage.actions.selectAll();
|
|
|
|
WorkflowPage.actions.hitDisableNodeShortcut();
|
|
|
|
WorkflowPage.getters.disabledNodes().should('have.length', 2);
|
|
|
|
WorkflowPage.actions.hitUndo();
|
|
|
|
WorkflowPage.getters.disabledNodes().should('have.length', 0);
|
|
|
|
WorkflowPage.actions.hitRedo();
|
|
|
|
WorkflowPage.getters.disabledNodes().should('have.length', 2);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should undo/redo renaming node using NDV', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
|
|
|
|
WorkflowPage.getters.canvasNodes().last().click();
|
|
|
|
cy.get('body').type('{enter}');
|
2023-01-18 06:48:36 -08:00
|
|
|
ndv.actions.rename(CODE_NODE_NEW_NAME);
|
2022-12-14 01:33:44 -08:00
|
|
|
cy.get('body').type('{esc}');
|
|
|
|
WorkflowPage.actions.hitUndo();
|
|
|
|
cy.get('body').type('{esc}');
|
|
|
|
WorkflowPage.getters.canvasNodeByName(CODE_NODE_NAME).should('exist');
|
|
|
|
WorkflowPage.actions.hitRedo();
|
|
|
|
cy.get('body').type('{esc}');
|
|
|
|
WorkflowPage.getters.canvasNodeByName(CODE_NODE_NEW_NAME).should('exist');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should undo/redo renaming node using keyboard shortcut', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
|
|
|
|
WorkflowPage.getters.canvasNodes().last().click();
|
2022-12-15 07:39:59 -08:00
|
|
|
cy.get('body').trigger('keydown', { key: 'F2' });
|
2022-12-14 01:33:44 -08:00
|
|
|
cy.get('.rename-prompt').should('be.visible');
|
|
|
|
cy.get('body').type(CODE_NODE_NEW_NAME);
|
|
|
|
cy.get('body').type('{enter}');
|
|
|
|
WorkflowPage.actions.hitUndo();
|
|
|
|
cy.get('body').type('{esc}');
|
|
|
|
WorkflowPage.getters.canvasNodeByName(CODE_NODE_NAME).should('exist');
|
|
|
|
WorkflowPage.actions.hitRedo();
|
|
|
|
cy.get('body').type('{esc}');
|
|
|
|
WorkflowPage.getters.canvasNodeByName(CODE_NODE_NEW_NAME).should('exist');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should undo/redo duplicating a node', () => {
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
|
2022-12-15 07:39:59 -08:00
|
|
|
WorkflowPage.getters
|
|
|
|
.canvasNodes()
|
|
|
|
.last()
|
|
|
|
.find('[data-test-id="duplicate-node-button"]')
|
|
|
|
.click({ force: true });
|
2022-12-14 01:33:44 -08:00
|
|
|
WorkflowPage.actions.hitUndo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.length', 2);
|
|
|
|
WorkflowPage.actions.hitRedo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.length', 3);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should undo/redo pasting nodes', () => {
|
2022-12-15 07:39:59 -08:00
|
|
|
cy.fixture('Test_workflow-actions_paste-data.json').then((data) => {
|
2022-12-14 01:33:44 -08:00
|
|
|
cy.get('body').paste(JSON.stringify(data));
|
|
|
|
WorkflowPage.actions.zoomToFit();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 2);
|
|
|
|
WorkflowPage.actions.hitUndo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 0);
|
|
|
|
WorkflowPage.actions.hitRedo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.have.length', 2);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should undo/redo multiple steps', () => {
|
2023-10-25 05:34:47 -07:00
|
|
|
const initialPosition = {left: '420px', top: '220px'};
|
|
|
|
const movedPosition = {left: '540px', top: '360px'};
|
2023-07-28 00:51:07 -07:00
|
|
|
|
2022-12-15 07:39:59 -08:00
|
|
|
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
|
2023-09-19 03:16:35 -07:00
|
|
|
// WorkflowPage.actions.addNodeToCanvas(SET_NODE_NAME);
|
|
|
|
WorkflowPage.actions.addNodeToCanvas(EDIT_FIELDS_SET_NODE_NAME);
|
2022-12-15 07:39:59 -08:00
|
|
|
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
|
|
|
|
WorkflowPage.actions.zoomToFit();
|
2022-12-14 01:33:44 -08:00
|
|
|
|
2022-12-15 07:39:59 -08:00
|
|
|
// Disable last node
|
|
|
|
WorkflowPage.getters.canvasNodes().last().click();
|
|
|
|
WorkflowPage.actions.hitDisableNodeShortcut();
|
|
|
|
// Move first one
|
2023-10-25 05:34:47 -07:00
|
|
|
WorkflowPage.getters.canvasNodes()
|
|
|
|
.first()
|
|
|
|
.should('have.css', 'left', initialPosition.left)
|
|
|
|
.should('have.css', 'top', initialPosition.top)
|
|
|
|
|
2022-12-15 07:39:59 -08:00
|
|
|
WorkflowPage.getters.canvasNodes().first().click();
|
2023-08-02 03:48:55 -07:00
|
|
|
cy.drag('[data-test-id="canvas-node"].jtk-drag-selected', [50, 150], { clickToFinish: true });
|
2023-10-25 05:34:47 -07:00
|
|
|
WorkflowPage.getters.canvasNodes()
|
|
|
|
.first()
|
|
|
|
.should('have.css', 'left', movedPosition.left)
|
|
|
|
.should('have.css', 'top', movedPosition.top)
|
2022-12-15 07:39:59 -08:00
|
|
|
// Delete the set node
|
2023-09-19 03:16:35 -07:00
|
|
|
WorkflowPage.getters.canvasNodeByName(EDIT_FIELDS_SET_NODE_NAME).click().click();
|
2022-12-15 07:39:59 -08:00
|
|
|
cy.get('body').type('{backspace}');
|
2022-12-14 01:33:44 -08:00
|
|
|
|
2022-12-15 07:39:59 -08:00
|
|
|
// First undo: Should return deleted node
|
|
|
|
WorkflowPage.actions.hitUndo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.length', 4);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 3);
|
|
|
|
// Second undo: Should move first node to it's original position
|
|
|
|
WorkflowPage.actions.hitUndo();
|
2023-10-25 05:34:47 -07:00
|
|
|
WorkflowPage.getters.canvasNodes()
|
|
|
|
.first()
|
|
|
|
.should('have.css', 'left', initialPosition.left)
|
|
|
|
.should('have.css', 'top', initialPosition.top)
|
2022-12-15 07:39:59 -08:00
|
|
|
// Third undo: Should enable last node
|
|
|
|
WorkflowPage.actions.hitUndo();
|
|
|
|
WorkflowPage.getters.disabledNodes().should('have.length', 0);
|
2022-12-14 01:33:44 -08:00
|
|
|
|
2022-12-15 07:39:59 -08:00
|
|
|
// First redo: Should disable last node
|
|
|
|
WorkflowPage.actions.hitRedo();
|
|
|
|
WorkflowPage.getters.disabledNodes().should('have.length', 1);
|
|
|
|
// Second redo: Should move the first node
|
|
|
|
WorkflowPage.actions.hitRedo();
|
2023-10-25 05:34:47 -07:00
|
|
|
WorkflowPage.getters.canvasNodes()
|
|
|
|
.first()
|
|
|
|
.should('have.css', 'left', movedPosition.left)
|
|
|
|
.should('have.css', 'top', movedPosition.top)
|
2022-12-15 07:39:59 -08:00
|
|
|
// Third redo: Should delete the Set node
|
|
|
|
WorkflowPage.actions.hitRedo();
|
|
|
|
WorkflowPage.getters.canvasNodes().should('have.length', 3);
|
|
|
|
WorkflowPage.getters.nodeConnections().should('have.length', 2);
|
|
|
|
});
|
2022-12-14 01:33:44 -08:00
|
|
|
});
|