blob: 24ddc9bfef272dd359af8b539be5247706f3a82a [file] [log] [blame]
Ittay Stern6f900cc2018-08-29 17:01:32 +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('Service With VNF network', 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(() => {
Ittay Stern607ea3d2019-10-23 17:10:52 +030020 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicService.json').then((res) => {
Ittay Stern6f900cc2018-08-29 17:01:32 +030021 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
29
Ittay Stern607ea3d2019-10-23 17:10:52 +030030 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiSubViewEditForComplexService.json').then((res) => {
Ittay Stern6f900cc2018-08-29 17:01:32 +030031 jsonBuilderAAISubViewEditModel.basicJson(
32 res,
33 Cypress.config('baseUrl') + "/aai_sub_viewedit/**/**/**/3f93c7cb-2fd0-4557-9514-e189b7b04f9d",
34 200,
35 0,
36 "aai-sub-view-edit")
37 });
38
Ittay Stern607ea3d2019-10-23 17:10:52 +030039 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiSubDetails.json').then((res) => {
Ittay Stern6f900cc2018-08-29 17:01:32 +030040 jsonBuilderAAISubDetailsModel.basicJson(
41 res,
42 Cypress.config('baseUrl') + "/aai_sub_details/**",
43 200,
44 0,
45 "aai-sub-details")
46 });
47
Ittay Stern607ea3d2019-10-23 17:10:52 +030048 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiServiceInstances.json').then((res) => {
Ittay Stern6f900cc2018-08-29 17:01:32 +030049 jsonBuilderAaiServiceInstances.basicJson(
50 res,
51 Cypress.config('baseUrl') + "/search_service_instances**",
52 200,
53 0,
54 "aai-get-service-instances")
55 });
56
57 cy.readFile('../vid-automation/src/test/resources/serviceWithNetwork/aaiGetNetworksWithVlansToVnfByServiceInstance.json').then((res) => {
58 jsonBuilderAAIService.basicJson(
59 res,
60 Cypress.config('baseUrl') + '/aai/standardQuery/vlansByNetworks?' +
61 'globalCustomerId=e433710f-9217-458d-a79d-1c7aff376d89' +
62 '&serviceType=TYLER SILVIA' +
63 '&serviceInstanceId=3f93c7cb-2fd0-4557-9514-e189b7b04f9d' +
64 '&sdcModelUuid=6e59c5de-f052-46fa-aa7e-2fca9d674c44',
65 200,
66 0,
67 "aai-aaiGetNetworksToVlans-By-Service-Instance")
68 });
69
70 cy.initVidMock(); // just for subsequent "initFlags()"
71
72 cy.login();
73 });
74
75 afterEach(() => {
76 cy.screenshot();
77 });
78
79 it(`Display VNF's network and its vlans hierarchically`, function () {
Ittay Sternf7926712019-07-07 19:23:03 +030080 cy.visit('/serviceModels.htm#/instantiate?subscriberId=e433710f-9217-458d-a79d-1c7aff376d89&subscriberName=SILVIA%20ROBBINS&serviceType=TYLER%20SILVIA&serviceInstanceId=3f93c7cb-2fd0-4557-9514-e189b7b04f9d&aaiModelVersionId=6e59c5de-f052-46fa-aa7e-2fca9d674c44&isPermitted=true');
Ittay Stern6f900cc2018-08-29 17:01:32 +030081 cy.wait('@service-complexService');
82 cy.get('div').contains('VNF: fsd')
83 .get('div').contains('NETWORK: AAAAABBBBCCCC')
84 .get('div').contains('NETWORK: DDDEEEE')
85 .get('.vlansTreeNode').should('have.length', 4);
86 });
87 });
88
89 function changeServiceModel(serviceModel: ServiceModel) {
90 serviceModel.service.uuid = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
91 return serviceModel;
92 }
93});
94