1 // add new command to the existing Cypress interface
4 declare namespace Cypress {
6 fillVnfPopup: typeof FillVnfPopup,
7 duplicateVnf: typeof DuplicateVnf,
10 function FillVnfPopup(): Chainable<any> {
11 cy.selectDropdownOptionByText('productFamily', 'Emanuel');
12 cy.selectDropdownOptionByText('lcpRegion', 'hvf6');
13 cy.selectDropdownOptionByText('tenant', 'AIN Web Tool-15-D-STTest2');
14 cy.selectDropdownOptionByText('lineOfBusiness', 'zzz1');
15 cy.selectPlatformValue(`xxx1`);
16 return cy.getElementByDataTestsId('form-set').click({force : true}).then((done)=>{
20 function DuplicateVnf( vnfNode: string, amountBefore: number): Chainable<any> {
21 return cy.getElementByDataTestsId(vnfNode).should('have.length', amountBefore)
22 .getElementByDataTestsId(vnfNode+"-menu-btn").click({force:true})
23 .getElementByDataTestsId('context-menu-duplicate').click({force : true})
24 .getTagElementContainsText('button','Duplicate').click({force:true})
25 .getElementByDataTestsId(vnfNode).should('have.length', amountBefore+1).then((done)=>{
29 Cypress.Commands.add('fillVnfPopup', FillVnfPopup);
30 Cypress.Commands.add('duplicateVnf', DuplicateVnf);