diff options
Diffstat (limited to 'ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportDCAE.java')
-rw-r--r-- | ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportDCAE.java | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportDCAE.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportDCAE.java index 6a80dfe854..5204c808c4 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportDCAE.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportDCAE.java @@ -22,7 +22,6 @@ package org.openecomp.sdc.ci.tests.execute.sanity; import static org.testng.AssertJUnit.assertTrue; -import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -36,11 +35,11 @@ import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo; import org.openecomp.sdc.ci.tests.datatypes.CanvasElement; import org.openecomp.sdc.ci.tests.datatypes.CanvasManager; import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum; -import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum; -import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.InformationalArtifactsPlaceholders; import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.LeftPanelCanvasItems; import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ResourceMetadataEnum; +import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum; +import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.PropertyTypeEnum; @@ -50,7 +49,6 @@ import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest; import org.openecomp.sdc.ci.tests.pages.CompositionPage; import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage; -import org.openecomp.sdc.ci.tests.pages.DeploymentPage; import org.openecomp.sdc.ci.tests.pages.GeneralPageElements; import org.openecomp.sdc.ci.tests.pages.InformationalArtifactPage; import org.openecomp.sdc.ci.tests.pages.InputsPage; @@ -81,18 +79,12 @@ import com.aventstack.extentreports.Status; public class ImportDCAE extends SetupCDTest { + private static final String SERVICE_INPUT_TEST_VF2_CSAR = "service_input_test_VF2.csar"; private String filePath; + @BeforeMethod public void beforeTest(){ - filePath = System.getProperty("filepath"); - - if (filePath == null && System.getProperty("os.name").contains("Windows")) { - filePath = FileHandling.getResourcesFilesPath(); - } - - else if(filePath.isEmpty() && !System.getProperty("os.name").contains("Windows")){ - filePath = FileHandling.getBasePath() + File.separator + "Files" + File.separator; - } + filePath = FileHandling.getFilePath(""); } @Test @@ -159,8 +151,8 @@ public class ImportDCAE extends SetupCDTest { ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen(); List<ArtifactInfo> deploymentArtifactList = new ArrayList<ArtifactInfo>(); - deploymentArtifactList.add(new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER")); - deploymentArtifactList.add(new ArtifactInfo(filePath, "sample-xml-alldata-1-1.xml", "cuku", "artifact2", "YANG_XML")); + deploymentArtifactList.add(new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", ArtifactTypeEnum.OTHER.getType())); + deploymentArtifactList.add(new ArtifactInfo(filePath, "sample-xml-alldata-1-1.xml", "cuku", "artifact2", ArtifactTypeEnum.YANG_XML.getType())); for (ArtifactInfo deploymentArtifact : deploymentArtifactList) { DeploymentArtifactPage.clickAddNewArtifact(); ArtifactUIUtils.fillAndAddNewArtifactParameters(deploymentArtifact); @@ -186,7 +178,7 @@ public class ImportDCAE extends SetupCDTest { createDCAEAsset(); ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen(); - ArtifactInfo informationalArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER"); + ArtifactInfo informationalArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", ArtifactTypeEnum.OTHER.getType()); InformationalArtifactPage.clickAddNewArtifact(); ArtifactUIUtils.fillAndAddNewArtifactParameters(informationalArtifact); @@ -436,7 +428,7 @@ public class ImportDCAE extends SetupCDTest { ResourceGeneralPage.getLeftMenu().moveToCompositionScreen(); - ArtifactInfo artifact = new ArtifactInfo(filePath, "Heat-File.yaml", "kuku", "artifact3","OTHER"); + ArtifactInfo artifact = new ArtifactInfo(filePath, "Heat-File.yaml", "kuku", "artifact3",ArtifactTypeEnum.OTHER.getType()); CompositionPage.showDeploymentArtifactTab(); CompositionPage.clickAddArtifactButton(); ArtifactUIUtils.fillAndAddNewArtifactParameters(artifact, CompositionPage.artifactPopup()); @@ -463,11 +455,16 @@ public class ImportDCAE extends SetupCDTest { @Test public void addDeploymentArtifactAndVerifyInCompositionScreenDCAEAssetTest() throws Exception{ + + if(true){ + throw new SkipException("Open bug 320081"); + } + createDCAEAsset(); ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen(); - ArtifactInfo deploymentArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER"); + ArtifactInfo deploymentArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", ArtifactTypeEnum.OTHER.getType()); DeploymentArtifactPage.clickAddNewArtifact(); ArtifactUIUtils.fillAndAddNewArtifactParameters(deploymentArtifact); assertTrue(DeploymentArtifactPage.checkElementsCountInTable(1)); @@ -588,7 +585,7 @@ public class ImportDCAE extends SetupCDTest { @Test public void removeFileFromGeneralPageDCAEAssetTest() throws Exception{ - String fileName2 = "service_input_test_VF2.csar"; + String fileName2 = SERVICE_INPUT_TEST_VF2_CSAR; ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); ResourceUIUtils.importVfFromCsarNoCreate(resourceMetaData, filePath, fileName2, getUser()); GeneralPageElements.clickDeleteFile(); @@ -608,7 +605,7 @@ public class ImportDCAE extends SetupCDTest { ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen(); - ArtifactInfo informationalArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER"); + ArtifactInfo informationalArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", ArtifactTypeEnum.OTHER.getType()); InformationalArtifactPage.clickAddNewArtifact(); ArtifactUIUtils.fillAndAddNewArtifactParameters(informationalArtifact); @@ -655,15 +652,13 @@ public class ImportDCAE extends SetupCDTest { @Test public void validContactAfterCreateDCAEAssetTest() throws Exception{ - String fileName2 = "service_input_test_VF2.csar"; - ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); - ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName2, getUser()); + ResourceReqDetails resourceMetaData = createDCAEAsset(); SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating that userID equal to user that was logged in...")); - assertTrue("wrong userId", resourceMetaData.getContactId().equals(ResourceGeneralPage.getContactIdText())); + assertTrue("Wrong userId", resourceMetaData.getContactId().equals(ResourceGeneralPage.getContactIdText())); } public ResourceReqDetails createDCAEAsset() throws Exception{ - String fileName2 = "service_input_test_VF2.csar"; + String fileName2 = SERVICE_INPUT_TEST_VF2_CSAR; ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString()); ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName2, getUser()); resourceMetaData.setVersion("0.1"); |