test: Setup e2e tests for workflow actions (#4724)

*  Adding first batch of workflow actions tests
*  Adding loading handling logic and new workflow actions tests
*  Added workflow activation and rename tests
* 👌 Addressing review feedback
* 🔥 Removing leftover commented code
This commit is contained in:
Milorad FIlipović
2022-11-25 15:32:09 +01:00
committed by GitHub
parent 1579d05fd1
commit cb3bfc32f7
8 changed files with 116 additions and 13 deletions

View File

@@ -3,13 +3,10 @@ import { BasePage } from './base';
export class WorkflowPage extends BasePage {
url = '/workflow/new';
getters = {
workflowNameInput: () =>
cy
.getByTestId('workflow-name-input', { timeout: 5000 })
.then(($el) => cy.wrap($el.find('input'))),
workflowNameInput: () => cy.getByTestId('workflow-name-input'),
workflowImportInput: () => cy.getByTestId('workflow-import-input'),
workflowTags: () => cy.getByTestId('workflow-tags'),
saveButton: () => cy.getByTestId('save-button'),
saveButton: () => cy.getByTestId('workflow-save-button'),
nodeCreatorSearchBar: () => cy.getByTestId('node-creator-search-bar'),
nodeCreatorPlusButton: () => cy.getByTestId('node-creator-plus-button'),
@@ -24,6 +21,9 @@ export class WorkflowPage extends BasePage {
ndvParameterInput: (parameterName: string) =>
cy.getByTestId(`parameter-input-${parameterName}`),
ndvOutputPanel: () => cy.getByTestId('output-panel'),
activatorSwitch: () => cy.getByTestId('workflow-activate-switch'),
workflowMenu: () => cy.getByTestId('workflow-menu'),
firstStepButton: () => cy.getByTestId('canvas-add-button'),
};
actions = {
@@ -46,5 +46,30 @@ export class WorkflowPage extends BasePage {
executeNodeFromNdv: () => {
cy.contains('Execute node').click();
},
visit: () => {
cy.visit(this.url);
cy.getByTestId('node-view-loader', { timeout: 5000 }).should('not.exist');
cy.get('.el-loading-mask', { timeout: 5000 }).should('not.exist');
},
openWorkflowMenu: () => {
this.getters.workflowMenu().click();
},
saveWorkflowOnButtonClick: () => {
this.getters.saveButton().click();
},
saveWorkflowUsingKeyboardShortcut: () => {
cy.get('body').type('{meta}', { release: false }).type('s');
},
activateWorkflow: () => {
this.getters.activatorSwitch().find('input').first().should('be.enabled');
this.getters.activatorSwitch().click();
cy.get('body').type('{esc}');
},
renameWorkflow: (newName: string) => {
this.getters.workflowNameInput().click();
cy.get('body').type('{selectall}');
cy.get('body').type(newName);
cy.get('body').type('{enter}');
},
};
}