remove "Previous instantiotion" button from service popup.
[vid.git] / vid-automation / src / main / java / vid / automation / test / test / BrowseASDCTest.java
index 0331420..84dbf11 100644 (file)
@@ -5,6 +5,7 @@ import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static vid.automation.test.infra.Features.FLAG_1908_COLLECTION_RESOURCE_NEW_INSTANTIATION_UI;
 import static vid.automation.test.infra.Features.FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI;
+import static vid.automation.test.infra.Features.FLAG_2002_IDENTIFY_INVARIANT_MACRO_UUID_BY_BACKEND;
 import static vid.automation.test.infra.Features.FLAG_5G_IN_NEW_INSTANTIATION_UI;
 import static vid.automation.test.infra.Features.FLAG_NETWORK_TO_ASYNC_INSTANTIATION;
 import static vid.automation.test.infra.Features.FLAG_SHOW_ORCHESTRATION_TYPE;
@@ -12,6 +13,8 @@ import static vid.automation.test.infra.ModelInfo.aLaCarteForBrowseSdc;
 import static vid.automation.test.infra.ModelInfo.aLaCarteServiceCreationTest;
 import static vid.automation.test.infra.ModelInfo.instantiationTypeAlacarte_vidNotionsInstantiationUIByUUID;
 import static vid.automation.test.infra.ModelInfo.macroForBrowseSdc;
+import static vid.automation.test.sections.VidBasePage.goOutFromIframe;
+import static vid.automation.test.sections.VidBasePage.goToIframe;
 
 import com.google.common.collect.ImmutableList;
 import java.util.List;
@@ -29,7 +32,7 @@ import org.onap.simulator.presetGenerator.presets.ecompportal_att.PresetGetSessi
 import org.openqa.selenium.By;
 import org.openqa.selenium.WebElement;
 import org.testng.Assert;
-import org.testng.TimeBombSkipException;
+import org.testng.SkipException;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.DataProvider;
@@ -44,6 +47,7 @@ import vid.automation.test.infra.SelectOption;
 import vid.automation.test.model.Service;
 import vid.automation.test.model.User;
 import vid.automation.test.sections.BrowseASDCPage;
+import vid.automation.test.sections.InstantiationStatusPage;
 import vid.automation.test.sections.SideMenu;
 import vid.automation.test.sections.ViewEditPage;
 import vid.automation.test.sections.deploy.DeployDialogBase;
@@ -174,17 +178,16 @@ public class BrowseASDCTest extends CreateInstanceDialogBaseTest {
     @Test
     private void browseServiceModel_deployServiceMacroByBackendInput_creationPopupIsMacro()  {
         deployServiceAndAssertInstantiationType(
-                "csar15782222_instantiationTypeMacro_invariantUUIDAlacarte_withoutNetworks.zip",
-                invariantUUIDAlacarte,
-                new DeployModernUIMacroDialog()
+            ModelInfo.serviceWithInstantiationTypeMacro,
+            new DeployModernUIMacroDialog()
         );
     }
 
     @Test
     private void browseServiceModel_deployServiceMacroByMACRO_SERVICESConfig_creationPopupIsOldMacro()  {
-        if (FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI.isActive() ) {
-            throw new TimeBombSkipException("skipping identify macro by uuid for awhile", "2019/11/25");
-            //also need to handle the simulator preset by using good ModelInfo instance
+        if (FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI.isActive() &&
+        ! FLAG_2002_IDENTIFY_INVARIANT_MACRO_UUID_BY_BACKEND.isActive()) {
+            throw new SkipException("some 2002 flags shall come along together");
         }
         deployServiceAndAssertInstantiationType(
                 "csar15782222_invariantUUIDMacro.zip",
@@ -297,7 +300,10 @@ public class BrowseASDCTest extends CreateInstanceDialogBaseTest {
 
     @DataProvider
     public static Object[][] filterTexts() {
-        return new Object[][]{{serviceName},{modelInvariantId},{serviceUuid}};
+        return new Object[][]{
+            {serviceName},
+            {modelInvariantId},
+            {serviceUuid}};
     }
 
     @Test(dataProvider = "filterTexts")
@@ -314,14 +320,21 @@ public class BrowseASDCTest extends CreateInstanceDialogBaseTest {
 
     @Test
     private void testCategoryParamsDropdownsExistsInCreationDialog() throws Exception {
+        String serviceId = "2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd";
+
+        DeployModernUIMacroDialog deployMacroDialog = getDeployModernUIMacroDialog(serviceId);
+        deployMacroDialog.assertDialog();
+        deployMacroDialog.clickProjectSelect();
+        deployMacroDialog.clickOwningEntitySelect();
+    }
+
+    private DeployModernUIMacroDialog getDeployModernUIMacroDialog(String serviceId) {
         BrowseASDCPage browseASDCPage = registerSimulatorAndGoToBrowseSDC();
-        Service service = servicesService.getService("2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd");
+        Service service = servicesService.getService(serviceId);
         browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
         DeployModernUIMacroDialog deployMacroDialog = new DeployModernUIMacroDialog();
         deployMacroDialog.waitForDialogToLoad();
-        deployMacroDialog.assertDialog();
-        deployMacroDialog.clickProjectSelect();
-        deployMacroDialog.clickOwningEntitySelect();
+        return deployMacroDialog;
     }
 
     private BrowseASDCPage registerSimulatorAndGoToBrowseSDC() {
@@ -419,8 +432,7 @@ public class BrowseASDCTest extends CreateInstanceDialogBaseTest {
         browseASDCPage.clickConfirmButton();
 
         GeneralUIUtils.findAndWaitByText("Missing data", 5);
-
-        Click.onFirstSelectOptionById(Constants.OwningEntity.PLATFORM_SELECT_TEST_ID);
+        SelectOption.selectFirstTwoOptionsFromMultiselectById("multi-selectPlatform");
 
         viewEditPage.clickConfirmButton();
         assertSuccessfulVNFCreation();