blob: e589b1e7374d3678111d9c75c4f527e9598a5e75 [file] [log] [blame]
Sonsino, Ofir (os0695)ff76b5e2018-07-10 15:57:37 +03001///<reference path="../../../node_modules/cypress/types/index.d.ts"/> / <reference types="Cypress" />
2import { JsonBuilder } from '../../support/jsonBuilders/jsonBuilder';
3import { PnfModel } from '../../support/jsonBuilders/models/pnf.model';
4import { ServiceModel } from '../../support/jsonBuilders/models/service.model';
5import { AaiServiceInstancesModel } from '../../support/jsonBuilders/models/serviceInstances.model';
6import { AAISubDetailsModel } from '../../support/jsonBuilders/models/aaiSubDetails.model';
7import { AAISubViewEditModel } from '../../support/jsonBuilders/models/aaiSubViewEdit.model';
8
9describe('View Edit Page', function () {
10 describe('basic UI tests', () => {
11 var jsonBuilderAAIService : JsonBuilder<ServiceModel> = new JsonBuilder<ServiceModel>();
12
13
14 var jsonBuilderAAISubViewEditModel: JsonBuilder<AAISubViewEditModel> = new JsonBuilder<AAISubViewEditModel>();
15 var jsonBuilderAAISubDetailsModel: JsonBuilder<AAISubDetailsModel> = new JsonBuilder<AAISubDetailsModel>();
16 var jsonBuilderPNF: JsonBuilder<PnfModel> = new JsonBuilder<PnfModel>();
17 var jsonBuilderAaiServiceInstances: JsonBuilder<AaiServiceInstancesModel> = new JsonBuilder<AaiServiceInstancesModel>();
18 var jsonBuilderEmpty: JsonBuilder<Object> = new JsonBuilder<Object>();
19 beforeEach(() => {
20 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicService.json').then((res) => {
21 jsonBuilderAAIService.basicJson(
22 res,
23 Cypress.config('baseUrl') + "/rest/models/services/6e59c5de-f052-46fa-aa7e-2fca9d674c44",
24 200, 0,
25 "service-complexService",
26 changeServiceModel)
27 });
28 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiSubViewEditForComplexService.json').then((res) => {
29 jsonBuilderAAISubViewEditModel.basicJson(
30 res,
31 Cypress.config('baseUrl') + "/aai_sub_viewedit/**",
32 200,
33 0,
34 "aai-sub-view-edit")
35 });
36
37 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiSubDetails.json').then((res) => {
38 jsonBuilderAAISubDetailsModel.basicJson(
39 res,
40 Cypress.config('baseUrl') + "/aai_sub_details/**",
41 200,
42 0,
43 "aai-sub-details")
44 });
45
46 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiServiceInstancePnfs.json').then((res) => {
47 jsonBuilderPNF.basicJson(
48 res,
49 Cypress.config('baseUrl') + "/aai_get_service_instance_pnfs/**",
50 200,
51 0,
52 "aai-get-service-instance-pnfs")
53 });
54
55 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiServiceInstances.json').then((res) => {
56 jsonBuilderAaiServiceInstances.basicJson(
57 res,
58 Cypress.config('baseUrl') + "/search_service_instances**",
59 200,
60 0,
61 "aai-get-service-instances")
62 });
63
64 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyObjectResponse.json').then((res) => {
65 jsonBuilderEmpty.basicJson(
66 res,
67 Cypress.config('baseUrl') + "/aai_getPortMirroringConfigsData**",
68 200,
69 0,
70 "aai_getPortMirroringConfigsDate - empty response")
71 });
72
73 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyObjectResponse.json').then((res) => {
74 jsonBuilderEmpty.basicJson(
75 res,
76 Cypress.config('baseUrl') + "/aai_getPortMirroringSourcePorts**",
77 200,
78 0,
79 "aai_getPortMirroringSourcePorts - empty response")
80 });
81
82 cy.login();
83 });
84
85
86 it(`should display service model name and version on each info form`, function () {
87 let typesToIncludeModel:Array<string> = ['service', 'vnf', 'vfmodule', 'volume-group', 'network'];
88 cy.visit('/serviceModels.htm#/instantiate?subscriberId=e433710f-9217-458d-a79d-1c7aff376d89&subscriberName=USP%20VOICE&serviceType=VIRTUAL%20USP&serviceInstanceId=3f93c7cb-2fd0-4557-9514-e189b7b04f9d&aaiModelVersionId=6e59c5de-f052-46fa-aa7e-2fca9d674c44&isPermitted=true');
89 cy.wait('@service-complexService');
90 typesToIncludeModel.forEach((type) => {
91 cy.get('.' + type + '-info').click({force: true});
92 cy.getElementByDataTestsId("Model Version").contains('1.0');
93 cy.getElementByDataTestsId("Model Name").contains('vidmacrofalsenaming');
94 cy.getElementByDataTestsId("detailsCloseBtn").click();
95 });
96 });
97 });
98
99 function changeServiceModel(serviceModel: ServiceModel) {
100 serviceModel.service.uuid = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
101 serviceModel.vnfs = {
102 "VF_vMee 0": {
103 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
104 "invariantUuid": "4160458e-f648-4b30-a176-43881ffffe9e",
105 "description": "VSP_vMee",
106 "name": "VF_vMee",
107 "version": "2.0",
108 "customizationUuid": "91415b44-753d-494c-926a-456a9172bbb9",
109 "inputs": {},
110 "commands": {},
111 "properties": {
112 "gpb2_Internal2_mac": "00:80:37:0E:02:22",
113 "sctp-b-ipv6-egress_src_start_port": "0",
114 "sctp-a-ipv6-egress_rule_application": "any",
115 "Internal2_allow_transit": "true",
116 "sctp-b-IPv6_ethertype": "IPv6",
117 "sctp-a-egress_rule_application": "any",
118 "sctp-b-ingress_action": "pass",
119 "sctp-b-ingress_rule_protocol": "icmp",
120 "ncb2_Internal1_mac": "00:80:37:0E:0F:12",
121 "sctp-b-ipv6-ingress-src_start_port": "0.0",
122 "ncb1_Internal2_mac": "00:80:37:0E:09:12",
123 "fsb_volume_size_0": "320.0",
124 "sctp-b-egress_src_addresses": "local",
125 "sctp-a-ipv6-ingress_ethertype": "IPv4",
126 "sctp-a-ipv6-ingress-dst_start_port": "0",
127 "sctp-b-ipv6-ingress_rule_application": "any",
128 "domain_name": "default-domain",
129 "sctp-a-ingress_rule_protocol": "icmp",
130 "sctp-b-egress-src_start_port": "0.0",
131 "sctp-a-egress_src_addresses": "local",
132 "sctp-b-display_name": "epc-sctp-b-ipv4v6-sec-group",
133 "sctp-a-egress-src_start_port": "0.0",
134 "sctp-a-ingress_ethertype": "IPv4",
135 "sctp-b-ipv6-ingress-dst_end_port": "65535",
136 "sctp-b-dst_subnet_prefix_v6": "::",
137 "nf_naming": "{ecomp_generated_naming=true}",
138 "sctp-a-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
139 "sctp-b-egress-dst_start_port": "0.0",
140 "ncb_flavor_name": "nv.c20r64d1",
141 "gpb1_Internal1_mac": "00:80:37:0E:01:22",
142 "sctp-b-egress_dst_subnet_prefix_len": "0.0",
143 "Internal2_net_cidr": "169.255.0.0",
144 "sctp-a-ingress-dst_start_port": "0.0",
145 "sctp-a-egress-dst_start_port": "0.0",
146 "fsb1_Internal2_mac": "00:80:37:0E:0B:12",
147 "sctp-a-egress_ethertype": "IPv4",
148 "vlc_st_service_mode": "in-network-nat",
149 "sctp-a-ipv6-egress_ethertype": "IPv4",
150 "sctp-a-egress-src_end_port": "65535.0",
151 "sctp-b-ipv6-egress_rule_application": "any",
152 "sctp-b-egress_action": "pass",
153 "sctp-a-ingress-src_subnet_prefix_len": "0.0",
154 "sctp-b-ipv6-ingress-src_end_port": "65535.0",
155 "sctp-b-name": "epc-sctp-b-ipv4v6-sec-group",
156 "fsb2_Internal1_mac": "00:80:37:0E:0D:12",
157 "sctp-a-ipv6-ingress-src_start_port": "0.0",
158 "sctp-b-ipv6-egress_ethertype": "IPv4",
159 "Internal1_net_cidr": "169.253.0.0",
160 "sctp-a-egress_dst_subnet_prefix": "0.0.0.0",
161 "fsb_flavor_name": "nv.c20r64d1",
162 "sctp_rule_protocol": "132",
163 "sctp-b-ipv6-ingress_src_subnet_prefix_len": "0",
164 "sctp-a-ipv6-ingress_rule_application": "any",
165 "ecomp_generated_naming": "true",
166 "sctp-a-IPv6_ethertype": "IPv6",
167 "vlc2_Internal1_mac": "00:80:37:0E:02:12",
168 "vlc_st_virtualization_type": "virtual-machine",
169 "sctp-b-ingress-dst_start_port": "0.0",
170 "sctp-b-ingress-dst_end_port": "65535.0",
171 "sctp-a-ipv6-ingress-src_end_port": "65535.0",
172 "sctp-a-display_name": "epc-sctp-a-ipv4v6-sec-group",
173 "sctp-b-ingress_rule_application": "any",
174 "int2_sec_group_name": "int2-sec-group",
175 "vlc_flavor_name": "nd.c16r64d1",
176 "sctp-b-ipv6-egress_src_addresses": "local",
177 "vlc_st_interface_type_int1": "other1",
178 "sctp-b-egress-src_end_port": "65535.0",
179 "sctp-a-ipv6-egress-dst_start_port": "0",
180 "vlc_st_interface_type_int2": "other2",
181 "sctp-a-ipv6-egress_rule_protocol": "any",
182 "Internal2_shared": "false",
183 "sctp-a-ipv6-egress_dst_subnet_prefix_len": "0",
184 "Internal2_rpf": "disable",
185 "vlc1_Internal1_mac": "00:80:37:0E:01:12",
186 "sctp-b-ipv6-egress_src_end_port": "65535",
187 "sctp-a-ipv6-egress_src_addresses": "local",
188 "sctp-a-ingress-dst_end_port": "65535.0",
189 "sctp-a-ipv6-egress_src_end_port": "65535",
190 "Internal1_forwarding_mode": "l2",
191 "Internal2_dhcp": "false",
192 "sctp-a-dst_subnet_prefix_v6": "::",
193 "pxe_image_name": "MME_PXE-Boot_16ACP04_GA.qcow2",
194 "vlc_st_interface_type_gtp": "other0",
195 "ncb1_Internal1_mac": "00:80:37:0E:09:12",
196 "sctp-b-src_subnet_prefix_v6": "::",
197 "sctp-a-egress_dst_subnet_prefix_len": "0.0",
198 "int1_sec_group_name": "int1-sec-group",
199 "Internal1_dhcp": "false",
200 "sctp-a-ipv6-egress_dst_end_port": "65535",
201 "Internal2_forwarding_mode": "l2",
202 "fsb2_Internal2_mac": "00:80:37:0E:0D:12",
203 "sctp-b-egress_dst_subnet_prefix": "0.0.0.0",
204 "Internal1_net_cidr_len": "17",
205 "gpb2_Internal1_mac": "00:80:37:0E:02:22",
206 "sctp-b-ingress-src_subnet_prefix_len": "0.0",
207 "sctp-a-ingress_dst_addresses": "local",
208 "sctp-a-egress_action": "pass",
209 "fsb_volume_type_0": "SF-Default-SSD",
210 "ncb2_Internal2_mac": "00:80:37:0E:0F:12",
211 "vlc_st_interface_type_sctp_a": "left",
212 "vlc_st_interface_type_sctp_b": "right",
213 "sctp-a-src_subnet_prefix_v6": "::",
214 "vlc_st_version": "2",
215 "sctp-b-egress_ethertype": "IPv4",
216 "sctp-a-ingress_rule_application": "any",
217 "gpb1_Internal2_mac": "00:80:37:0E:01:22",
218 "instance_ip_family_v6": "v6",
219 "sctp-a-ipv6-egress_src_start_port": "0",
220 "sctp-b-ingress-src_start_port": "0.0",
221 "sctp-b-ingress_dst_addresses": "local",
222 "fsb1_Internal1_mac": "00:80:37:0E:0B:12",
223 "vlc_st_interface_type_oam": "management",
224 "multi_stage_design": "false",
225 "oam_sec_group_name": "oam-sec-group",
226 "Internal2_net_gateway": "169.255.0.3",
227 "sctp-a-ipv6-ingress-dst_end_port": "65535",
228 "sctp-b-ipv6-egress-dst_start_port": "0",
229 "Internal1_net_gateway": "169.253.0.3",
230 "sctp-b-ipv6-egress_rule_protocol": "any",
231 "gtp_sec_group_name": "gtp-sec-group",
232 "sctp-a-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
233 "sctp-b-ipv6-egress_dst_subnet_prefix_len": "0",
234 "sctp-a-ipv6-ingress_dst_addresses": "local",
235 "sctp-a-egress_rule_protocol": "icmp",
236 "sctp-b-ipv6-egress_action": "pass",
237 "sctp-a-ipv6-egress_action": "pass",
238 "Internal1_shared": "false",
239 "sctp-b-ipv6-ingress_rule_protocol": "any",
240 "Internal2_net_cidr_len": "17",
241 "sctp-a-name": "epc-sctp-a-ipv4v6-sec-group",
242 "sctp-a-ingress-src_end_port": "65535.0",
243 "sctp-b-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
244 "sctp-a-egress-dst_end_port": "65535.0",
245 "sctp-a-ingress_action": "pass",
246 "sctp-b-egress_rule_protocol": "icmp",
247 "sctp-b-ipv6-ingress_action": "pass",
248 "vlc_st_service_type": "firewall",
249 "sctp-b-ipv6-egress_dst_end_port": "65535",
250 "sctp-b-ipv6-ingress-dst_start_port": "0",
251 "vlc2_Internal2_mac": "00:80:37:0E:02:12",
252 "vlc_st_availability_zone": "true",
253 "fsb_volume_image_name_1": "MME_FSB2_16ACP04_GA.qcow2",
254 "sctp-b-ingress-src_subnet_prefix": "0.0.0.0",
255 "sctp-a-ipv6-ingress_src_subnet_prefix_len": "0",
256 "Internal1_allow_transit": "true",
257 "gpb_flavor_name": "nv.c20r64d1",
258 "availability_zone_max_count": "1",
259 "fsb_volume_image_name_0": "MME_FSB1_16ACP04_GA.qcow2",
260 "sctp-b-ipv6-ingress_dst_addresses": "local",
261 "sctp-b-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
262 "sctp-b-ipv6-ingress_ethertype": "IPv4",
263 "vlc1_Internal2_mac": "00:80:37:0E:01:12",
264 "sctp-a-ingress-src_subnet_prefix": "0.0.0.0",
265 "sctp-a-ipv6-ingress_action": "pass",
266 "Internal1_rpf": "disable",
267 "sctp-b-ingress_ethertype": "IPv4",
268 "sctp-b-egress_rule_application": "any",
269 "sctp-b-ingress-src_end_port": "65535.0",
270 "sctp-a-ipv6-ingress_rule_protocol": "any",
271 "sctp-a-ingress-src_start_port": "0.0",
272 "sctp-b-egress-dst_end_port": "65535.0"
273 },
274 "type": "VF",
275 "modelCustomizationName": "VF_vMee 0",
276 "vfModules": {
277 "vf_vmee0..VfVmee..vmme_vlc..module-1": {
278 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
279 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
280 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
281 "description": null,
282 "name": "VfVmee..vmme_vlc..module-1",
283 "version": "2",
284 "modelCustomizationName": "VfVmee..vmme_vlc..module-1",
285 "properties": {
286 "minCountInstances": 0,
287 "maxCountInstances": null,
288 "initialCount": 0,
289 "vfModuleLabel": "vmme_vlc"
290 },
291 "inputs": {},
292 "volumeGroupAllowed": false
293 },
294 "vf_vmee0..VfVmee..vmme_gpb..module-2": {
295 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
296 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
297 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
298 "description": null,
299 "name": "VfVmee..vmme_gpb..module-2",
300 "version": "2",
301 "modelCustomizationName": "VfVmee..vmme_gpb..module-2",
302 "properties": {
303 "minCountInstances": 0,
304 "maxCountInstances": null,
305 "initialCount": 0,
306 "vfModuleLabel": "vmme_gpb"
307 },
308 "inputs": {},
309 "volumeGroupAllowed": false
310 },
311 "vf_vmee0..VfVmee..base_vmme..module-0": {
312 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
313 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
314 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
315 "description": null,
316 "name": "VfVmee..base_vmme..module-0",
317 "version": "2",
318 "modelCustomizationName": "VfVmee..base_vmme..module-0",
319 "properties": {
320 "minCountInstances": 1,
321 "maxCountInstances": 1,
322 "initialCount": 1,
323 "vfModuleLabel": "base_vmme"
324 },
325 "inputs": {},
326 "volumeGroupAllowed": true
327 }
328 },
329 "volumeGroups": {
330 "vf_vmee0..VfVmee..base_vmme..module-0": {
331 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
332 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
333 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
334 "description": null,
335 "name": "VfVmee..base_vmme..module-0",
336 "version": "2",
337 "modelCustomizationName": "VfVmee..base_vmme..module-0",
338 "properties": {
339 "minCountInstances": 1,
340 "maxCountInstances": 1,
341 "initialCount": 1,
342 "vfModuleLabel": "base_vmme"
343 },
344 "inputs": {}
345 }
346 },
347 "vfcInstanceGroups": {}
348 }
349 };
350 serviceModel.vfModules = {
351 "vf_vmee0..VfVmee..vmme_vlc..module-1": {
352 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
353 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
354 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
355 "description": null,
356 "name": "VfVmee..vmme_vlc..module-1",
357 "version": "2",
358 "modelCustomizationName": "VfVmee..vmme_vlc..module-1",
359 "properties": {
360 "minCountInstances": 0,
361 "maxCountInstances": null,
362 "initialCount": 0,
363 "vfModuleLabel": "vmme_vlc"
364 },
365 "inputs": {},
366 "volumeGroupAllowed": false
367 },
368 "vf_vmee0..VfVmee..vmme_gpb..module-2": {
369 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
370 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
371 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
372 "description": null,
373 "name": "VfVmee..vmme_gpb..module-2",
374 "version": "2",
375 "modelCustomizationName": "VfVmee..vmme_gpb..module-2",
376 "properties": {
377 "minCountInstances": 0,
378 "maxCountInstances": null,
379 "initialCount": 0,
380 "vfModuleLabel": "vmme_gpb"
381 },
382 "inputs": {},
383 "volumeGroupAllowed": false
384 },
385 "vf_vmee0..VfVmee..base_vmme..module-0": {
386 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
387 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
388 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
389 "description": null,
390 "name": "VfVmee..base_vmme..module-0",
391 "version": "2",
392 "modelCustomizationName": "VfVmee..base_vmme..module-0",
393 "properties": {
394 "minCountInstances": 1,
395 "maxCountInstances": 1,
396 "initialCount": 1,
397 "vfModuleLabel": "base_vmme"
398 },
399 "inputs": {},
400 "volumeGroupAllowed": true
401 }
402 };
403 serviceModel.volumeGroups = {
404 "vf_vmee0..VfVmee..base_vmme..module-0": {
405 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
406 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
407 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
408 "description": null,
409 "name": "VfVmee..base_vmme..module-0",
410 "version": "2",
411 "modelCustomizationName": "VfVmee..base_vmme..module-0",
412 "properties": {
413 "minCountInstances": 1,
414 "maxCountInstances": 1,
415 "initialCount": 1,
416 "vfModuleLabel": "base_vmme"
417 },
418 "inputs": {}
419 }
420 };
421 return serviceModel;
422 }
423});
424