blob: 5444971b7e1f8858b04c4f58e4c48a5ae24ea967 [file] [log] [blame]
Ittay Stern6f900cc2018-08-29 17:01:32 +03001declare namespace Cypress {
2 interface Chainable {
3 updateServiceShouldNotOverrideChild: typeof updateServiceShouldNotOverrideChild
4 openServiceContextMenu: typeof openServiceContextMenu
5 }
6}
7
8function updateServiceShouldNotOverrideChild() : void {
9 cy.getElementByDataTestsId('drawing-board-tree').find('.node-content-wrapper').then((elements)=>{
10 let numberOfExistingElements = elements.length;
11 cy.openServiceContextMenu().then(() =>{
12 cy.getElementByDataTestsId('context-menu-header-edit-item').click({force : true}).then(()=>{
13 cy.genericFormSubmitForm().then(()=>{
14 cy.getElementByDataTestsId('drawing-board-tree').find('.node-content-wrapper').then((afterUpdateServiceElements)=>{
15 chai.expect(numberOfExistingElements).equal(afterUpdateServiceElements.length);
16 });
17 });
18 });
19 });
20 });
21
22}
23
24
25function openServiceContextMenu() : Chainable<any> {
26 return cy.getElementByDataTestsId('openMenuBtn').click({force: true});
27}
28
29
30
31
32Cypress.Commands.add('updateServiceShouldNotOverrideChild', updateServiceShouldNotOverrideChild);
33Cypress.Commands.add('openServiceContextMenu', openServiceContextMenu);