From 0e7f223397e1bd8b5c62b7cdc1b1c7ac2eb1cc4c Mon Sep 17 00:00:00 2001 From: Piotr Darosz Date: Fri, 19 Apr 2019 13:08:36 +0200 Subject: GAB UI sanity Prepare UI sanity check for basic GAB functionality. Change-Id: If9b3a45f615ed3e88259b713f3776c22080d7a6d Issue-ID: SDC-2242 Signed-off-by: Piotr Darosz --- .../sdc/ci/tests/datatypes/DataTestIdEnum.java | 3 ++- .../openecomp/sdc/ci/tests/execute/sanity/Vf.java | 28 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) (limited to 'ui-ci/src') diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java index 3823611662..f259672448 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java @@ -261,7 +261,8 @@ public final class DataTestIdEnum { ADD_ANOTHER_ARTIFACT("add-another-artifact-button"), EDIT_ARTIFACT("edit_"), //upload env file by its label(via deployment artifact view)/displayName(via Canvas) DELETE_ARTIFACT("delete_"), - DOWNLOAD_ARTIFACT("download_"), + DOWNLOAD_ARTIFACT("download_"), + BROWSE_ARTIFACT("gab-"), GET_DEPLOYMENT_ARTIFACT_DESCRIPTION("description"), GET_INFORMATIONAL_ARTIFACT_DESCRIPTION("Description"), OK("OK"), diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java index 921984592c..e6e4b724b5 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java @@ -26,6 +26,7 @@ import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.ci.tests.datatypes.*; +import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ArtifactPageEnum; 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; @@ -496,6 +497,33 @@ public class Vf extends SetupCDTest { } + @Test + public void addVesEventsDeploymentArtifactToVfAndCheckMagnifierTest() throws Exception { + ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); + + ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen(); + + List deploymentArtifactList = new ArrayList<>(); + ArtifactInfo art1 = new ArtifactInfo(filePath, "fm_metadata_three_fault_defs.yml", "desc", "artifactfault", "VES_EVENTS"); + deploymentArtifactList.add(art1); + for (ArtifactInfo deploymentArtifact : deploymentArtifactList) { + DeploymentArtifactPage.clickAddNewArtifact(); + ArtifactUIUtils.fillAndAddNewArtifactParameters(deploymentArtifact); + } + AssertJUnit.assertTrue(DeploymentArtifactPage.checkElementsCountInTable(deploymentArtifactList.size())); + + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on magnifier button %s", art1.getArtifactLabel())); + WebElement magnifierButtonElement = GeneralUIUtils.getWebElementByTestID(ArtifactPageEnum.BROWSE_ARTIFACT.getValue() + art1.getArtifactLabel()); + SetupCDTest.getExtendTest().log(Status.INFO, String.format("Found magnifier button: %s", magnifierButtonElement.getText())); + magnifierButtonElement.click(); + List headers = GeneralUIUtils.getWebElementsListByClassName("datatable-header-cell"); + AssertJUnit.assertEquals(3, headers.size()); + headers.get(0).getText(); + List rows = GeneralUIUtils.getWebElementsListByContainsClassName("datatable-body-row"); + AssertJUnit.assertEquals(3, rows.size()); + } + @Override protected UserRoleEnum getRole() { -- cgit 1.2.3-korg