Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame^] | 1 | declare namespace Cypress { |
| 2 | interface Chainable { |
| 3 | updateServiceShouldNotOverrideChild: typeof updateServiceShouldNotOverrideChild |
| 4 | openServiceContextMenu: typeof openServiceContextMenu |
| 5 | } |
| 6 | } |
| 7 | |
| 8 | function 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 | |
| 25 | function openServiceContextMenu() : Chainable<any> { |
| 26 | return cy.getElementByDataTestsId('openMenuBtn').click({force: true}); |
| 27 | } |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | Cypress.Commands.add('updateServiceShouldNotOverrideChild', updateServiceShouldNotOverrideChild); |
| 33 | Cypress.Commands.add('openServiceContextMenu', openServiceContextMenu); |