summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardTree.steps.ts
diff options
context:
space:
mode:
authorAmichai Hemli <ah0398@intl.att.com>2019-07-09 14:23:37 +0000
committerGerrit Code Review <gerrit@onap.org>2019-07-09 14:23:37 +0000
commit58d22b526418ffeb89337fed9e20406da420bc6f (patch)
tree4357c9cfe1c92d57ac0a3f90167cade7af505b95 /vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardTree.steps.ts
parent302b02a847e7aa8ccf3ff4bc14ff8a9cf67511b0 (diff)
parent97d9f66df456ef4573047a90baa3cc3ee4bfb0b7 (diff)
Merge changes Ib4430bf2,Icc0bdb9e,I2736b984
* changes: Merge from ecomp 718fd196 - Ext. Services Simulator Merge from ecomp 718fd196 - Integration Tests Merge from ecomp 718fd196 - Modern UI
Diffstat (limited to 'vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardTree.steps.ts')
-rw-r--r--vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardTree.steps.ts48
1 files changed, 47 insertions, 1 deletions
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);