From 6ecc7c3e150f86528d36cdbaa94912b965619a70 Mon Sep 17 00:00:00 2001 From: aribeiro Date: Mon, 30 Aug 2021 15:18:40 +0100 Subject: Filter categories by model name Issue-ID: SDC-3706 Signed-off-by: aribeiro Change-Id: I457151f09ce0ed2edfa09340e9e08a126e114002 --- .../onap/sdc/frontend/ci/tests/datatypes/DataTestIdEnum.java | 1 + .../onap/sdc/frontend/ci/tests/pages/ResourceGeneralPage.java | 4 ++++ .../onap/sdc/frontend/ci/tests/pages/ServiceCreatePage.java | 10 ++++++++++ .../onap/sdc/frontend/ci/tests/pages/ServiceGeneralPage.java | 4 ++++ 4 files changed, 19 insertions(+) (limited to 'integration-tests/src/test/java') diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/datatypes/DataTestIdEnum.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/datatypes/DataTestIdEnum.java index 506a686ddf..d03896689f 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/datatypes/DataTestIdEnum.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/datatypes/DataTestIdEnum.java @@ -166,6 +166,7 @@ public final class DataTestIdEnum { public enum ResourceMetadataEnum { RESOURCE_NAME("name"), DESCRIPTION("description"), + MODEL("selectModelName"), CATEGORY("selectGeneralCategory"), VENDOR_NAME("vendorName"), VENDOR_RELEASE("vendorRelease"), diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourceGeneralPage.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourceGeneralPage.java index 5fa9e04c50..f8729df266 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourceGeneralPage.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourceGeneralPage.java @@ -46,6 +46,10 @@ public class ResourceGeneralPage extends GeneralPageElements { return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ServiceMetadataEnum.DESCRIPTION.getValue()); } + public static String getModelDataTestsIdAttribute() { + return DataTestIdEnum.ResourceMetadataEnum.MODEL.getValue(); + } + public static String getCategoryDataTestsIdAttribute() { return DataTestIdEnum.ResourceMetadataEnum.CATEGORY.getValue(); } diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceCreatePage.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceCreatePage.java index 4635d2ae01..ff7b26f671 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceCreatePage.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceCreatePage.java @@ -65,6 +65,7 @@ public class ServiceCreatePage extends ComponentPage { */ public void fillForm(final ServiceCreateData serviceCreateData) { fillName(serviceCreateData.getName()); + setModel(serviceCreateData.getModel()); setCategory(serviceCreateData.getCategory()); setEtsiVersion(serviceCreateData.getEtsiVersion()); fillDescription(serviceCreateData.getDescription()); @@ -78,6 +79,14 @@ public class ServiceCreatePage extends ComponentPage { categorySelect.selectByVisibleText(etsiVersion); } + private void setModel(final String model) { + if (model == null) { + return; + } + final Select modelSelect = new Select(findElement(By.xpath(XpathSelector.MODEL_SELECT.getXpath()))); + modelSelect.selectByVisibleText(model); + } + private void setCategory(final String category) { if (category == null) { return; @@ -114,6 +123,7 @@ public class ServiceCreatePage extends ComponentPage { @AllArgsConstructor private enum XpathSelector { NAME_INPUT("name", "//input[@data-tests-id='%s']"), + MODEL_SELECT("selectModelName", "//select[@data-tests-id='%s']"), CATEGORY_SELECT("selectGeneralCategory", "//select[@data-tests-id='%s']"), ETSI_VERSION_SELECT("ETSI Version", "//select[@data-tests-id='%s']"), DESCRIPTION_TEXT_AREA("description", "//textarea[@data-tests-id='%s']"); diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceGeneralPage.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceGeneralPage.java index 775e599df6..101630fca7 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceGeneralPage.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceGeneralPage.java @@ -77,6 +77,10 @@ public class ServiceGeneralPage extends ResourceGeneralPage { namingPolicyTextbox.sendKeys(namingPolicyText); } + public static void defineModel(final String model) { + GeneralUIUtils.getSelectList(model, getModelDataTestsIdAttribute()); + } + public static String getServiceFunctionText(){ return getServiceFunctionField().getAttribute("value"); } -- cgit 1.2.3-korg