Merge from ecomp 718fd196 - Modern UI

Issue-ID: VID-378

Change-Id: I2736b98426e324ec3aa233b034229ba84d99839f
Signed-off-by: Ittay Stern <ittay.stern@att.com>
diff --git a/vid-webpack-master/cypress/integration/iFrames/retry.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/retry.e2e.ts
index cc64343..683e1d9 100644
--- a/vid-webpack-master/cypress/integration/iFrames/retry.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/retry.e2e.ts
@@ -35,18 +35,18 @@
       res.action = 'Create';
       res.statusMessage = 'Service instantiation has failed.'
       // Adding VNF with isFailed.
-      res.vnfs["2017-388_ADIOD-vPE 0"].isFailed = true;
-      res.vnfs["2017-488_ADIOD-vPE 0"].isFailed = true;
-      res.vnfs["2017-488_ADIOD-vPE 0"].statusMessage = 'VNF instantiation failed message';
-      res.vnfs["2017-388_ADIOD-vPE 0"].action = 'Create';
-      res.vnfs["2017-488_ADIOD-vPE 0"].action = 'Create';
+      res.vnfs["2017-388_PASQUALE-vPE 0"].isFailed = true;
+      res.vnfs["2017-488_PASQUALE-vPE 0"].isFailed = true;
+      res.vnfs["2017-488_PASQUALE-vPE 0"].statusMessage = 'VNF instantiation failed message';
+      res.vnfs["2017-388_PASQUALE-vPE 0"].action = 'Create';
+      res.vnfs["2017-488_PASQUALE-vPE 0"].action = 'Create';
       res.networks["ExtVL 0"].action = 'Create';
       res.networks["ExtVL 0"].statusMessage = 'Network instantiation failed message';
 
       // Adding VFModule with isFailed.
-      res.vnfs["2017-488_ADIOD-vPE 0"].vfModules["2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0"]["2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0uvfot"].isFailed = true;
-      res.vnfs["2017-488_ADIOD-vPE 0"].vfModules["2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0"]["2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0uvfot"].statusMessage = 'Short vfModule Failure Message';
-      res.vnfs["2017-488_ADIOD-vPE 0"].vfModules["2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0"]["2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0uvfot"].action = 'Create';
+      res.vnfs["2017-488_PASQUALE-vPE 0"].vfModules["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0"]["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0uvfot"].isFailed = true;
+      res.vnfs["2017-488_PASQUALE-vPE 0"].vfModules["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0"]["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0uvfot"].statusMessage = 'Short vfModule Failure Message';
+      res.vnfs["2017-488_PASQUALE-vPE 0"].vfModules["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0"]["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0uvfot"].action = 'Create';
 
       jsonBuilderAndMock.basicJson(
         res,
@@ -58,7 +58,7 @@
 
     cy.openIframe(`app/ui/#/servicePlanning/RETRY_EDIT?serviceModelId=${SERVICE_MODEL_ID}&subscriberId=${SUBSCRIBER_ID}&serviceType=${SERVICE_TYPE}&serviceInstanceId=${SERVICE_INSTANCE_ID}&jobId=${JOB_ID}`);
 
-    cy.getElementByDataTestsId('node-69e09f68-8b63-4cc9-b9ff-860960b5db09-2017-488_ADIOD-vPE 0').click();
+    cy.getElementByDataTestsId('node-69e09f68-8b63-4cc9-b9ff-860960b5db09-2017-488_PASQUALE-vPE 0').click();
 
     cy.get('.failed-msg').should('have.length', 5);
     cy.get('.newIcon').should('have.length', 4);
@@ -69,10 +69,10 @@
       cy.get('.newIcon').should('have.length', 4);
     });
 
-    cy.drawingBoardTreeOpenContextMenuByElementDataTestId('node-afacccf6-397d-45d6-b5ae-94c39734b168-2017-388_ADIOD-vPE 0')
+    cy.drawingBoardTreeOpenContextMenuByElementDataTestId('node-afacccf6-397d-45d6-b5ae-94c39734b168-2017-388_PASQUALE-vPE 0')
       .drawingBoardTreeClickOnContextMenuOptionByName('Edit')
       .getElementByDataTestsId('cancelButton').click({force: true});
-    cy.drawingBoardTreeOpenContextMenuByElementDataTestId('node-afacccf6-397d-45d6-b5ae-94c39734b168-2017-388_ADIOD-vPE 0')
+    cy.drawingBoardTreeOpenContextMenuByElementDataTestId('node-afacccf6-397d-45d6-b5ae-94c39734b168-2017-388_PASQUALE-vPE 0')
       .drawingBoardTreeClickOnContextMenuOptionByName('Remove');
 
     cy.get('.newIcon').should('have.length', 2);
@@ -106,14 +106,14 @@
     cy.readFile('../vid-automation/src/test/resources/aaiGetInstanceTopology/getServiceInstanceTopologyResult.json').then((res) => {
 
       // Adding VNF with isFailed.
-      res.vnfs["2017-388_ADIOD-vPE 0"].isFailed = true;
-      res.vnfs["2017-488_ADIOD-vPE 0"].isFailed = true;
-      res.vnfs["2017-388_ADIOD-vPE 0"].action = 'Create';
-      res.vnfs["2017-488_ADIOD-vPE 0"].action = 'Create';
-      res.vnfs["2017-488_ADIOD-vPE 0"].statusMessage = 'Very long message that checks the popoverwindow can show very very long messagewithout problem.as-erfderfd-rfghthth-yjyjyj-ukuk. For more details go to audit show window';
+      res.vnfs["2017-388_PASQUALE-vPE 0"].isFailed = true;
+      res.vnfs["2017-488_PASQUALE-vPE 0"].isFailed = true;
+      res.vnfs["2017-388_PASQUALE-vPE 0"].action = 'Create';
+      res.vnfs["2017-488_PASQUALE-vPE 0"].action = 'Create';
+      res.vnfs["2017-488_PASQUALE-vPE 0"].statusMessage = 'Very long message that checks the popoverwindow can show very very long messagewithout problem.as-erfderfd-rfghthth-yjyjyj-ukuk. For more details go to audit show window';
       // Adding VFModule with isFailed.
-      res.vnfs["2017-488_ADIOD-vPE 0"].vfModules["2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0"]["2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0uvfot"].isFailed = true;
-      res.vnfs["2017-488_ADIOD-vPE 0"].vfModules["2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0"]["2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0uvfot"].action = 'Create';
+      res.vnfs["2017-488_PASQUALE-vPE 0"].vfModules["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0"]["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0uvfot"].isFailed = true;
+      res.vnfs["2017-488_PASQUALE-vPE 0"].vfModules["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0"]["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0uvfot"].action = 'Create';
 
       cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/responceForFailedInstance.json').then((res) => {
         jsonBuilderAndMock.basicJson(
@@ -135,7 +135,7 @@
 
     cy.openIframe(`app/ui/#/servicePlanning/RETRY?serviceModelId=${SERVICE_MODEL_ID}&subscriberId=${SUBSCRIBER_ID}&serviceType=${SERVICE_TYPE}&serviceInstanceId=${SERVICE_INSTANCE_ID}&jobId=${JOB_ID}`);
 
-    cy.getElementByDataTestsId('node-69e09f68-8b63-4cc9-b9ff-860960b5db09-2017-488_ADIOD-vPE 0').click();
+    cy.getElementByDataTestsId('node-69e09f68-8b63-4cc9-b9ff-860960b5db09-2017-488_PASQUALE-vPE 0').click();
 
     cy.get('.failed-msg').should('have.length', 4);
     cy.get('.newIcon').should('have.length', 4);
@@ -144,7 +144,7 @@
       cy.get('.failed-msg').should('have.length', 4);
       cy.get('.newIcon').should('have.length', 4);
     });
-    cy.assertMenuItemsForNode(['showAuditInfo'],'node-afacccf6-397d-45d6-b5ae-94c39734b168-2017-388_ADIOD-vPE 0-menu-btn');
+    cy.assertMenuItemsForNode(['showAuditInfo'],'node-afacccf6-397d-45d6-b5ae-94c39734b168-2017-388_PASQUALE-vPE 0-menu-btn');
     cy.getElementByDataTestsId('isViewOnly-status-test').contains('VIEW ONLY');
 
     // deploy button should be 'REDEPLOY' and disabled.
@@ -157,7 +157,7 @@
 
   });
 
-  it(`RETRY - drawing board mode - should show correct failed icon + Retry button`, function () {
+  it(`RETRY - drawing board mode - should show correct failed icon + Retry button`,  ()=> {
     const SUBSCRIBER_ID: string = "e433710f-9217-458d-a79d-1c7aff376d89";
     const SERVICE_TYPE: string = "TYLER SILVIA";
     const SERVICE_INSTANCE_ID: string = "f8791436-8d55-4fde-b4d5-72dd2cf13cfb";
@@ -196,4 +196,59 @@
 
   });
 
+  it('RETRY- edit mode- failed service with vnf', ()=>{
+    const SUBSCRIBER_ID: string = "e433710f-9217-458d-a79d-1c7aff376d89";
+    const SERVICE_TYPE: string = "TYLER SILVIA";
+    const SERVICE_INSTANCE_ID: string = "f8791436-8d55-4fde-b4d5-72dd2cf13cfb";
+    const SERVICE_MODEL_ID: string = '6b528779-44a3-4472-bdff-9cd15ec93450';
+    const JOB_ID: string = '123456-44a3-4472-bdff-9cd15ec12345';
+    const TRACK_BY_ID = '14561234';
+    let expectedResult: JSON;
+    cy.readFile('../vid-automation/src/test/resources/asyncInstantiation/ServiceWithFailedServiceInstance.json').then((res) => {
+
+      cy.readFile('../vid-automation/src/test/resources/asyncInstantiation/auditModalFailedServiceInstance.json').then((res) => {
+        jsonBuilderAndMock.basicJson(
+          res,
+          Cypress.config('baseUrl') + "/asyncInstantiation/auditStatusForRetry/TRACK_BY_ID",
+          200,
+          0,
+          "msoStatusForFailedInstance",
+        )
+      });
+
+      jsonBuilderAndMock.basicJson(
+        res,
+        Cypress.config('baseUrl') + "/asyncInstantiation/bulkForRetry/" + JOB_ID,
+        200, 0,
+        "initFAiledServiceInstanceRetryTopology",
+      )
+    });
+
+    cy.openIframe(`app/ui/#/servicePlanning/RETRY_EDIT?serviceModelId=${SERVICE_MODEL_ID}&subscriberId=${SUBSCRIBER_ID}&serviceType=${SERVICE_TYPE}&serviceInstanceId=${SERVICE_INSTANCE_ID}&jobId=${JOB_ID}`);
+    cy.get('.newIcon').should('have.length', 1);
+    cy.getElementByDataTestsId('isViewOnly-status-test').contains('IN EDITING');
+    cy.getElementByDataTestsId("openMenuBtn").click({force: true});
+    cy.getElementByDataTestsId("context-menu-header-edit-item").click({force: true})
+      .getElementByDataTestsId("serviceName").should('have.text','INSTANCE_NAME')
+      .getElementByDataTestsId("subscriberName")
+      .getElementByDataTestsId("serviceType")
+      .getElementByDataTestsId("owningEntity")
+      .getElementByDataTestsId("project")
+      .getElementByDataTestsId("rollback")
+      .getElementByDataTestsId('cancelButton').click({force: true});
+    cy.getElementByDataTestsId("openMenuBtn").click({force: true})
+      .getElementByDataTestsId("context-menu-header-audit-item").click({force: true});
+    cy.getElementByDataTestsId('requestId').should('contain', 'e5f93320-cce6-424d-adc6-259a4ee8b342');
+    cy.getElementByDataTestsId('jobStatus').should('contain', 'Failed');
+    cy.getElementByDataTestsId('additionalInfo').should('contain', 'The service instantiation is failed');
+    cy.getElementByDataTestsId('close-button').click({force: true});
+    // // button should be RETRY
+    cy.getElementByDataTestsId('deployBtn').should('contain', 'REDEPLOY');
+    cy.getElementByDataTestsId('deployBtn').should('not.have.attr', 'disabled');
+    cy.get('.failed-msg').should('have.length', 1);
+    cy.get('.newIcon').should('have.length', 1);
+
+    cy.checkPopoverContentOnMouseEvent('service-failed-msg',  '.popover-content.popover-body','mouseenter', 0)
+      .should('contain', 'The service instantiation is failed');
+    });
 });