Added ui-ci test case for checking if hidden 15/105815/2
authorDivyang Patel <divyang.patel@team.telstra.com>
Thu, 9 Apr 2020 11:31:49 +0000 (21:31 +1000)
committerOfir Sonsino <ofir.sonsino@intl.att.com>
Sun, 19 Apr 2020 09:10:30 +0000 (09:10 +0000)
categories are not visible (USECASE: 3rd Party Operational Domain Manager)

Issue-ID: SDC-2879
Signed-off-by: Divyang Patel <divyang.patel@team.telstra.com>
Change-Id: Ic64b7de0f6ee70aef279ce13c3d2e18c194c6789

test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceCategoriesEnum.java
ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Service.java
ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ServiceGeneralPage.java
ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/GeneralUIUtils.java

index c8611b1..959315a 100644 (file)
@@ -24,7 +24,8 @@ import java.util.Random;
 
 public enum ServiceCategoriesEnum {
 
-       VOIP("VoIP Call Control"), MOBILITY("Mobility"), NETWORK_L4("Network L4+"), NETWORK_L3("Network L1-3");
+       VOIP("VoIP Call Control"), MOBILITY("Mobility"), NETWORK_L4("Network L4+"), NETWORK_L3("Network L1-3"),
+               PARTNERSERVICE("Partner Domain Service");
        String value;
 
        private ServiceCategoriesEnum(String value) {
index df94a14..14cb23b 100644 (file)
@@ -79,6 +79,7 @@ import java.util.Arrays;
 import java.util.List;
 
 import static org.assertj.core.api.Assertions.assertThat;
+import static org.testng.AssertJUnit.assertFalse;
 import static org.testng.AssertJUnit.assertTrue;
 
 public class Service extends SetupCDTest {
@@ -119,6 +120,21 @@ public class Service extends SetupCDTest {
         assertTrue("wrong tags", (actualTags.size() == 1) && actualTags.get(0).equals(serviceMetadata.getName()));
     }
 
+    @Test
+    public void validateHiddenCategories() throws Exception {
+        // Create Service
+        ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
+        ServiceUIUtils.createService(serviceMetadata);
+
+        // Get categories list
+        List<WebElement> ddOptions = ServiceGeneralPage.getCategories();
+
+        for (WebElement opt: ddOptions) {
+            assertFalse("Hidden Category visible", ServiceCategoriesEnum.PARTNERSERVICE.equals(opt.getText()));
+        }
+
+    }
+
     @Test
     public void updateService() throws Exception {
         // Create Service
index 08bd580..2642fd1 100644 (file)
@@ -40,6 +40,7 @@ import org.openqa.selenium.WebElement;
 
 import java.io.File;
 import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 
 public class ServiceGeneralPage extends ResourceGeneralPage {
@@ -119,6 +120,10 @@ public class ServiceGeneralPage extends ResourceGeneralPage {
         return GeneralUIUtils.getSelectedElementFromDropDown(getCategoryDataTestsIdAttribute()).getText();
     }
 
+    public static List<WebElement> getCategories() {
+        return GeneralUIUtils.getElementFromDropDown(getCategoryDataTestsIdAttribute()).getOptions();
+    }
+
     public static String getInstantiationTypeChosenValue() {
         return GeneralUIUtils.getSelectedElementFromDropDown(getInstantiationTypeIdAttribute()).getText();
     }
index a021054..bb36ea8 100644 (file)
@@ -413,6 +413,11 @@ public final class GeneralUIUtils {
         return new Select(getDriver().findElement(By.xpath(String.format(TEST_ID_XPATH, dataTestId)))).getFirstSelectedOption();
     }
 
+    public static Select getElementFromDropDown(String dataTestId) {
+        GeneralUIUtils.ultimateWait();
+        return new Select(getDriver().findElement(By.xpath(String.format(TEST_ID_XPATH, dataTestId))));
+    }
+
     public static boolean checkElementsCountInTable(int expectedElementsCount, Supplier<List<WebElement>> func) {
         int maxWaitingPeriodMS = MAX_WAITING_PERIOD;
         int napPeriodMS = NAP_PERIOD;