From 0f223132c4061e8b19511b46dc044812e3b3089a Mon Sep 17 00:00:00 2001 From: Eylon Malin Date: Tue, 12 Nov 2019 14:38:41 +0200 Subject: allow openPreviousVersionPopup test to handle modern UI aLaCarte dialog Issue-ID: VID-701 Change-Id: I6b58e24d3029642775132b1b6f0c086a507109a2 Signed-off-by: Eylon Malin --- .../java/vid/automation/test/infra/ModelInfo.java | 1 + .../test/sections/deploy/DeployDialogBase.java | 9 ++++++ .../test/sections/deploy/DeployModernUIBase.java | 6 ++++ .../test/sections/deploy/DeployOldDialogBase.java | 6 ++++ .../vid/automation/test/test/BrowseASDCTest.java | 6 ++-- .../test/test/PreviousVersionsPopupTest.java | 32 +++++++++++++--------- 6 files changed, 43 insertions(+), 17 deletions(-) (limited to 'vid-automation/src/main') diff --git a/vid-automation/src/main/java/vid/automation/test/infra/ModelInfo.java b/vid-automation/src/main/java/vid/automation/test/infra/ModelInfo.java index 59e48013c..043e43a77 100644 --- a/vid-automation/src/main/java/vid/automation/test/infra/ModelInfo.java +++ b/vid-automation/src/main/java/vid/automation/test/infra/ModelInfo.java @@ -54,6 +54,7 @@ public class ModelInfo { public static final ModelInfo pasqualeVmxVpeBvService488Annotations = new ModelInfo("f4d84bb4-a416-4b4e-997e-0059973630b9", "598e3f9e-3244-4d8f-a8e0-0e5d7a29eda9", "service-PasqualeVmxVpeBvService488-csar-annotations.zip"); public static final ModelInfo macroDrawingBoardComplexService = new ModelInfo("6e59c5de-f052-46fa-aa7e-2fca9d674c44","cfef8302-d90f-475f-87cc-3f49a62ef14c", "service-Complexservice-csar.zip" ); public static final ModelInfo aLaCarteServiceCreationTest = new ModelInfo("f913c5d0-206e-45c2-9284-1c68f4e67dc7", "45e61192-876c-4e28-9139-5a0c47410379", "serviceCreationTest.zip"); + public static final ModelInfo aLaCarteServiceOldVersionTest = new ModelInfo("04743c62-ab58-41a0-bc53-1052ef1c094a", "5d353b28-e5b7-419b-98e8-cad5d258be13", "serviceCreationTest04743c62-ab58-41a0-bc53-1052ef1c094a.zip"); public static final ModelInfo aLaCarteVnfGroupingService = new ModelInfo("4117a0b6-e234-467d-b5b9-fe2f68c8b0fc", "7ee41ce4-4827-44b0-a48e-2707a59905d2", "csar15782222_instantiationTypeAlacarte_VnfGrouping.zip"); public static final ModelInfo serviceFabricSriovService = new ModelInfo("253f1467-fe68-4e80-ba71-308000caec31", "c15fe228-7d40-4f99-afa7-10abeedf9aac", "service-fabric-SriovService-csar.zip"); public static final ModelInfo infrastructureVpnService = new ModelInfo("f028b2e2-7080-4b13-91b2-94944d4c42d8", "dfc2c44c-2429-44ca-ae26-1e6dc1f207fb", "service-Infravpn-csar.zip"); diff --git a/vid-automation/src/main/java/vid/automation/test/sections/deploy/DeployDialogBase.java b/vid-automation/src/main/java/vid/automation/test/sections/deploy/DeployDialogBase.java index ff9f6b861..5101a8438 100644 --- a/vid-automation/src/main/java/vid/automation/test/sections/deploy/DeployDialogBase.java +++ b/vid-automation/src/main/java/vid/automation/test/sections/deploy/DeployDialogBase.java @@ -9,4 +9,13 @@ public abstract class DeployDialogBase extends VidBasePage { public abstract void assertDialog(); public abstract void waitForDialogToLoad(); + + public abstract String getModelVersionId(); + + public void waitForDialogAssertAndClose() { + waitForDialogToLoad(); + assertDialog(); + closeDialog(); + } + } diff --git a/vid-automation/src/main/java/vid/automation/test/sections/deploy/DeployModernUIBase.java b/vid-automation/src/main/java/vid/automation/test/sections/deploy/DeployModernUIBase.java index b9d147681..6b2c1ecf4 100644 --- a/vid-automation/src/main/java/vid/automation/test/sections/deploy/DeployModernUIBase.java +++ b/vid-automation/src/main/java/vid/automation/test/sections/deploy/DeployModernUIBase.java @@ -7,6 +7,7 @@ import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.openqa.selenium.WebElement; import vid.automation.test.Constants; import vid.automation.test.infra.Exists; +import vid.automation.test.infra.Get; public abstract class DeployModernUIBase extends DeployDialogBase { @@ -34,6 +35,11 @@ public abstract class DeployModernUIBase extends DeployDialogBase { assertTitle(); } + @Override + public String getModelVersionId() { + return Get.byTestId("model-item-value-uuid").getText(); + } + protected boolean isLcpRegionExist() { return Exists.byTestId(Constants.ViewEdit.LCP_REGION_SELECT_TESTS_ID); } diff --git a/vid-automation/src/main/java/vid/automation/test/sections/deploy/DeployOldDialogBase.java b/vid-automation/src/main/java/vid/automation/test/sections/deploy/DeployOldDialogBase.java index 84225f6ec..59c013a09 100644 --- a/vid-automation/src/main/java/vid/automation/test/sections/deploy/DeployOldDialogBase.java +++ b/vid-automation/src/main/java/vid/automation/test/sections/deploy/DeployOldDialogBase.java @@ -7,6 +7,7 @@ import org.junit.Assert; import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.openqa.selenium.WebElement; import vid.automation.test.Constants; +import vid.automation.test.infra.Get; public abstract class DeployOldDialogBase extends DeployDialogBase { @@ -32,5 +33,10 @@ public abstract class DeployOldDialogBase extends DeployDialogBase { assertThat(modalTitle.getText().toLowerCase(), containsString(getTitle())); } + @Override + public String getModelVersionId() { + return Get.byTestId("Service UUID").getText(); + } + public abstract String getTitle(); } diff --git a/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java b/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java index 2ad3673c3..0331420df 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java @@ -147,7 +147,7 @@ public class BrowseASDCTest extends CreateInstanceDialogBaseTest { } @NotNull - private DeployDialogBase getAlacarteDialogByFlagValue() { + public static DeployDialogBase getAlacarteDialogByFlagValue() { return FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI.isActive() ? new DeployModernUIALaCarteDialog() : new DeployOldALaCarteDialog(); @@ -240,9 +240,7 @@ public class BrowseASDCTest extends CreateInstanceDialogBaseTest { GeneralUIUtils.ultimateWait(); browseASDCPage.clickDeployServiceButtonByServiceUUID(modelInfo.modelVersionId); - deployDialog.waitForDialogToLoad(); - deployDialog.assertDialog(); - deployDialog.closeDialog(); + deployDialog.waitForDialogAssertAndClose(); } @FeatureTogglingTest(value = FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI, flagActive = false) diff --git a/vid-automation/src/main/java/vid/automation/test/test/PreviousVersionsPopupTest.java b/vid-automation/src/main/java/vid/automation/test/test/PreviousVersionsPopupTest.java index c52dd6bac..beef5d966 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/PreviousVersionsPopupTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/PreviousVersionsPopupTest.java @@ -1,29 +1,36 @@ package vid.automation.test.test; +import static org.testng.Assert.assertEquals; +import static vid.automation.test.infra.ModelInfo.ModelInfoWithMultipleVersions.modelInfoWithMultipleVersions; +import static vid.automation.test.infra.ModelInfo.serviceWithOneVersion; + import com.google.common.collect.ImmutableList; import org.junit.Assert; +import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.onap.simulator.presetGenerator.presets.BasePresets.BasePreset; -import org.onap.simulator.presetGenerator.presets.aai.*; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetNetworkZones; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetServicesGet; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubDetailsGet; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubDetailsWithoutInstancesGet; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIServiceDesignAndCreationPut; import org.onap.simulator.presetGenerator.presets.ecompportal_att.PresetGetSessionSlotCheckIntervalGet; import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateServiceInstancePost; import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet; import org.onap.simulator.presetGenerator.presets.sdc.PresetSDCGetServiceMetadataGet; import org.onap.simulator.presetGenerator.presets.sdc.PresetSDCGetServiceToscaModelGet; -import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.openqa.selenium.By; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import vid.automation.test.infra.Click; import vid.automation.test.infra.Get; +import vid.automation.test.infra.ModelInfo; import vid.automation.test.sections.BrowseASDCPage; -import vid.automation.test.sections.CreateNewInstancePage; import vid.automation.test.sections.PreviousVersionDialog; import vid.automation.test.sections.SideMenu; +import vid.automation.test.sections.deploy.DeployDialogBase; import vid.automation.test.services.SimulatorApi; -import static vid.automation.test.infra.ModelInfo.ModelInfoWithMultipleVersions.modelInfoWithMultipleVersions; -import static vid.automation.test.infra.ModelInfo.serviceWithOneVersion; - public class PreviousVersionsPopupTest extends CreateInstanceDialogBaseTest{ BrowseASDCPage browseASDCPage = new BrowseASDCPage(); @@ -79,17 +86,16 @@ public class PreviousVersionsPopupTest extends CreateInstanceDialogBaseTest{ } @Test private void openPreviousVersionPopup_deployOldVersion_creationPopupIsALaCarte(){ - String expectedPopupIsALaCarteName = "Create Service Instance -- a la carte"; prepareSimulatorWithThreeVersionsBeforeBrowseASDCService(); - CreateNewInstancePage newInstance= new CreateNewInstancePage(); + registerExpectationForLegacyServiceDeployment(ModelInfo.aLaCarteServiceOldVersionTest, "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"); newVersionDialog = new PreviousVersionDialog(); navigateToBrowseAsdcAndClickPreviousButton(); newVersionDialog.clickDeployServiceButtonByServiceUUID(modelVersionId2); - assertNewInstanceFormOpened(createModalTitleTestId,expectedPopupIsALaCarteName); - newInstance.clickCancelButtonByTestID(); - GeneralUIUtils.ultimateWait(); - newVersionDialog.clickCancelButton(); - + final DeployDialogBase deployDialog = BrowseASDCTest.getAlacarteDialogByFlagValue(); + deployDialog.waitForDialogToLoad(); + deployDialog.assertDialog(); + assertEquals(deployDialog.getModelVersionId(), modelVersionId2); + deployDialog.closeDialog(); } private void navigateToBrowseAsdcAndClickPreviousButton() { -- cgit 1.2.3-korg