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