Skip to content

Commit

Permalink
✅ Adding loading handling logic and new workflow actions tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MiloradFilipovic committed Nov 24, 2022
1 parent 949d335 commit 8932ff4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
20 changes: 14 additions & 6 deletions cypress/e2e/4-workflow-actions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,30 @@ describe('Workflow Actions', () => {
})

cy.signin(username, password);
cy.visit(WorkflowPage.url);
});

it('should not be able to activate unsaved workflow', () => {
WorkflowPage.getters.activatorSwitch().find('input').first().should('be.disabled');
});

it('should be able to save on button slick', () => {
WorkflowPage.actions.visit();
WorkflowPage.actions.saveWorkflowOnButtonClick();
// In Element UI, disabled button turn into spans
WorkflowPage.getters.saveButton().should('match', 'span');
});

it('should save workflow on keyboard shortcut', () => {
cy.wait(2000);
WorkflowPage.actions.visit();
WorkflowPage.actions.saveWorkflowUsingKeyboardShortcut();
WorkflowPage.getters.saveButton().should('match', 'span');
});

it('should not be able to activate unsaved workflow', () => {
WorkflowPage.actions.visit();
WorkflowPage.getters.activatorSwitch().find('input').first().should('be.disabled');
});

it('should not be able to activate workflow without trigger node', () => {
WorkflowPage.actions.visit();
WorkflowPage.actions.saveWorkflowUsingKeyboardShortcut();
WorkflowPage.getters.activatorSwitch().find('input').first().should('be.disabled');
});

});
6 changes: 5 additions & 1 deletion cypress/pages/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ export class WorkflowPage extends BasePage {
saveButton: () => cy.getByTestId('wf-save-button').children().first(),
activatorSwitch: () => cy.getByTestId('wf-activate-switch'),
workflowMenu: () => cy.getByTestId('workflow-menu'),
nodeViewLoader: () => cy.getByTestId('node-view-loader'),
};
actions = {
visit: () => {
cy.visit(this.url);
cy.get('[data-test-id=node-view-loader]', { timeout: 5000 }).should('not.exist');
cy.get('.el-loading-mask', { timeout: 5000 }).should('not.exist');
},
openWorkflowMenu: () => {
this.getters.workflowMenu().click();
},
Expand Down

0 comments on commit 8932ff4

Please sign in to comment.