test: Add stickies tests (#5413)

* test: Add tests for stickies

* test: add sticky basic test

* test: add size dragging tests

* test: add delete sticky test

* test: add editing test

* test: update editing text

* test: add expansion tests

* test: add more tests

* test: clean up tests

* refactor: update dragging tests to make sense

* refactor: upate drag right test

* test: add shrink from right test

* test: refactor some more

* test: fix all tests

* test: clean up

* test: update number

* test: add z-index tests

* test: address comments

* test: fix mistake

* test: wait on save

* test: try button instead
This commit is contained in:
Mutasem Aldmour
2023-04-21 15:37:09 +02:00
committed by GitHub
parent dc2a7a307a
commit 649389edad
6 changed files with 299 additions and 7 deletions

View File

@@ -106,6 +106,8 @@ export class WorkflowPage extends BasePage {
cy.get(
`.connection-actions[data-source-node="${sourceNodeName}"][data-target-node="${targetNodeName}"]`,
),
addStickyButton: () => cy.getByTestId('add-sticky-button'),
stickies: () => cy.getByTestId('sticky'),
editorTabButton: () => cy.getByTestId('radio-button-workflow'),
};
actions = {
@@ -167,11 +169,13 @@ export class WorkflowPage extends BasePage {
this.getters.shareButton().click();
},
saveWorkflowOnButtonClick: () => {
cy.intercept('POST', '/rest/workflows').as('createWorkflow');
this.getters.saveButton().should('contain', 'Save');
this.getters.saveButton().click();
this.getters.saveButton().should('contain', 'Saved');
},
saveWorkflowUsingKeyboardShortcut: () => {
cy.intercept('POST', '/rest/workflows').as('createWorkflow');
cy.get('body').type('{meta}', { release: false }).type('s');
},
deleteNode: (name: string) => {
@@ -257,6 +261,24 @@ export class WorkflowPage extends BasePage {
.first()
.click({ force: true });
},
addSticky: () => {
this.getters.nodeCreatorPlusButton().realHover();
this.getters.addStickyButton().click();
},
deleteSticky: () => {
this.getters.stickies().eq(0)
.realHover()
.find('[data-test-id="delete-sticky"]')
.click();
},
editSticky: (content: string) => {
this.getters.stickies()
.dblclick()
.find('textarea')
.clear()
.type(content)
.type('{esc}');
},
turnOnManualExecutionSaving: () => {
this.getters.workflowMenu().click();
this.getters.workflowMenuItemSettings().click();