Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 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); |