summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master')
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/commitDialog.e2e.ts89
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts8
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts12
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts9
-rw-r--r--vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.model.ts1
5 files changed, 116 insertions, 3 deletions
diff --git a/vid-webpack-master/cypress/integration/iFrames/commitDialog.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/commitDialog.e2e.ts
new file mode 100644
index 000000000..22f201aab
--- /dev/null
+++ b/vid-webpack-master/cypress/integration/iFrames/commitDialog.e2e.ts
@@ -0,0 +1,89 @@
+///<reference path="../../../node_modules/cypress/types/index.d.ts"/>
+import {JsonBuilder} from '../../support/jsonBuilders/jsonBuilder';
+import {ServiceModel} from '../../support/jsonBuilders/models/service.model';
+import {AaiServiceInstancesModel} from '../../support/jsonBuilders/models/serviceInstances.model';
+import {AAISubDetailsModel} from '../../support/jsonBuilders/models/aaiSubDetails.model';
+import {AAISubViewEditModel} from '../../support/jsonBuilders/models/aaiSubViewEdit.model';
+
+describe('MSO Commit dialog', function () {
+
+
+ let jsonBuilderAAIService: JsonBuilder<ServiceModel> = new JsonBuilder<ServiceModel>();
+ let jsonBuilderAAISubViewEditModel: JsonBuilder<AAISubViewEditModel> = new JsonBuilder<AAISubViewEditModel>();
+ let jsonBuilderAAISubDetailsModel: JsonBuilder<AAISubDetailsModel> = new JsonBuilder<AAISubDetailsModel>();
+ let jsonBuilderAaiServiceInstances: JsonBuilder<AaiServiceInstancesModel> = new JsonBuilder<AaiServiceInstancesModel>();
+ beforeEach(() => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/defect710619/serviceE2E.json').then((res) => {
+ jsonBuilderAAIService.basicJson(
+ res,
+ Cypress.config('baseUrl') + "/rest/models/services/**",
+ 200, 0,
+ "service-complexService")
+ });
+
+
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/defect710619/aaiSubViewEditForServiceWithSomeVFModuleE2E.json').then((res) => {
+ jsonBuilderAAISubViewEditModel.basicJson(
+ res,
+ Cypress.config('baseUrl') + "/aai_sub_viewedit/**",
+ 200,
+ 0,
+ "aai-sub-view-edit")
+ });
+
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/defect710619/aaiSubDetailsE2E.json').then((res) => {
+ jsonBuilderAAISubDetailsModel.basicJson(
+ res,
+ Cypress.config('baseUrl') + "/aai_sub_details/**",
+ 200,
+ 0,
+ "aai-sub-details")
+ });
+
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/defect710619/aaiServiceInstancesE2E.json').then((res) => {
+ jsonBuilderAaiServiceInstances.basicJson(
+ res,
+ Cypress.config('baseUrl') + "/search_service_instances**",
+ 200,
+ 0,
+ "aai-get-service-instances")
+ });
+
+ cy.server().route({
+ url: Cypress.config('baseUrl') + '/mso/mso_create_vfmodule_instance/dedd680f-f3bd-46d8-97c7-b6fc28db9317/vnfs/1d45e992-e282-4ba5-b17a-9ca6562169e3',
+ method: 'POST',
+ status: 200,
+ response: [],
+ }).as("actualResumeCall");
+
+ cy.initVidMock();
+
+ cy.initTenants();
+
+ cy.login();
+ });
+
+ afterEach(() => {
+ cy.screenshot();
+ });
+
+ it(`When showing the commit dialog and unexpected response - we don't have an http status therefor we display a proper message`, function () {
+ cy.visit('/serviceModels.htm#/instantiate?subscriberId=e433710f-9217-458d-a79d-1c7aff376d89&subscriberName=SILVIA ROBBINS&serviceType=TYLER%20SILVIA&serviceInstanceId=dedd680f-f3bd-46d8-97c7-b6fc28db9317&aaiModelVersionId=4b60252a-bf6c-40df-9db5-98b4c363fdf4&isPermitted=true').then(()=>{
+ cy.wait('@service-complexService');
+ checkResumeAndPopup("dpa2bccfx5992v_base_module","vfModuleTreeNode-assigned");
+ });
+ });
+
+ function checkResumeAndPopup(vfModuleName:string, vfModuleClassName:string) {
+ cy.get('div').find('.' + vfModuleClassName)
+ .getElementByDataTestsId('resumeVFModuleButton-' + vfModuleName).click().then(()=> {
+ cy.getElementByDataTestsId('lcpRegion').should('be.visible').select("option-irma-aic-hvf6")
+ .getElementByDataTestsId('tenant').should('be.visible').select("bae71557c5bb4d5aac6743a4e5f1d054");
+ cy.getElementByDataTestsId('confirmResumeDeleteButton').not('.button--inactive').click().then(()=> {
+ cy.getElementByDataTestsId('msoCommitLog').contains('VID has timed out waiting for an MSO response');
+ });
+ });
+ }
+
+});
+
diff --git a/vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts
index e55b1dcd1..3786bc5e8 100644
--- a/vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts
@@ -38,7 +38,12 @@ describe('Template', () => {
"serviceModelName": "action-data",
"serviceModelVersion": "1.0",
"createdBulkDate": 1525075968000,
- "isRetryEnabled": true
+ "isRetryEnabled": true,
+ "requestSummary": {
+ "vnf": 2,
+ "vfModule": 3,
+ "network": 1
+ }
},
{
"id": 7,
@@ -139,6 +144,7 @@ describe('Template', () => {
cy.getElementByDataTestsId(`createDate-${instantiationTemplates[0].jobId}`).contains('2018-04-30 11:12:48');
cy.getElementByDataTestsId(`instanceName-${instantiationTemplates[0].jobId}`).contains('nWUfl instance name_002');
cy.getElementByDataTestsId(`instantiationStatus-${instantiationTemplates[0].jobId}`).contains('FAILED');
+ cy.getElementByDataTestsId(`summary-${instantiationTemplates[0].jobId}`).contains('{"vnf":2,"vfModule":3,"network":1}');
cy.getElementByDataTestsId(`region-${instantiationTemplates[0].jobId}`).contains('hvf6 (WAYNEHOLLAND)');
cy.getElementByDataTestsId(`tenant-${instantiationTemplates[0].jobId}`).contains('AIN Web Tool-15-D-testalexandria');
cy.getElementByDataTestsId(`aicZone-${instantiationTemplates[0].jobId}`).contains('NFTJSSSS-NFT1');
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts
index 2f044112b..6540a6551 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts
@@ -54,6 +54,17 @@ describe('instantiation templates modal service', () => {
expect(service).toBeDefined();
});
+ test('convert map to json', () => {
+ let result:InstantiationTemplatesRowModel = new InstantiationTemplatesRowModel({
+ "requestSummary": {
+ "vnf": 2,
+ "vfModule": 3,
+ "network": 1
+ }
+ });
+ expect(result.summary).toEqual( "{\"vnf\":2,\"vfModule\":3,\"network\":1}");
+ });
+
test('convertResponseToUI - should return table data', () => {
const jobs = [{
@@ -92,7 +103,6 @@ describe('instantiation templates modal service', () => {
"serviceModelName": "ComplexService",
"serviceModelVersion": "1.0",
"createdBulkDate": 1524995555000,
- "isRetryEnabled": false
}];
const tableRows: InstantiationTemplatesRowModel[] = service.convertResponseToUI(jobs);
expect(tableRows).toHaveLength(1);
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts
index 673709462..df40da74d 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts
@@ -18,7 +18,7 @@ export class InstantiationTemplatesRowModel extends InstantiationBase{
this.createDate = !_.isNil(data.created) ? moment(data.created).format("YYYY-MM-DD HH:mm:ss") : null;
this.instanceName = this.getInstanceName(data.serviceInstanceName);
this.instantiationStatus = !_.isNil(data.jobStatus) ? data.jobStatus : null;
- this.summary = null;
+ this.summary = this.convertRequestSummaryFromMapToString(data.requestSummary);
this.region = this.getRegion(data.regionId, data.owningEntityName);
this.tenant = !_.isNil(data.tenantName) ? data.tenantName : null;
this.aicZone = !_.isNil(data.aicZoneName) ? data.aicZoneName : null;
@@ -46,5 +46,12 @@ export class InstantiationTemplatesRowModel extends InstantiationBase{
}
return instanceName;
}
+
+ convertRequestSummaryFromMapToString = (requestSummary): string => {
+ let myvnf: string = JSON.stringify(requestSummary);
+ return myvnf;
+ }
+
+
}
diff --git a/vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.model.ts b/vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.model.ts
index 5a2b37a7d..8e47f0c78 100644
--- a/vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.model.ts
+++ b/vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.model.ts
@@ -35,6 +35,7 @@ export class ServiceInfoModel extends InstantiationBase{
auditUserId: string;
action: ServiceAction;
isRetryEnabled: boolean;
+ requestSummary:string;
}
export class ServiceInfoUiModel extends ServiceInfoModel{