diff options
author | aribeiro <anderson.ribeiro@est.tech> | 2021-08-30 15:18:40 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2021-10-05 16:03:26 +0000 |
commit | 6ecc7c3e150f86528d36cdbaa94912b965619a70 (patch) | |
tree | 089180b4df1919c555f07ffd4107fec823f48ca1 /integration-tests/src/test/java/org/onap | |
parent | 32312ca12dc40f724d248104c16df5e46a4bc5cc (diff) |
Filter categories by model name
Issue-ID: SDC-3706
Signed-off-by: aribeiro <anderson.ribeiro@est.tech>
Change-Id: I457151f09ce0ed2edfa09340e9e08a126e114002
Diffstat (limited to 'integration-tests/src/test/java/org/onap')
4 files changed, 19 insertions, 0 deletions
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"); } |