blob: d2977832d1c86fe5c6c32af17b23baeab2349b1a [file] [log] [blame]
Ittay Stern6f900cc2018-08-29 17:01:32 +03001declare namespace Cypress {
2 interface Chainable {
3 fillVFModulePopup: typeof FillVFModulePopup
4 }
5}
6
7function 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
24Cypress.Commands.add('fillVFModulePopup', FillVFModulePopup);