From 5e71c18416adc5c136ea9053a6bbac819da18c60 Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Wed, 12 Oct 2022 18:14:23 +0100 Subject: Implement create data type property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows to add a new data type property and visualize the properties details. Change-Id: Ib7bcd4b0bd8213dbe8ee8a3762a0636e22dc67eb Issue-ID: SDC-4258 Signed-off-by: André Schmid --- .../workspace/InterfaceOperationInputListComponent.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'integration-tests') diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/InterfaceOperationInputListComponent.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/InterfaceOperationInputListComponent.java index c023401deb..3fcbc0fbe8 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/InterfaceOperationInputListComponent.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/InterfaceOperationInputListComponent.java @@ -33,6 +33,7 @@ import org.onap.sdc.frontend.ci.tests.pages.component.workspace.InterfaceDefinit import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.Select; /** * Handles the input list inside the interface operation modal. @@ -71,10 +72,14 @@ public class InterfaceOperationInputListComponent extends AbstractPageObject { if (value == null) { return; } - if (value instanceof String || value instanceof Integer || value instanceof Boolean) { + if (value instanceof String || value instanceof Integer) { fillSimpleValue(inputName, String.valueOf(value)); return; } + if (value instanceof Boolean) { + fillBooleanValue(inputName, String.valueOf(value)); + return; + } throw new UnsupportedOperationException("Set input value not yet implemented for value type: " + value.getClass().getName()); } @@ -141,6 +146,15 @@ public class InterfaceOperationInputListComponent extends AbstractPageObject { inputOpt.ifPresent(webElement -> webElement.findElement(simpleInputValueSelector).sendKeys(inputValue)); } + private void fillBooleanValue(final String inputName, final String inputValue) { + toggleInputExpansion(inputName); + final Optional inputOpt = findInput(inputName); + assertTrue(inputOpt.isPresent(), String.format("Could not set value for input '%s'. The input was not found.", inputName)); + final By simpleInputValueSelector = By.xpath(XpathSelector.BOOLEAN_VALUE_INPUT_RELATIVE_FROM_INPUT_INFO.getXPath()); + final WebElement booleanDropdownWebElement = inputOpt.get().findElement(simpleInputValueSelector); + new Select(booleanDropdownWebElement).selectByValue(inputValue); + } + @AllArgsConstructor private enum XpathSelector { WRAPPING_ELEMENT("//div[@class='input-tree']"), @@ -148,6 +162,7 @@ public class InterfaceOperationInputListComponent extends AbstractPageObject { INPUT_LABEL("label[@class='input-label']"), INPUT_TYPE("em[@data-tests-id='input-type']"), SIMPLE_VALUE_INPUT_RELATIVE_FROM_INPUT_INFO("..//li[@class='input-value']/input"), + BOOLEAN_VALUE_INPUT_RELATIVE_FROM_INPUT_INFO("..//li[@class='input-value']/select"), EXPAND_ICON("em[contains(concat(' ',normalize-space(@class),' '),' round-expand-icon ')]"), DELETE_ICON("span[contains(concat(' ',normalize-space(@class),' '),' delete-btn ')]"); -- cgit 1.2.3-korg