summaryrefslogtreecommitdiffstats
path: root/integration-tests
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2022-08-22 19:43:16 +0100
committerMichael Morris <michael.morris@est.tech>2022-08-30 10:25:58 +0000
commitae24e28cda8247fdce38330356b63db1377be58f (patch)
treeab48468b2fea5cf0055f2e33acee3b979433468b /integration-tests
parentb95ca35cd3fc0f68a6eb2d09bb347d9ba659caf3 (diff)
Fix 'Wrong Inputs creation on (Add Service)'
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Change-Id: Iadfe03718066dafe5a438020c488f5b242fe6a41 Issue-ID: SDC-4097
Diffstat (limited to 'integration-tests')
-rw-r--r--integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/EtsiNetworkServiceUiTests.java62
-rw-r--r--integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/ModelToscaTypeImportTest.java18
-rw-r--r--integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/EditComponentInputsFlow.java67
-rw-r--r--integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourcePropertiesAssignmentInputTab.java74
-rw-r--r--integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourcePropertiesAssignmentPage.java22
5 files changed, 179 insertions, 64 deletions
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/EtsiNetworkServiceUiTests.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/EtsiNetworkServiceUiTests.java
index 061fb183f3..38f0d37c21 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/EtsiNetworkServiceUiTests.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/EtsiNetworkServiceUiTests.java
@@ -60,7 +60,7 @@ import org.onap.sdc.frontend.ci.tests.flow.CreateServiceFlow;
import org.onap.sdc.frontend.ci.tests.flow.CreateVlmFlow;
import org.onap.sdc.frontend.ci.tests.flow.CreateVspFlow;
import org.onap.sdc.frontend.ci.tests.flow.DownloadCsarArtifactFlow;
-import org.onap.sdc.frontend.ci.tests.flow.EditComponentPropertiesFlow;
+import org.onap.sdc.frontend.ci.tests.flow.EditComponentInputsFlow;
import org.onap.sdc.frontend.ci.tests.flow.ImportVspFlow;
import org.onap.sdc.frontend.ci.tests.flow.composition.CreateRelationshipFlow;
import org.onap.sdc.frontend.ci.tests.flow.exception.UiTestFlowRuntimeException;
@@ -113,8 +113,8 @@ public class EtsiNetworkServiceUiTests extends SetupCDTest {
//adding node
componentPage = addNodesAndCreateRelationships(resourceName, serviceCreateData, componentPage);
- final Map<String, Object> propertyMap = createPropertyToEditMap();
- editProperties(componentPage, propertyMap);
+ final Map<String, Object> inputToEditMap = createInputToEditMap();
+ editInputs(componentPage, inputToEditMap);
final DownloadCsarArtifactFlow downloadCsarArtifactFlow = downloadCsarArtifact(componentPage);
final ToscaArtifactsPage toscaArtifactsPage = downloadCsarArtifactFlow.getLandedPage()
@@ -123,8 +123,7 @@ public class EtsiNetworkServiceUiTests extends SetupCDTest {
assertThat("No artifact download was found", toscaArtifactsPage.getDownloadedArtifactList(), not(empty()));
final String downloadedCsarName = toscaArtifactsPage.getDownloadedArtifactList().get(0);
- propertyMap.entrySet().removeIf(e -> e.getValue() == null);
- checkEtsiNsPackage(createServiceFlow.getServiceCreateData().getName(), downloadedCsarName, propertyMap);
+ checkEtsiNsPackage(createServiceFlow.getServiceCreateData().getName(), downloadedCsarName, inputToEditMap);
}
private ServiceComponentPage addNodesAndCreateRelationships(final String resourceName, final ServiceCreateData serviceCreateData,
@@ -268,29 +267,27 @@ public class EtsiNetworkServiceUiTests extends SetupCDTest {
return checkVfPropertiesFlow;
}
- private void editProperties(final ComponentPage componentPage, final Map<String, Object> propertyMap) {
- final EditComponentPropertiesFlow editComponentPropertiesFlow = new EditComponentPropertiesFlow(webDriver, propertyMap);
- editComponentPropertiesFlow.run(componentPage);
- }
-
private DownloadCsarArtifactFlow downloadCsarArtifact(final ComponentPage componentPage) {
final DownloadCsarArtifactFlow downloadCsarArtifactFlow = new DownloadCsarArtifactFlow(webDriver);
downloadCsarArtifactFlow.run(componentPage);
return downloadCsarArtifactFlow;
}
- private Map<String, Object> createPropertyToEditMap() {
- final Map<String, Object> propertyMap = new HashMap<>();
- propertyMap.put("designer", "designer1");
- propertyMap.put("descriptor_id", "descriptor_id1");
- propertyMap.put("flavour_id", "flavour_id1");
- propertyMap.put("invariant_id", "invariant_id1");
- propertyMap.put("name", "name1");
- propertyMap.put("version", "version1");
- propertyMap.put("service_availability_level", 1);
- //does not work yet with TOSCA complex types
- propertyMap.put("ns_profile", null);
- return propertyMap;
+ private Map<String, Object> createInputToEditMap() {
+ final Map<String, Object> inputsMap = new HashMap<>();
+ inputsMap.put("descriptor_id", "new descriptor_id");
+ inputsMap.put("designer", "new designer");
+ inputsMap.put("flavour_id", "new flavour_id");
+ inputsMap.put("invariant_id", "new invariant_id");
+ inputsMap.put("name", "new name");
+ inputsMap.put("service_availability_level", 123);
+ inputsMap.put("version", "new version");
+ return inputsMap;
+ }
+
+ private void editInputs(final ComponentPage componentPage, final Map<String, Object> inputsMap) {
+ final EditComponentInputsFlow editComponentInputsFlow = new EditComponentInputsFlow(webDriver, inputsMap);
+ editComponentInputsFlow.run(componentPage);
}
private ServiceCreateData createServiceFormData() {
@@ -303,8 +300,8 @@ public class EtsiNetworkServiceUiTests extends SetupCDTest {
return serviceCreateData;
}
- private void checkEtsiNsPackage(final String serviceName, final String downloadedCsarName,
- final Map<String, Object> expectedPropertyMap) throws UnzipException {
+ private void checkEtsiNsPackage(final String serviceName, final String downloadedCsarName, final Map<String, Object> expectedInputMap)
+ throws UnzipException {
final String downloadFolderPath = getConfig().getDownloadAutomationFolder();
final Map<String, byte[]> filesFromZip = FileHandling.getFilesFromZip(downloadFolderPath, downloadedCsarName);
final Optional<String> etsiPackageEntryOpt =
@@ -327,19 +324,19 @@ public class EtsiNetworkServiceUiTests extends SetupCDTest {
assertThat("Expecting the NSD CSAR signature " + nsdCsarSignature, nsPackageFileMap, hasKey(nsdCsarSignature));
final String nsdCertificate = nsdPackageBaseName + ".cert";
assertThat("Expecting the NSD CSAR certificate " + nsdCertificate, nsPackageFileMap, hasKey(nsdCertificate));
- checkNsCsar(nsdPackageBaseName, nodeType, expectedPropertyMap, nsPackageFileMap.get(nsdCsarFile));
+ checkNsCsar(nsdPackageBaseName, nodeType, nsPackageFileMap.get(nsdCsarFile), expectedInputMap);
return;
}
if (etsiPackageEntry.endsWith(".csar")) {
final Map<String, byte[]> nsPackageFileMap = FileHandling.getFilesFromZip(etsiPackageBytes);
- checkNsCsar(nsdPackageBaseName, nodeType, expectedPropertyMap, nsPackageFileMap.get(nsdCsarFile));
+ checkNsCsar(nsdPackageBaseName, nodeType, nsPackageFileMap.get(nsdCsarFile), expectedInputMap);
return;
}
fail(String.format("Unexpected ETSI NS PACKAGE entry '%s'. Expecting a '.csar' or '.zip'", etsiPackageEntry));
}
- private void checkNsCsar(final String expectedServiceName, final String expectedServiceNodeType, final Map<String, Object> expectedPropertiesMap,
- final byte[] nsCsar) throws UnzipException {
+ private void checkNsCsar(final String expectedServiceName, final String expectedServiceNodeType,
+ final byte[] nsCsar, final Map<String, Object> expectedInputMap) throws UnzipException {
final Map<String, byte[]> csarFileMap = FileHandling.getFilesFromZip(nsCsar);
final String mainDefinitionFile = String.format("Definitions/%s.yaml", expectedServiceName);
@@ -375,9 +372,9 @@ public class EtsiNetworkServiceUiTests extends SetupCDTest {
final Map<String, Object> properties = getMapEntry(serviceNodeTemplate, "properties");
assertThat(String.format("'%s' node template in '%s' should contain a properties entry", expectedServiceNodeType, mainDefinitionFile),
properties, notNullValue());
- assertThat(String.format("'%s' node template should contain '%s' properties", expectedServiceNodeType, expectedPropertiesMap.size()),
- properties.size(), is(expectedPropertiesMap.size()));
- for (final Entry<String, Object> expectedPropertyEntry : expectedPropertiesMap.entrySet()) {
+ assertThat(String.format("'%s' node template should contain '%s' properties", expectedServiceNodeType, expectedInputMap.size()),
+ properties.size(), is(expectedInputMap.size()));
+ for (final Entry<String, Object> expectedPropertyEntry : expectedInputMap.entrySet()) {
final String expectedPropertyName = expectedPropertyEntry.getKey();
assertThat(String.format("'%s' node template should contain the property '%s'", expectedServiceNodeType, expectedPropertyName),
properties, hasKey(expectedPropertyName));
@@ -385,7 +382,7 @@ public class EtsiNetworkServiceUiTests extends SetupCDTest {
if (expectedPropertyValue != null) {
final Object actualPropertyValue = properties.get(expectedPropertyName);
final String msg = String.format("The property '%s', in '%s' node template should have the expected value '%s'",
- expectedPropertyName, expectedServiceNodeType, actualPropertyValue);
+ expectedPropertyName, expectedServiceNodeType, expectedPropertyValue);
assertThat(msg, actualPropertyValue, is(expectedPropertyValue));
}
}
@@ -435,4 +432,3 @@ public class EtsiNetworkServiceUiTests extends SetupCDTest {
}
}
-
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/ModelToscaTypeImportTest.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/ModelToscaTypeImportTest.java
index 3e8b0297a2..1e57bb426a 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/ModelToscaTypeImportTest.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/ModelToscaTypeImportTest.java
@@ -27,7 +27,7 @@ import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
-import java.util.Arrays;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@@ -104,7 +104,7 @@ public class ModelToscaTypeImportTest extends SetupCDTest {
final var vf = new ResourceCreateData();
vf.setRandomName(ElementFactory.getResourcePrefix() + "-VF");
vf.setCategory(ResourceCategoryEnum.GENERIC_ABSTRACT.getSubCategory());
- vf.setTagList(Arrays.asList(vf.getName()));
+ vf.setTagList(Collections.singletonList(vf.getName()));
vf.setDescription("Test");
vf.setVendorName("EST");
vf.setVendorRelease("2.5.1");
@@ -149,13 +149,13 @@ public class ModelToscaTypeImportTest extends SetupCDTest {
final Map<String, byte[]> csarFiles = FileHandling.getFilesFromZip(downloadFolderPath, toscaArtifactsPage.getDownloadedArtifactList().get(0));
assertEquals(8, csarFiles.size());
- assertTrue(csarFiles.keySet().stream().filter(filename -> filename.contains(NODE_TYPE_TO_ADD.concat("-template.yml"))).findAny().isPresent());
- assertTrue(csarFiles.keySet().stream().filter(filename -> filename.contains(MODEL_VNFD_TYPES.concat(".yaml"))).findAny().isPresent());
- assertTrue(csarFiles.keySet().stream().filter(filename -> filename.contains(MODEL_NSD_TYPES.concat(".yaml"))).findAny().isPresent());
- assertTrue(csarFiles.keySet().stream().filter(filename -> filename.contains("-template-interface".concat(".yml"))).findAny().isPresent());
- assertTrue(csarFiles.keySet().stream().filter(filename -> filename.contains(ADDITIONAL_TYPE_DEFINITIONS.concat(".yaml"))).findAny().isPresent());
- assertTrue(csarFiles.values().stream().filter(bytes -> new String(bytes).contains(TOSCA_CAPABILITIES_NETWORK_LINK)).findAny().isPresent());
- assertTrue(csarFiles.values().stream().filter(bytes -> new String(bytes).contains(ADDITIONAL_SERVICE_DATA)).findAny().isPresent());
+ assertTrue(csarFiles.keySet().stream().anyMatch(filename -> filename.contains(NODE_TYPE_TO_ADD.concat("-template.yml"))));
+ assertTrue(csarFiles.keySet().stream().anyMatch(filename -> filename.contains(MODEL_VNFD_TYPES.concat(".yaml"))));
+ assertTrue(csarFiles.keySet().stream().anyMatch(filename -> filename.contains(MODEL_NSD_TYPES.concat(".yaml"))));
+ assertTrue(csarFiles.keySet().stream().anyMatch(filename -> filename.contains("-template-interface".concat(".yml"))));
+ assertTrue(csarFiles.keySet().stream().anyMatch(filename -> filename.contains(ADDITIONAL_TYPE_DEFINITIONS.concat(".yaml"))));
+ assertTrue(csarFiles.values().stream().anyMatch(bytes -> new String(bytes).contains(TOSCA_CAPABILITIES_NETWORK_LINK)));
+ assertTrue(csarFiles.values().stream().anyMatch(bytes -> new String(bytes).contains(ADDITIONAL_SERVICE_DATA)));
}
private ComponentPage addProperty(ComponentPage serviceComponentPage, final Map<String, String> propertyMap, String name) {
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/EditComponentInputsFlow.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/EditComponentInputsFlow.java
new file mode 100644
index 0000000000..0eac3d9339
--- /dev/null
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/EditComponentInputsFlow.java
@@ -0,0 +1,67 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 Nordix Foundation
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.sdc.frontend.ci.tests.flow;
+
+import com.aventstack.extentreports.Status;
+import java.util.Map;
+import java.util.Optional;
+import org.apache.commons.collections4.MapUtils;
+import org.onap.sdc.frontend.ci.tests.execute.setup.ExtentTestActions;
+import org.onap.sdc.frontend.ci.tests.pages.ComponentPage;
+import org.onap.sdc.frontend.ci.tests.pages.PageObject;
+import org.onap.sdc.frontend.ci.tests.pages.ResourcePropertiesAssignmentPage;
+import org.openqa.selenium.WebDriver;
+
+public class EditComponentInputsFlow extends AbstractUiTestFlow {
+
+ private final Map<String, Object> inputsMap;
+ private ComponentPage componentPage;
+
+ public EditComponentInputsFlow(final WebDriver webDriver, final Map<String, Object> inputsMap) {
+ super(webDriver);
+ this.inputsMap = inputsMap;
+ }
+
+ @Override
+ public Optional<ComponentPage> run(final PageObject... pageObjects) {
+ componentPage = getParameter(pageObjects, ComponentPage.class).orElseGet(() -> new ComponentPage(webDriver));
+ componentPage.isLoaded();
+ if (MapUtils.isEmpty(inputsMap)) {
+ return Optional.of(componentPage);
+ }
+ final ResourcePropertiesAssignmentPage resourcePropertiesAssignmentPage = componentPage.goToPropertiesAssignment();
+ resourcePropertiesAssignmentPage.isLoaded();
+ resourcePropertiesAssignmentPage.selectInputTab();
+ final String inputNames = String.join(", ", inputsMap.keySet());
+ ExtentTestActions.takeScreenshot(Status.INFO, "etsi-ns-edited-properties", String.format("Before editing inputs: %s", inputNames));
+ extendTest.log(Status.INFO, "Editing inputs " + inputNames);
+
+ inputsMap.forEach(resourcePropertiesAssignmentPage::setInputValue);
+ resourcePropertiesAssignmentPage.saveInputs();
+ ExtentTestActions.takeScreenshot(Status.INFO, "etsi-ns-edited-properties", String.format("Inputs edited: %s", inputNames));
+ resourcePropertiesAssignmentPage.selectPropertiesTab();
+ return Optional.of(componentPage);
+ }
+
+ @Override
+ public Optional<ComponentPage> getLandedPage() {
+ return Optional.ofNullable(componentPage);
+ }
+}
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourcePropertiesAssignmentInputTab.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourcePropertiesAssignmentInputTab.java
index a46e9a9bee..75f54167ba 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourcePropertiesAssignmentInputTab.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourcePropertiesAssignmentInputTab.java
@@ -20,28 +20,35 @@
package org.onap.sdc.frontend.ci.tests.pages;
import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.onap.sdc.frontend.ci.tests.pages.PropertyNameBuilder.buildInputField;
+import com.aventstack.extentreports.Status;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
-
+import lombok.AllArgsConstructor;
+import lombok.Getter;
import org.onap.sdc.frontend.ci.tests.execute.setup.ExtentTestActions;
+import org.onap.sdc.frontend.ci.tests.utilities.LoaderHelper;
+import org.onap.sdc.frontend.ci.tests.utilities.NotificationComponent;
+import org.onap.sdc.frontend.ci.tests.utilities.NotificationComponent.NotificationType;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
-
-import com.aventstack.extentreports.Status;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
+import org.openqa.selenium.support.ui.Select;
/**
* Handles the Resource Properties Assignment Input Tab UI actions
*/
public class ResourcePropertiesAssignmentInputTab extends AbstractPageObject {
+ private LoaderHelper loaderHelper;
+ private NotificationComponent notificationComponent;
+
public ResourcePropertiesAssignmentInputTab(final WebDriver webDriver) {
super(webDriver);
+ notificationComponent = new NotificationComponent(webDriver);
+ loaderHelper = new LoaderHelper(webDriver);
}
@Override
@@ -61,8 +68,9 @@ public class ResourcePropertiesAssignmentInputTab extends AbstractPageObject {
/**
* Adds metadata to a property within the inputs tab based on a property name
- * @param name used to determine which property to add metadata
- * @param key the metadata key to add
+ *
+ * @param name used to determine which property to add metadata
+ * @param key the metadata key to add
* @param value the metadata value to add
*/
public void setInputPropertyMetadata(String name, String key, String value) {
@@ -83,12 +91,13 @@ public class ResourcePropertiesAssignmentInputTab extends AbstractPageObject {
public void saveInputProperties() {
findElement(By.xpath(XpathSelector.PROPERTY_SAVE_BTN.getXpath())).click();
- waitForElementVisibility(XpathSelector.PROPERTY_SAVE_MESSAGE.getXpath());
- waitForElementInvisibility(By.xpath(XpathSelector.PROPERTY_SAVE_MESSAGE.getXpath()));
+ loaderHelper.waitForLoaderInvisibility(20);
+ notificationComponent.waitForNotification(NotificationType.SUCCESS, 20);
}
/**
- * Adds a input
+ * Adds an input
+ *
* @param inputsMap the inputs map to be added
*/
public void addInputs(final Map<String, String> inputsMap) {
@@ -106,6 +115,7 @@ public class ResourcePropertiesAssignmentInputTab extends AbstractPageObject {
/**
* Fills the creation input modal.
+ *
* @param inputName the input name to be created
* @param inputType the input type to be selected
*/
@@ -118,9 +128,10 @@ public class ResourcePropertiesAssignmentInputTab extends AbstractPageObject {
/**
* Verifies if the added input is displayed on the UI.
+ *
* @param inputsMap the input name to be found
*/
- public void verifyInputs(final Map<String, String> inputsMap ) {
+ public void verifyInputs(final Map<String, String> inputsMap) {
for (Map.Entry<String, String> input : inputsMap.entrySet()) {
assertTrue(this.getInputPropertyNames().contains(input.getKey()),
String.format("%s Input should be listed but found %s", input.getKey(),
@@ -129,7 +140,8 @@ public class ResourcePropertiesAssignmentInputTab extends AbstractPageObject {
}
/**
- * Checks if a input exists.
+ * Checks if an input exists.
+ *
* @param inputName the input name
* @return the value of the input
*/
@@ -143,6 +155,40 @@ public class ResourcePropertiesAssignmentInputTab extends AbstractPageObject {
return true;
}
+ public void setInputValue(final String inputName, final Object value) {
+ if (value == null) {
+ return;
+ }
+
+ if (value instanceof String) {
+ setStringInputValue(inputName, (String) value);
+ return;
+ }
+
+ if (value instanceof Integer) {
+ setStringInputValue(inputName, ((Integer) value).toString());
+ return;
+ }
+
+ if (value instanceof Boolean) {
+ setBooleanPropertyValue(inputName, ((Boolean) value).toString());
+ return;
+ }
+
+ throw new UnsupportedOperationException("Cannot set input value of type: " + value.getClass());
+ }
+
+ private void setStringInputValue(final String inputName, final String value) {
+ isInputPropertiesTableLoaded();
+ findElement(By.xpath(XpathSelector.INPUT_VALUE.formatXpath(buildInputField(inputName)))).sendKeys(value);
+ }
+
+ private void setBooleanPropertyValue(final String inputName, final String value) {
+ isInputPropertiesTableLoaded();
+ new Select(findElement(By.xpath(XpathSelector.INPUT_VALUE_BOOLEAN.formatXpath(buildInputField(inputName)))))
+ .selectByVisibleText(value.toUpperCase());
+ }
+
/**
* Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
*/
@@ -160,6 +206,8 @@ public class ResourcePropertiesAssignmentInputTab extends AbstractPageObject {
INPUT_PROPERTY_ADD_METADATA_BUTTON(INPUT_PROPERTY_TABLE_ROW.getXpath().concat("//a")),
INPUT_PROPERTY_METADATA_KEY_VALUE_PAIR(INPUT_PROPERTY_TABLE_ROW.getXpath().concat("//input")),
INPUT_ADD_BTN("//div[contains(@class,'add-btn')]"),
+ INPUT_VALUE("//input[contains(@class,'value-input') and @data-tests-id='%s']"),
+ INPUT_VALUE_BOOLEAN("//select[@data-tests-id='%s']"),
MODAL_BACKGROUND("//div[@class='modal-background']");
@Getter
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourcePropertiesAssignmentPage.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourcePropertiesAssignmentPage.java
index cb4345c7cc..81c46a7907 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourcePropertiesAssignmentPage.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourcePropertiesAssignmentPage.java
@@ -45,8 +45,8 @@ public class ResourcePropertiesAssignmentPage extends ComponentPage {
@Override
public void isLoaded() {
super.isLoaded();
- waitForElementVisibility((By.xpath(XpathSelector.MAIN_DIV.getXpath())));
- waitForElementVisibility(By.xpath(XpathSelector.TITLE_DIV.getXpath()));
+ waitForElementVisibility(XpathSelector.MAIN_DIV.getXpath());
+ waitForElementVisibility(XpathSelector.TITLE_DIV.getXpath());
resourcePropertiesAssignmentTab.isLoaded();
}
@@ -54,7 +54,7 @@ public class ResourcePropertiesAssignmentPage extends ComponentPage {
* Select the Properties Tab to be displayed
*/
public void selectPropertiesTab() {
- findElement(By.xpath(XpathSelector.PROPERTIES_TAB.getXpath())).click();
+ findElement(XpathSelector.PROPERTIES_TAB.getXpath()).click();
resourcePropertiesAssignmentTab.isLoaded();
}
@@ -62,7 +62,7 @@ public class ResourcePropertiesAssignmentPage extends ComponentPage {
* Select the Input Tab to be displayed
*/
public void selectInputTab() {
- findElement(By.xpath(XpathSelector.INPUT_TAB.getXpath())).click();
+ findElement(XpathSelector.INPUT_TAB.getXpath()).click();
resourcePropertiesAssignmentInputTab.isLoaded();
}
@@ -74,6 +74,10 @@ public class ResourcePropertiesAssignmentPage extends ComponentPage {
resourcePropertiesAssignmentTab.setPropertyValue(propertyName, value);
}
+ public void setInputValue(final String inputName, final Object value) {
+ resourcePropertiesAssignmentInputTab.setInputValue(inputName, value);
+ }
+
/**
* Retrieves a property value.
*
@@ -130,23 +134,23 @@ public class ResourcePropertiesAssignmentPage extends ComponentPage {
/**
* select property
*/
- public void selectProperty(String propertyName){
+ public void selectProperty(String propertyName) {
resourcePropertiesAssignmentTab.selectProperty(propertyName);
}
- public void loadComponentInstanceProperties(final String instanceName){
+ public void loadComponentInstanceProperties(final String instanceName) {
resourcePropertiesAssignmentTab.loadComponentInstanceProperties(instanceName);
}
- public void clickOnDeclareInput(){
+ public void clickOnDeclareInput() {
resourcePropertiesAssignmentTab.clickOnDeclareInput();
}
- public void loadCompositionTab(){
+ public void loadCompositionTab() {
resourcePropertiesAssignmentTab.loadCompositionTab();
}
- public void clickInputTab(String propertyName){
+ public void clickInputTab(String propertyName) {
waitForElementVisibility(By.xpath(XpathSelector.DECLARE_NOTIFIFICATION.getXpath()));
ExtentTestActions.takeScreenshot(Status.INFO, "Declare-Input", String.format("Added declared input for property %s", propertyName));
selectInputTab();