From d70091c786840042e7b56718115d1200410d9aed Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Thu, 23 Apr 2020 12:44:59 +0100 Subject: Fix GAB ui test row and column count Change-Id: Ib9e4eb054cd23db9359b6d4db4ce079007c1e4e7 Issue-ID: SDC-2963 Signed-off-by: andre.schmid --- .../openecomp/sdc/ci/tests/execute/sanity/GAB.java | 29 ++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'ui-ci/src/main/java') diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/GAB.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/GAB.java index 7595cbdf9a..757c34926a 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/GAB.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/GAB.java @@ -30,12 +30,13 @@ import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest; import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage; -import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage; +import org.openecomp.sdc.ci.tests.pages.GeneralPageElements; import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils; import org.openecomp.sdc.ci.tests.utilities.FileHandling; import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils; import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; +import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.testng.AssertJUnit; import org.testng.annotations.BeforeClass; @@ -44,8 +45,6 @@ import org.testng.annotations.Test; public class GAB extends SetupCDTest { private static final int THREAD_SLEEP_TIME = 1000; - private static final int MAIN_PAGE_ROWS_SIZE = 2; - private static final int MAIN_PAGE_COLUMN_SIZE = 6; private String pnfFilePath; private String vnfFilePath; @@ -58,11 +57,11 @@ public class GAB extends SetupCDTest { @Test public void addPmDictionaryDeploymentArtifactToPnfAndCheckMagnifierTest() throws Exception { - final int expectedHeaderSize = MAIN_PAGE_COLUMN_SIZE + 10; - final int expectedRowSize = MAIN_PAGE_ROWS_SIZE + 3; + final int expectedHeaderSize = 10; + final int expectedRowSize = 3; ResourceReqDetails pnfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.PNF, getUser()); ResourceUIUtils.createPNF(pnfMetaData, getUser()); - ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen(); + GeneralPageElements.getLeftMenu().moveToDeploymentArtifactScreen(); ArtifactInfo art1 = new ArtifactInfo(pnfFilePath, "pmDictionary.yml", "desc", "artifactpm", "PM_DICTIONARY"); addArtifactAndOpenGAB(art1); assertHeaderAndRowSize(expectedHeaderSize, expectedRowSize); @@ -70,11 +69,11 @@ public class GAB extends SetupCDTest { @Test public void addVesEventsDeploymentArtifactToVfAndCheckMagnifierTest() throws Exception { - final int expectedHeaderSize = MAIN_PAGE_COLUMN_SIZE + 4; - final int expectedRowSize = MAIN_PAGE_ROWS_SIZE + 3; + final int expectedHeaderSize = 4; + final int expectedRowSize = 3; ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); ResourceUIUtils.createVF(vfMetaData, getUser()); - ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen(); + GeneralPageElements.getLeftMenu().moveToDeploymentArtifactScreen(); ArtifactInfo art1 = new ArtifactInfo(vnfFilePath, "vesEvent.yml", "desc", "artifactfault", "VES_EVENTS"); addArtifactAndOpenGAB(art1); assertHeaderAndRowSize(expectedHeaderSize, expectedRowSize); @@ -85,13 +84,17 @@ public class GAB extends SetupCDTest { openGABPopup(art1); } - private void assertHeaderAndRowSize(int expectedHeaderSize, int expectedRowSize) { - List headers = getListOfHeaders(); + private void assertHeaderAndRowSize(final int expectedHeaderSize, final int expectedRowSize) { + final List headers = getListOfHeaders(); AssertJUnit.assertEquals(expectedHeaderSize, headers.size()); - List rows = GeneralUIUtils.getWebElementsListByContainsClassName("datatable-body-row"); + final List rows = getListOfRows(); AssertJUnit.assertEquals(expectedRowSize, rows.size()); } + private List getListOfRows() { + return GeneralUIUtils.getWebElementsListBy(By.xpath("//sdc-modal//datatable-body//datatable-body-row")); + } + private void openGABPopup(ArtifactInfo art1) throws InterruptedException { SetupCDTest.getExtendTest() .log(Status.INFO, String.format("Clicking on magnifier button %s", art1.getArtifactLabel())); @@ -104,7 +107,7 @@ public class GAB extends SetupCDTest { } private List getListOfHeaders() { - return GeneralUIUtils.getWebElementsListByClassName("datatable-header-cell"); + return GeneralUIUtils.getWebElementsListBy(By.xpath("//sdc-modal//datatable-header//datatable-header-cell")); } private void addNewArtifact(List deploymentArtifactList) throws Exception { -- cgit 1.2.3-korg