merge from ecomp a88f0072 - Modern UI
[vid.git] / vid-webpack-master / cypress / support / steps / fill.vfModule.step.ts
1 declare namespace Cypress {
2   interface Chainable {
3     fillVFModulePopup: typeof FillVFModulePopup
4   }
5 }
6
7 function FillVFModulePopup(vnfName: string, vfModuleName: string, instanceName: string, lcpRegion: string, tenant: string, rollback: boolean, sdncPreLoad: boolean): Chainable<any> {
8   cy.getElementByDataTestsId('node-' + vnfName).click({force: true});
9   cy.getElementByDataTestsId('node-' + vfModuleName + '-add-btn').click({force: true});
10   cy.getElementByDataTestsId('instanceName').last().type(instanceName, {force: true});
11   cy.getElementByDataTestsId('lcpRegion').last().select(lcpRegion);
12   cy.getElementByDataTestsId('tenant').last().select(tenant);
13   cy.getElementByDataTestsId('lcpRegion').last().select(lcpRegion);
14   cy.getElementByDataTestsId('rollback').last().select(String(rollback));
15   if (sdncPreLoad) {
16     cy.getElementByDataTestsId('sdncPreLoad').last().check();
17   }
18   return cy.getElementByDataTestsId('form-set').last().click({force: true}).then((done) => {
19     return done;
20   });
21
22 }
23
24 Cypress.Commands.add('fillVFModulePopup', FillVFModulePopup);