Adjust NewServiceInstanceTest by new logic + revert state-check in getDefaultVolumeGr... 04/98504/3
authorAmir Skalka <amir.skalka@intl.att.com>
Mon, 18 Nov 2019 08:29:49 +0000 (10:29 +0200)
committerIttay Stern <ittay.stern@att.com>
Mon, 18 Nov 2019 13:50:14 +0000 (15:50 +0200)
* Change expected behaviour of tests to match new
business of VG naming process; See shouldVGNameBeVisible() in
vfModule.control.generator.ts

* Fix Cypress tests `volume group should change on instance`.

Issue-ID: VID-700
Change-Id: I18faf49a4a31f4b8f389dbcda53c55a1a8066c90
Signed-off-by: Amir Skalka <amir.skalka@intl.att.com>
Signed-off-by: Ittay Stern <ittay.stern@att.com>
vid-automation/src/main/java/vid/automation/test/test/NewServiceInstanceTest.java
vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator.ts

index a701f10..1d66887 100644 (file)
@@ -1170,12 +1170,16 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
             Input.text("VF instance name", "instanceName");
         }
 
-        if (serviceData.vfData.vgEnabled) {
+        if (serviceData.vfData.vgEnabled && !serviceData.vnfData.isGeneratedNaming) {
             browseASDCPage.setInputText("volumeGroupName", "_abc");
-            Assert.assertEquals(isElementByIdRequired("volumeGroupName-label"), false,  "volume Group name input should be always optional");
+            Assert.assertFalse(isElementByIdRequired("volumeGroupName-label"),
+                "volume Group name input should be always optional");
         } else {
-            Assert.assertNull(Get.byTestId("volumeGroupName"), "volumeGroupName input should be invisible when vgEnabled == false");
+            Assert.assertNull(Get.byTestId("volumeGroupName"), "volumeGroupName input should be invisible "
+                + "when vgEnabled is false or when vgEnabled is true and EcompGenName is true "
+                + "(was: serviceData.vfData.vgEnabled=>"+serviceData.vfData.vgEnabled+", serviceData.isGeneratedNaming=>" + IS_GENERATED_NAMING.FALSE + ")");
         }
+
         Wait.waitByTestId("model-item-value-subscriberName", 10);
         Assert.assertEquals(Get.byTestId("model-item-value-subscriberName").getText(), "SILVIA ROBBINS", "Subscriber name should be shown in vf module");
         Assert.assertEquals(Get.byTestId("model-item-value-min").getText(), Integer.toString(serviceData.vfData.vfMin), "Min should be shown");
index d939a3d..7b72d3b 100644 (file)
@@ -163,6 +163,9 @@ export class VfModuleControlGenerator {
   }
 
   getDefaultVolumeGroupName(instance: any, isEcompGeneratedNaming: boolean): string {
+    if ((!_.isNil(instance) && instance.volumeGroupName))  {
+      return instance.volumeGroupName;
+    }
     if (isEcompGeneratedNaming) {
       return null;
     }