Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 1 | ///<reference path="../../../node_modules/cypress/types/index.d.ts"/> |
| 2 | /// <reference types="Cypress" /> |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 3 | import {JsonBuilder} from '../../support/jsonBuilders/jsonBuilder'; |
| 4 | import {ServiceModel} from '../../support/jsonBuilders/models/service.model'; |
| 5 | import * as _ from 'lodash'; |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 6 | |
| 7 | describe('A la carte', function () { |
| 8 | describe('check service name', () => { |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 9 | let jsonBuilderAAIService: JsonBuilder<ServiceModel> = new JsonBuilder<ServiceModel>(); |
Einat Vinouze | e1f7974 | 2019-08-27 16:01:01 +0300 | [diff] [blame] | 10 | const SERVICE_ID: string = '4d71990b-d8ad-4510-ac61-496288d9078e'; |
| 11 | const SERVICE_INVARIANT_ID: string = 'd27e42cf-087e-4d31-88ac-6c4b7585f800'; |
| 12 | const INSTANCE_NAME_MANDATORY_MESSAGE: string = 'Missing data ("Instance Name" and 3 other fields'; |
| 13 | const INSTANCE_NAME_NOT_MANDATORY_MESSAGE: string = 'Missing data ("Subscriber Name" and 2 other fields)'; |
| 14 | const CONFIRM_BUTTON: string = 'confirmButton'; |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 15 | |
| 16 | beforeEach(() => { |
Ittay Stern | 32dbf80 | 2019-10-29 12:58:49 +0200 | [diff] [blame^] | 17 | cy.clearSessionStorage(); |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 18 | cy.setReduxState(); |
| 19 | cy.preventErrorsOnLoading(); |
| 20 | cy.initAAIMock(); |
Ittay Stern | 0b2078f | 2019-10-23 17:47:34 +0300 | [diff] [blame] | 21 | cy.initVidMock(); |
| 22 | cy.mockLatestVersionForService(SERVICE_ID, SERVICE_INVARIANT_ID); |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 23 | cy.initAlaCarteService(); |
| 24 | cy.initZones(); |
| 25 | cy.login(); |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 26 | }); |
| 27 | |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 28 | afterEach(() => { |
| 29 | cy.screenshot(); |
| 30 | }); |
| 31 | |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 32 | |
| 33 | |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 34 | it(`service name should be mandatory : serviceEcompNaming = true`, ()=> { |
Ittay Stern | 607ea3d | 2019-10-23 17:10:52 +0300 | [diff] [blame] | 35 | cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicService.json').then((res) => { |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 36 | jsonBuilderAAIService.basicJson(res, |
Einat Vinouze | e1f7974 | 2019-08-27 16:01:01 +0300 | [diff] [blame] | 37 | Cypress.config('baseUrl') + '/rest/models/services/' + SERVICE_ID, |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 38 | 200, |
| 39 | 0, |
| 40 | SERVICE_ID + ' - service', |
| 41 | changeServiceEcompNamingToTrue); |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 42 | checkServiceNameInputIdMandatory(); |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 43 | }); |
| 44 | }); |
| 45 | |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 46 | it(`Service a-la-carte`, ()=> { |
| 47 | |
| 48 | const subscriptionServiceType : string = "TYLER SILVIA"; |
| 49 | const owningEntityName : string = "WayneHolland"; |
| 50 | const rollbackOnFailure : string = "true"; |
| 51 | const projectName : string = "WATKINS"; |
| 52 | const instanceName : string = "serviceInstanceName"; |
Ittay Stern | 607ea3d | 2019-10-23 17:10:52 +0300 | [diff] [blame] | 53 | cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => { |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 54 | |
| 55 | cy.setTestApiParamToGR(); |
Ittay Stern | f792671 | 2019-07-07 19:23:03 +0300 | [diff] [blame] | 56 | res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].service.vidNotions.instantiationType = 'ALaCarte'; |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 57 | res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].service.inputs = null; |
| 58 | cy.setReduxState(<any>res); |
| 59 | cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'); |
| 60 | |
| 61 | cy.getElementByDataTestsId("openMenuBtn").click({force: true}) |
| 62 | .getElementByDataTestsId("context-menu-header-edit-item").click({force: true}) |
| 63 | .getElementByDataTestsId("instanceName") |
| 64 | .getElementByDataTestsId("subscriberName") |
| 65 | .getElementByDataTestsId("serviceType") |
| 66 | .getElementByDataTestsId("owningEntity") |
| 67 | .getElementByDataTestsId("project") |
| 68 | .getElementByDataTestsId("rollback"); |
| 69 | |
| 70 | cy.selectDropdownOptionByText("subscriberName", "SILVIA ROBBINS"); |
| 71 | cy.selectDropdownOptionByText("serviceType", subscriptionServiceType); |
| 72 | cy.selectDropdownOptionByText("owningEntity", owningEntityName); |
| 73 | cy.selectDropdownOptionByText("rollback", rollbackOnFailure); |
| 74 | cy.selectDropdownOptionByText("project", projectName); |
| 75 | cy.typeToInput("instanceName", instanceName); |
| 76 | |
| 77 | cy.get('#quantity-select').should('have.attr', 'disabled'); |
| 78 | cy.getElementByDataTestsId('form-set').click({force: true}).then(() => { |
| 79 | cy.getReduxState().then((state) => { |
| 80 | const service = state.service.serviceInstance['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd']; |
| 81 | |
| 82 | cy.readFile('../vid-automation/src/test/resources/a-la-carte/redux-a-la-carte.json').then((file) => { |
| 83 | expect(service.subscriptionServiceType).to.equals(subscriptionServiceType); |
| 84 | expect(service.owningEntityName).to.equals(owningEntityName); |
| 85 | expect(service.rollbackOnFailure).to.equals(rollbackOnFailure); |
| 86 | expect(service.projectName).to.equals(projectName); |
| 87 | expect(service.instanceName).to.equals(instanceName); |
| 88 | }); |
| 89 | }); |
| 90 | }); |
| 91 | }); |
| 92 | }); |
| 93 | |
| 94 | |
| 95 | it(`VNF a-la-carte`, ()=> { |
Ittay Stern | 607ea3d | 2019-10-23 17:10:52 +0300 | [diff] [blame] | 96 | cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => { |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 97 | cy.setTestApiParamToGR(); |
Ittay Stern | f792671 | 2019-07-07 19:23:03 +0300 | [diff] [blame] | 98 | res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].service.vidNotions.instantiationType = 'ALaCarte'; |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 99 | res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].service.inputs = null; |
| 100 | cy.setReduxState(<any>res); |
| 101 | cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'); |
| 102 | |
| 103 | cy.getElementByDataTestsId("openMenuBtn").click({force: true}) |
| 104 | .getElementByDataTestsId("context-menu-header-edit-item").click({force: true}) |
| 105 | .getElementByDataTestsId("instanceName") |
| 106 | .getElementByDataTestsId("subscriberName") |
| 107 | .getElementByDataTestsId("serviceType") |
| 108 | .getElementByDataTestsId("owningEntity") |
| 109 | .getElementByDataTestsId("project") |
| 110 | .getElementByDataTestsId("rollback"); |
| 111 | |
| 112 | cy.selectDropdownOptionByText("subscriberName", "SILVIA ROBBINS"); |
| 113 | cy.selectDropdownOptionByText("serviceType", "TYLER SILVIA"); |
| 114 | cy.selectDropdownOptionByText("owningEntity", "WayneHolland"); |
| 115 | cy.selectDropdownOptionByText("rollback", "true"); |
| 116 | cy.selectDropdownOptionByText("project", "WATKINS"); |
| 117 | cy.typeToInput("instanceName", "serviceInstanceName"); |
| 118 | |
| 119 | cy.get('#quantity-select').should('have.attr', 'disabled'); |
| 120 | cy.getElementByDataTestsId('form-set').click({force: true}).then(() => { |
Ittay Stern | f792671 | 2019-07-07 19:23:03 +0300 | [diff] [blame] | 121 | cy.getElementByDataTestsId('node-2017-488_PASQUALE-vPE 0-add-btn').click({force: true}).then(() => { |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 122 | cy.selectDropdownOptionByText('productFamily', 'Emanuel'); |
Ittay Stern | f792671 | 2019-07-07 19:23:03 +0300 | [diff] [blame] | 123 | cy.selectDropdownOptionByText('lcpRegion', 'AAIAIC25'); |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 124 | cy.typeToInput("lcpRegionText", "just another region"); |
| 125 | cy.selectDropdownOptionByText('tenant', 'USP-SIP-IC-24335-T-01'); |
| 126 | cy.selectDropdownOptionByText('lineOfBusiness', 'zzz1'); |
| 127 | cy.selectDropdownOptionByText('platform', 'xxx1'); |
| 128 | cy.getElementByDataTestsId('form-set').click({force: true}).then(() => { |
| 129 | cy.getReduxState().then((state) => { |
| 130 | |
Ittay Stern | f792671 | 2019-07-07 19:23:03 +0300 | [diff] [blame] | 131 | const vnf = state.service.serviceInstance['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].vnfs['2017-488_PASQUALE-vPE 0']; |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 132 | cy.readFile('../vid-automation/src/test/resources/a-la-carte/redux-a-la-carte.json').then((file) => { |
Ittay Stern | f792671 | 2019-07-07 19:23:03 +0300 | [diff] [blame] | 133 | file.vnfs['2017-488_PASQUALE-vPE 0'].trackById = vnf.trackById; |
| 134 | file.vnfs['2017-488_PASQUALE-vPE 0'].vfModules = {}; |
Einat Vinouze | e1f7974 | 2019-08-27 16:01:01 +0300 | [diff] [blame] | 135 | file.vnfs['2017-488_PASQUALE-vPE 0'].upgradedVFMSonsCounter = 0; |
Ittay Stern | f792671 | 2019-07-07 19:23:03 +0300 | [diff] [blame] | 136 | cy.deepCompare(vnf, file.vnfs['2017-488_PASQUALE-vPE 0']) |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 137 | }); |
| 138 | }); |
| 139 | }); |
| 140 | |
| 141 | }); |
| 142 | }); |
| 143 | }); |
| 144 | }); |
| 145 | |
| 146 | it(`Network a-la-carte`, ()=> { |
Ittay Stern | 607ea3d | 2019-10-23 17:10:52 +0300 | [diff] [blame] | 147 | cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => { |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 148 | cy.setTestApiParamToGR(); |
Ittay Stern | f792671 | 2019-07-07 19:23:03 +0300 | [diff] [blame] | 149 | res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].service.vidNotions.instantiationType = 'ALaCarte'; |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 150 | res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].service.inputs = null; |
| 151 | res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].networks = { |
| 152 | "ExtVL 0": { |
| 153 | "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986", |
| 154 | "invariantUuid": "379f816b-a7aa-422f-be30-17114ff50b7c", |
| 155 | "description": "ECOMP generic virtual link (network) base type for all other service-level and global networks", |
| 156 | "name": "ExtVL", |
| 157 | "version": "37.0", |
| 158 | "customizationUuid": "94fdd893-4a36-4d70-b16a-ec29c54c184f", |
| 159 | "inputs": {}, |
| 160 | "commands": {}, |
| 161 | "properties": { |
| 162 | "network_assignments": "{is_external_network=false, ipv4_subnet_default_assignment={min_subnets_count=1}, ecomp_generated_network_assignment=false, ipv6_subnet_default_assignment={min_subnets_count=1}}", |
| 163 | "ecomp_generated_naming": "false", |
| 164 | "exVL_naming": "{ecomp_generated_naming=true}", |
| 165 | "network_flows": "{is_network_policy=false, is_bound_to_vpn=false}", |
| 166 | "network_homing": "{ecomp_selected_instance_node_target=false}" |
| 167 | }, |
| 168 | "type": "VL", |
| 169 | "modelCustomizationName": "ExtVL 0" |
| 170 | } |
| 171 | }; |
| 172 | res.service.serviceInstance['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].networks = {}; |
| 173 | cy.setReduxState(<any>res); |
| 174 | cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'); |
| 175 | cy.getElementByDataTestsId("node-ExtVL 0-add-btn").click({force: true}); |
| 176 | cy.selectDropdownOptionByText("platform", "xxx1"); |
Ittay Stern | f792671 | 2019-07-07 19:23:03 +0300 | [diff] [blame] | 177 | cy.selectDropdownOptionByText("lcpRegion", "AAIAIC25"); |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 178 | cy.selectDropdownOptionByText("tenant", "USP-SIP-IC-24335-T-01"); |
Ittay Stern | f792671 | 2019-07-07 19:23:03 +0300 | [diff] [blame] | 179 | cy.selectDropdownOptionByText("productFamily", "ERICA"); |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 180 | cy.selectDropdownOptionByText("lineOfBusiness", "zzz1"); |
| 181 | cy.typeToInput("lcpRegionText", "lcpRegionText"); |
| 182 | |
| 183 | cy.getElementByDataTestsId('form-set').click({force: true}).then(() => { |
| 184 | cy.getReduxState().then((state) => { |
| 185 | const network = state.service.serviceInstance['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].networks['ExtVL 0']; |
| 186 | |
| 187 | cy.readFile('../vid-automation/src/test/resources/a-la-carte/redux-a-la-carte.json').then((file) => { |
| 188 | file.networks['ExtVL 0'].trackById = network.trackById; |
| 189 | cy.deepCompare(network, file.networks['ExtVL 0']); |
| 190 | }); |
| 191 | }); |
| 192 | }); |
| 193 | }); |
| 194 | }); |
| 195 | |
| 196 | it(`VFModule a-la-carte`, ()=> { |
| 197 | var timeBomb = new Date('12/09/2018'); |
| 198 | if (new Date() < timeBomb) { |
| 199 | return; |
| 200 | } |
Ittay Stern | 607ea3d | 2019-10-23 17:10:52 +0300 | [diff] [blame] | 201 | cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => { |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 202 | cy.setTestApiParamToGR(); |
Ittay Stern | f792671 | 2019-07-07 19:23:03 +0300 | [diff] [blame] | 203 | res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].service.vidNotions.instantiationType = 'ALaCarte'; |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 204 | res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].service.inputs = null; |
| 205 | cy.setReduxState(<any>res); |
| 206 | cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'); |
| 207 | |
Ittay Stern | f792671 | 2019-07-07 19:23:03 +0300 | [diff] [blame] | 208 | cy.getElementByDataTestsId('node-2017-488_PASQUALE-vPE 0-add-btn').click({force: true}).then(() => { |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 209 | cy.selectDropdownOptionByText('productFamily', 'Emanuel'); |
| 210 | cy.selectDropdownOptionByText('lcpRegion', 'hvf6'); |
| 211 | cy.selectDropdownOptionByText('tenant', 'AIN Web Tool-15-D-STTest2'); |
| 212 | cy.selectDropdownOptionByText('lineOfBusiness', 'zzz1'); |
| 213 | cy.selectDropdownOptionByText('platform', 'xxx1'); |
| 214 | cy.getElementByDataTestsId('form-set').click({force: true}).then(() => { |
Ittay Stern | f792671 | 2019-07-07 19:23:03 +0300 | [diff] [blame] | 215 | const vnfName = '2017-488_PASQUALE-vPE 0'; |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 216 | let vfModulesNames: Array<string> = [ |
Ittay Stern | f792671 | 2019-07-07 19:23:03 +0300 | [diff] [blame] | 217 | '2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0', |
| 218 | '2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1', |
| 219 | '2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vPFE_BV..module-2', |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 220 | ]; |
| 221 | |
| 222 | addVfModule(vnfName, vfModulesNames[0], 'mimazepubi', 'hvf6', '', 'AINWebTool-15-D-iftach', false, false, false) |
| 223 | .then(() => { |
Ittay Stern | f792671 | 2019-07-07 19:23:03 +0300 | [diff] [blame] | 224 | addVfModule(vnfName, vfModulesNames[1], 'puwesovabe', 'AAIAIC25', 'my region', 'USP-SIP-IC-24335-T-01', true, true, false) |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 225 | .then(() => { |
| 226 | addVfModule(vnfName, vfModulesNames[2], 'bnmgtrx', 'hvf6', '', 'AINWebTool-15-D-iftach', false, false, true) |
| 227 | .then(() => { |
| 228 | cy.getReduxState().then((state) => { |
| 229 | const vfModules = state.service.serviceInstance['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].vnfs[vnfName].vfModules; |
| 230 | cy.readFile('../vid-automation/src/test/resources/a-la-carte/redux-a-la-carte.json').then((file) => { |
| 231 | for (let vfModulesName of vfModulesNames) { |
| 232 | const vfModule = vfModules[vfModulesName]; |
| 233 | let vfModuleObject = vfModule[Object.keys(vfModule)[0]]; |
Einat Vinouze | e1f7974 | 2019-08-27 16:01:01 +0300 | [diff] [blame] | 234 | file.vnfs[vnfName].vfModules[vfModulesName][vfModulesName].action = "Create"; |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 235 | cy.deepCompare(vfModuleObject, file.vnfs[vnfName].vfModules[vfModulesName][vfModulesName]); |
| 236 | } |
| 237 | }); |
| 238 | }); |
| 239 | }); |
| 240 | }); |
| 241 | }); |
| 242 | }); |
| 243 | }); |
| 244 | }); |
| 245 | }); |
| 246 | |
| 247 | |
| 248 | function changeServiceEcompNamingToTrue(obj: ServiceModel) { |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 249 | obj.service.serviceEcompNaming = "true"; |
| 250 | return obj; |
| 251 | } |
| 252 | |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 253 | function checkServiceNameInputIdMandatory() { |
Ittay Stern | 7befef8 | 2019-07-11 15:54:36 +0300 | [diff] [blame] | 254 | cy.get('span').contains('Browse SDC Service Models').click({force: true}) |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 255 | .getElementByDataTestsId('deploy-' + SERVICE_ID).click({force: true}) |
| 256 | .wait(1000).getElementByDataTestsId(CONFIRM_BUTTON).click({force: true}) |
| 257 | .get('.error').contains(INSTANCE_NAME_MANDATORY_MESSAGE) |
| 258 | .typeToInput('instanceName', 'testService'); |
| 259 | |
| 260 | cy.getElementByDataTestsId(CONFIRM_BUTTON).click({force: true}) |
| 261 | .get('.error').contains(INSTANCE_NAME_NOT_MANDATORY_MESSAGE); |
| 262 | } |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 263 | |
Einat Vinouze | e1f7974 | 2019-08-27 16:01:01 +0300 | [diff] [blame] | 264 | function addVfModule (vnfName: string, vfModuleName: string, instanceName: string, lcpRegion: string, legacyRegion: string, tenant: string, rollback: boolean, sdncPreLoad: boolean, deleteVgName: boolean): Chainable<any> { |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 265 | return cy.getElementByDataTestsId('node-' + vnfName).click({force: true}).then(() => { |
| 266 | cy.getElementByDataTestsId('node-' + vfModuleName + '-add-btn').click({force: true}).then(() => { |
| 267 | cy.getElementByDataTestsId('instanceName').clear().type(instanceName, {force: true}).then(() => { |
| 268 | if (deleteVgName) { |
| 269 | cy.getElementByDataTestsId('volumeGroupName').clear(); |
| 270 | } |
| 271 | }).then(() => { |
| 272 | cy.selectDropdownOptionByText('lcpRegion', lcpRegion); |
| 273 | if (!_.isEmpty(legacyRegion)) { |
| 274 | cy.typeToInput("lcpRegionText", legacyRegion); |
| 275 | } |
| 276 | cy.selectDropdownOptionByText('tenant', tenant); |
| 277 | cy.selectDropdownOptionByText('rollback', String(rollback)); |
| 278 | if (sdncPreLoad) { |
| 279 | cy.getElementByDataTestsId('sdncPreLoad').check(); |
| 280 | } |
| 281 | cy.getElementByDataTestsId('form-set').click({force: true}); |
| 282 | }); |
| 283 | }); |
| 284 | }); |
| 285 | } |
| 286 | |
Einat Vinouze | e1f7974 | 2019-08-27 16:01:01 +0300 | [diff] [blame] | 287 | |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 288 | }); |
| 289 | }); |