blob: 5444971b7e1f8858b04c4f58e4c48a5ae24ea967 [file] [log] [blame]
declare namespace Cypress {
interface Chainable {
updateServiceShouldNotOverrideChild: typeof updateServiceShouldNotOverrideChild
openServiceContextMenu: typeof openServiceContextMenu
}
}
function updateServiceShouldNotOverrideChild() : void {
cy.getElementByDataTestsId('drawing-board-tree').find('.node-content-wrapper').then((elements)=>{
let numberOfExistingElements = elements.length;
cy.openServiceContextMenu().then(() =>{
cy.getElementByDataTestsId('context-menu-header-edit-item').click({force : true}).then(()=>{
cy.genericFormSubmitForm().then(()=>{
cy.getElementByDataTestsId('drawing-board-tree').find('.node-content-wrapper').then((afterUpdateServiceElements)=>{
chai.expect(numberOfExistingElements).equal(afterUpdateServiceElements.length);
});
});
});
});
});
}
function openServiceContextMenu() : Chainable<any> {
return cy.getElementByDataTestsId('openMenuBtn').click({force: true});
}
Cypress.Commands.add('updateServiceShouldNotOverrideChild', updateServiceShouldNotOverrideChild);
Cypress.Commands.add('openServiceContextMenu', openServiceContextMenu);