diff options
Diffstat (limited to 'vid-webpack-master/cypress/support/steps')
4 files changed, 87 insertions, 1 deletions
diff --git a/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardComponentInfo.steps.ts b/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardComponentInfo.steps.ts index 2033f060c..26682775f 100644 --- a/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardComponentInfo.steps.ts +++ b/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardComponentInfo.steps.ts @@ -8,6 +8,7 @@ declare namespace Cypress { function assertComponentInfoTitleLabelsAndValues(expectedTitle: string, labelsAndValues: string[][]) : void{ cy.getElementByDataTestsId('component-info-section-title').should('have.text', expectedTitle); + cy.get('.componentInfoItem').should('have.length', labelsAndValues.length); labelsAndValues.forEach((tuple: string[], index: number, array: string[][]) => { let label = tuple[0]; let value = tuple[1]; diff --git a/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardHeader.steps.ts b/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardHeader.steps.ts new file mode 100644 index 000000000..7881eb1e4 --- /dev/null +++ b/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardHeader.steps.ts @@ -0,0 +1,33 @@ +declare namespace Cypress { + interface Chainable { + serviceActionDelete: typeof serviceActionDelete + serviceActionUndoDelete: typeof serviceActionUndoDelete + serviceActionResume: typeof serviceActionResume + serviceActionUndoResume: typeof serviceActionResume + } +} + +function serviceActionDelete() : void { + cy.getElementByDataTestsId('openMenuBtn').click(); + cy.getElementByDataTestsId('context-menu-header-delete-item').click(); + cy.getElementByDataTestsId('openMenuBtn').click(); + cy.getElementByDataTestsId('context-menu-header-delete-item').should("have.text", "Undo delete"); +} + +function serviceActionUndoDelete() : void { + cy.getElementByDataTestsId('openMenuBtn').click(); + cy.getElementByDataTestsId('context-menu-header-delete-item').click(); + cy.getElementByDataTestsId('openMenuBtn').click(); + cy.getElementByDataTestsId('context-menu-header-delete-item').should("have.text", "Delete"); +} + +function serviceActionResume() : void { + cy.getElementByDataTestsId('openMenuBtn').click(); + cy.getElementByDataTestsId('context-menu-header-resume-item').click(); +} + + +Cypress.Commands.add('serviceActionUndoDelete', serviceActionUndoDelete); +Cypress.Commands.add('serviceActionDelete', serviceActionDelete); +Cypress.Commands.add('serviceActionResume', serviceActionResume); +Cypress.Commands.add('serviceActionUndoResume', serviceActionResume); diff --git a/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardModel.steps.ts b/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardModel.steps.ts index b2b48b268..7854899f8 100644 --- a/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardModel.steps.ts +++ b/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardModel.steps.ts @@ -2,6 +2,7 @@ declare namespace Cypress { interface Chainable { drawingBoardPressAddButtonByElementName: typeof drawingBoardPressAddButtonByElementName, drawingBoardNumberOfExistingElementsShouldContains: typeof drawingBoardNumberOfExistingElementsShouldContains + getDrawingBoardDeployBtn: typeof getDrawingBoardDeployBtn } } @@ -13,5 +14,10 @@ function drawingBoardNumberOfExistingElementsShouldContains(expectedElements : n cy.getElementByDataTestsId('numberButton').contains(expectedElements); } +function getDrawingBoardDeployBtn() : Chainable<any> { + return cy.getElementByDataTestsId('deployBtn'); +} + Cypress.Commands.add('drawingBoardPressAddButtonByElementName', drawingBoardPressAddButtonByElementName); Cypress.Commands.add('drawingBoardNumberOfExistingElementsShouldContains', drawingBoardNumberOfExistingElementsShouldContains); +Cypress.Commands.add('getDrawingBoardDeployBtn', getDrawingBoardDeployBtn); diff --git a/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardTree.steps.ts b/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardTree.steps.ts index 0150b44aa..a940ae15e 100644 --- a/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardTree.steps.ts +++ b/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardTree.steps.ts @@ -1,7 +1,13 @@ declare namespace Cypress { interface Chainable { drawingBoardTreeOpenContextMenuByElementDataTestId: typeof drawingBoardTreeOpenContextMenuByElementDataTestId, - drawingBoardTreeClickOnContextMenuOptionByName: typeof drawingBoardTreeClickOnContextMenuOptionByName + drawingBoardTreeClickOnContextMenuOptionByName: typeof drawingBoardTreeClickOnContextMenuOptionByName, + nodeWithLineThrough: typeof nodeWithLineThrough, + nodeWithoutLineThrough: typeof nodeWithoutLineThrough, + IsDeleteTagShownOnNode: typeof IsDeleteTagShownOnNode, + IsDeleteTagNotShownOnNode: typeof IsDeleteTagNotShownOnNode, + isNodeDeleted: typeof isNodeDeleted, + isNodeNotDeleted: typeof isNodeNotDeleted } } @@ -17,11 +23,51 @@ function drawingBoardTreeClickOnContextMenuOptionByName(optionName : string) : C return cy.getElementByDataTestsId('context-menu-remove').click({force : true}); case 'Edit': return cy.getElementByDataTestsId('context-menu-edit').click({force : true}); + case 'Delete': + return cy.getElementByDataTestsId('context-menu-delete').trigger('mouseover').click(); default: return cy.getElementByDataTestsId('context-menu-duplicate').click({force : true}); } } +function isNodeDeleted(index: number) +{ + cy.get('.tree-node').eq(1).find('[data-tests-id="node-name"]').eq(index).should('have.css', 'text-decoration').and('contain', 'line-through'); + cy.getElementByDataTestsId('delete-status-type').eq(index).should("contain.text", "Delete").should("contain.css", "opacity", "1"); +} + +function isNodeNotDeleted(index: number) +{ + cy.get('.tree-node').eq(1).find('[data-tests-id="node-name"]').eq(index).should('have.css', 'text-decoration').and('not.contain', 'line-through'); + cy.getElementByDataTestsId('delete-status-type').eq(index).should("contain.text", "Delete").should("contain.css", "opacity", "0"); +} +function nodeWithLineThrough(index: number) +{ + cy.getElementByDataTestsId('node-name').eq(index).should('have.css', 'text-decoration').and('contain', 'line-through') +} + +function nodeWithoutLineThrough(index: number) +{ + cy.getElementByDataTestsId('node-name').eq(index).should('have.css', 'text-decoration').and('not.contain', 'line-through') +} + + +function IsDeleteTagShownOnNode(index: number) +{ + cy.getElementByDataTestsId('delete-status-type').eq(index).should("contain.text", "Delete").should("contain.css", "opacity", "1"); +} + +function IsDeleteTagNotShownOnNode(index: number) +{ + cy.getElementByDataTestsId('delete-status-type').eq(index).should("contain.text", "Delete").should("contain.css", "opacity", "0"); +} Cypress.Commands.add('drawingBoardTreeOpenContextMenuByElementDataTestId', drawingBoardTreeOpenContextMenuByElementDataTestId); Cypress.Commands.add('drawingBoardTreeClickOnContextMenuOptionByName', drawingBoardTreeClickOnContextMenuOptionByName); +Cypress.Commands.add('nodeWithLineThrough', nodeWithLineThrough); +Cypress.Commands.add('nodeWithoutLineThrough', nodeWithoutLineThrough); +Cypress.Commands.add('IsDeleteTagShownOnNode', IsDeleteTagShownOnNode); +Cypress.Commands.add('IsDeleteTagNotShownOnNode', IsDeleteTagNotShownOnNode); + +Cypress.Commands.add('isNodeDeleted', isNodeDeleted); +Cypress.Commands.add('isNodeNotDeleted', isNodeNotDeleted); |