1 ///<reference path="../../../node_modules/cypress/types/index.d.ts"/> / <reference types="Cypress" />
3 import {JsonBuilder} from "../../support/jsonBuilders/jsonBuilder";
4 import {AAISubDetailsModel} from "../../support/jsonBuilders/models/aaiSubDetails.model";
6 describe('Change management AKA VNF changes', function () {
7 let jsonBuilderAAISubDetailsModel: JsonBuilder<AAISubDetailsModel> = new JsonBuilder<AAISubDetailsModel>();
8 let jsonBuilderVnfData: JsonBuilder<any> = new JsonBuilder<any>();
10 let aaiGetVNFDataUrl = Cypress.config('baseUrl') + "/get_vnf_data_by_globalid_and_service_type/e433710f-9217-458d-a79d-1c7aff376d89/TYLER SILVIA";
11 //describe('Contact us', () => {
17 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/defect710619/aaiSubDetailsE2E.json').then((res) => {
18 jsonBuilderAAISubDetailsModel.basicJson(
20 Cypress.config('baseUrl') + "/aai_sub_details/e433710f-9217-458d-a79d-1c7aff376d89**",
26 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json').then(() => {
32 url: Cypress.config('baseUrl') + "/flags**",
34 "FLAG_FLASH_REDUCED_RESPONSE_CHANGEMG": true,
35 "FLAG_FLASH_CLOUD_REGION_AND_NF_ROLE_OPTIONAL_SEARCH": true,
36 "FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST": true
41 cy.readFile('cypress/support/jsonBuilders/mocks/jsons/get_vnf_data.json').then((res) => {
42 jsonBuilderVnfData.basicJson(
44 aaiGetVNFDataUrl + '**',
50 openNewVnfChangeModal();
58 function openNewVnfChangeModal() {
59 cy.visit('/serviceModels.htm#/change-management');
60 cy.getElementByDataTestsId('create-new-change-management').click();
61 cy.getElementByDataTestsId('newChangeManagementForm');
64 function fillSubscriberAndServiceType() {
65 cy.selectDropdownOptionByText('subscriberName', 'SILVIA ROBBINS');
66 cy.selectDropdownOptionByText('serviceType', 'TYLER SILVIA');
69 function fillCloudRegion() {
70 cy.selectDropdownOptionByText('cloudRegion', 'AAIAIC25 (AIC)');
73 function fillNfRole() {
74 cy.getElementByDataTestsId('vnfType').type('vMobileDNS');
77 it(`nf role input and cloud region input and search vnfs button should be disabled without subscriber and serviceType`, function () {
78 cy.get('#searchVNF').should('be.disabled');
79 cy.getElementByDataTestsId('cloudRegion').should('be.disabled');
80 cy.getElementByDataTestsId('vnfType').should('be.disabled')
83 it(`search vnfs without nf role and cloud region`, function () {
85 fillSubscriberAndServiceType();
87 cy.get('#searchVNF').click();
89 cy.wait('@aai_get_vnf_data')
90 .its('url').should('equal', aaiGetVNFDataUrl)
94 it(`search vnfs by nf role and cloud region`, function () {
96 fillSubscriberAndServiceType();
100 cy.get('#searchVNF').click();
102 cy.wait('@aai_get_vnf_data')
103 .its('url').should('equal', aaiGetVNFDataUrl + "?cloudRegion=AAIAIC25&nfRole=vMobileDNS")
107 it(`search vnfs by cloud region`, function () {
109 fillSubscriberAndServiceType();
111 cy.get('#searchVNF').click();
113 cy.wait('@aai_get_vnf_data')
114 .its('url').should('equal', aaiGetVNFDataUrl + "?cloudRegion=AAIAIC25")
117 it(`search vnfs by nf role`, function () {
119 fillSubscriberAndServiceType();
121 cy.get('#searchVNF').click();
123 cy.wait('@aai_get_vnf_data')
124 .its('url').should('equal', aaiGetVNFDataUrl + "?nfRole=vMobileDNS")