summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/cypress/support/steps/drawingBoard/general.steps.ts
diff options
context:
space:
mode:
authorYoav Schneiderman <yoav.schneiderman@intl.att.com>2020-01-22 11:07:00 +0200
committerYoav Schneiderman <yoav.schneiderman@intl.att.com>2020-01-27 17:36:26 +0200
commit3f216a5ba38d70c193256f05c634093da9599984 (patch)
tree29bb202d705bf1426d3cda3c4ac98c59b84fb0d7 /vid-webpack-master/cypress/support/steps/drawingBoard/general.steps.ts
parent212806afa99581acd7618add8be958d945690867 (diff)
When feature toggle is active then SDNC preload files is enable.
Issue-ID: VID-752 Change-Id: I96ef914bfe37d82da20085227b930523fcdba8fc Signed-off-by: Yoav Schneiderman <yoav.schneiderman@intl.att.com>
Diffstat (limited to 'vid-webpack-master/cypress/support/steps/drawingBoard/general.steps.ts')
-rw-r--r--vid-webpack-master/cypress/support/steps/drawingBoard/general.steps.ts37
1 files changed, 35 insertions, 2 deletions
diff --git a/vid-webpack-master/cypress/support/steps/drawingBoard/general.steps.ts b/vid-webpack-master/cypress/support/steps/drawingBoard/general.steps.ts
index 8d2bb8a24..797fff095 100644
--- a/vid-webpack-master/cypress/support/steps/drawingBoard/general.steps.ts
+++ b/vid-webpack-master/cypress/support/steps/drawingBoard/general.steps.ts
@@ -1,7 +1,10 @@
declare namespace Cypress {
interface Chainable {
updateServiceShouldNotOverrideChild: typeof updateServiceShouldNotOverrideChild
- openServiceContextMenu: typeof openServiceContextMenu
+ openServiceContextMenu: typeof openServiceContextMenu,
+ drawingBoardTreeClickOnContextMenuOptionByName : typeof drawingBoardTreeClickOnContextMenuOptionByName,
+ nodeAction: typeof nodeAction,
+ editNode : typeof editNode
}
}
@@ -18,7 +21,6 @@ function updateServiceShouldNotOverrideChild() : void {
});
});
});
-
}
@@ -26,5 +28,36 @@ function openServiceContextMenu() : Chainable<any> {
return cy.getElementByDataTestsId('openMenuBtn').click({force: true});
}
+function nodeAction(dataTestId: string, action: string, index ?: number) {
+ return cy.drawingBoardTreeOpenContextMenuByElementDataTestId(dataTestId, index)
+ .drawingBoardTreeClickOnContextMenuOptionByName(action)
+}
+
+function drawingBoardTreeClickOnContextMenuOptionByName(optionName : string) : Chainable<any> {
+ switch (optionName) {
+ case 'Duplicate':
+ return cy.getElementByDataTestsId('context-menu-duplicate').click({force : true});
+ case 'Remove':
+ 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();
+ case 'Upgrade':
+ return cy.getElementByDataTestsId('context-menu-upgrade').trigger('mouseover').click();
+ case 'Undo Upgrade':
+ return cy.getElementByDataTestsId('context-menu-undoUpgrade').trigger('mouseover').click();
+ default:
+ return cy.getElementByDataTestsId('context-menu-duplicate').click({force : true});
+ }
+}
+
+function editNode(dataTestId: string, index ?: number) {
+ return cy.nodeAction(dataTestId, 'Edit', index);
+}
+
Cypress.Commands.add('updateServiceShouldNotOverrideChild', updateServiceShouldNotOverrideChild);
Cypress.Commands.add('openServiceContextMenu', openServiceContextMenu);
+Cypress.Commands.add('drawingBoardTreeClickOnContextMenuOptionByName', drawingBoardTreeClickOnContextMenuOptionByName);
+Cypress.Commands.add('nodeAction', nodeAction);
+Cypress.Commands.add('editNode', editNode);