29166f67d5c31e7a2c07b6d7344dc0113f798738
[vid.git] / vid-webpack-master / cypress / support / steps / fill.vnf.popup.step.ts
1 // add new command to the existing Cypress interface
2
3
4 declare namespace Cypress {
5   interface Chainable {
6     fillVnfPopup: typeof FillVnfPopup,
7     duplicateVnf: typeof DuplicateVnf,
8   }
9 }
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)=>{
17     return done;
18   });
19 }
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)=>{
26       return done;
27     });
28 }
29 Cypress.Commands.add('fillVnfPopup', FillVnfPopup);
30 Cypress.Commands.add('duplicateVnf', DuplicateVnf);