summaryrefslogtreecommitdiffstats
path: root/integration-tests
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2022-06-21 15:06:12 +0100
committerMichael Morris <michael.morris@est.tech>2022-06-22 16:33:39 +0000
commitfbab79aeaccf74385c9a55b697a1055a86bdf171 (patch)
tree8fa0640b7d26298c3bcb805098c88dfabd036c8c /integration-tests
parent9cbed7bdd05b0bad6814bd3eb1b43562387d4fd7 (diff)
Block interface operation edit in checkedin VFC
VFC interface operation could be edited even when checked in, due to an incorrect viewOnly input passed to the modal component. Blocks edition also in the backend, by verifying if the component can be edited. Change-Id: I816e28897273aaa677237ca55794bb3dc8460975 Issue-ID: SDC-4058 Signed-off-by: andre.schmid <andre.schmid@est.tech> Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
Diffstat (limited to 'integration-tests')
-rw-r--r--integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/ImportVfcUiTest.java16
-rw-r--r--integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/GoToInterfaceDefinitionPageFlow.java (renamed from integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/InterfaceDefinitionFlow.java)8
-rw-r--r--integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/InterfaceDefinitionOperationsModal.java10
3 files changed, 17 insertions, 17 deletions
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/ImportVfcUiTest.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/ImportVfcUiTest.java
index e1705a2255..ba4b6d77fe 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/ImportVfcUiTest.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/ImportVfcUiTest.java
@@ -48,7 +48,7 @@ import org.onap.sdc.frontend.ci.tests.flow.AddNodeToCompositionFlow;
import org.onap.sdc.frontend.ci.tests.flow.CreateVfFlow;
import org.onap.sdc.frontend.ci.tests.flow.CreateVfcFlow;
import org.onap.sdc.frontend.ci.tests.flow.DownloadCsarArtifactFlow;
-import org.onap.sdc.frontend.ci.tests.flow.InterfaceDefinitionFlow;
+import org.onap.sdc.frontend.ci.tests.flow.GoToInterfaceDefinitionPageFlow;
import org.onap.sdc.frontend.ci.tests.flow.exception.UiTestFlowRuntimeException;
import org.onap.sdc.frontend.ci.tests.pages.AttributeModal;
import org.onap.sdc.frontend.ci.tests.pages.AttributesPage;
@@ -144,14 +144,14 @@ public class ImportVfcUiTest extends SetupCDTest {
}
private ComponentPage viewInterfaceDefinitionFromVFC(final ComponentPage componentPage) {
- final InterfaceDefinitionFlow interfaceDefinitionFlow = new InterfaceDefinitionFlow(webDriver);
- interfaceDefinitionFlow.run(componentPage);
- final InterfaceDefinitionPage interfaceDefinitionPage = interfaceDefinitionFlow.getLandedPage()
+ final GoToInterfaceDefinitionPageFlow goToInterfaceDefinitionPageFlow = new GoToInterfaceDefinitionPageFlow(webDriver);
+ goToInterfaceDefinitionPageFlow.run(componentPage);
+ final InterfaceDefinitionPage interfaceDefinitionPage = goToInterfaceDefinitionPageFlow.getLandedPage()
.orElseThrow(() -> new UiTestFlowRuntimeException("Missing expected return InterfaceDefinitionPage"));
- final var OPERATION_NAME = "create";
- assertTrue(interfaceDefinitionPage.isInterfaceDefinitionOperationPresent(OPERATION_NAME));
- final InterfaceDefinitionOperationsModal interfaceDefinitionOperationsModal = interfaceDefinitionPage.clickOnInterfaceDefinitionOperation(
- OPERATION_NAME);
+ final var operationName = "create";
+ assertTrue(interfaceDefinitionPage.isInterfaceDefinitionOperationPresent(operationName));
+ final InterfaceDefinitionOperationsModal interfaceDefinitionOperationsModal =
+ interfaceDefinitionPage.clickOnInterfaceDefinitionOperation(operationName);
interfaceDefinitionOperationsModal.isLoaded(true);
ExtentTestActions
.takeScreenshot(Status.INFO, "clickOnOInterfaceOperation", "Interface Definition Operation Modal opened");
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/InterfaceDefinitionFlow.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/GoToInterfaceDefinitionPageFlow.java
index a0955ff800..72ae269b4e 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/InterfaceDefinitionFlow.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/GoToInterfaceDefinitionPageFlow.java
@@ -28,19 +28,19 @@ import org.onap.sdc.frontend.ci.tests.pages.component.workspace.InterfaceDefinit
import org.openqa.selenium.WebDriver;
/**
- * UI Flow for managing an Interface Definition from a component
+ * UI Flow to go to the interfaces page of a VFC from the VFC Workspace
*/
-public class InterfaceDefinitionFlow extends AbstractUiTestFlow {
+public class GoToInterfaceDefinitionPageFlow extends AbstractUiTestFlow {
private InterfaceDefinitionPage interfaceDefinitionPage;
- public InterfaceDefinitionFlow(final WebDriver webDriver) {
+ public GoToInterfaceDefinitionPageFlow(final WebDriver webDriver) {
super(webDriver);
}
@Override
public Optional<PageObject> run(final PageObject... pageObjects) {
- extendTest.log(Status.INFO, "Downloading Tosca CSAR generated");
+ extendTest.log(Status.INFO, "Going to access the Interfaces page from the resource Workspace");
final ComponentPage componentPage = findParameter(pageObjects, ComponentPage.class);
componentPage.isLoaded();
interfaceDefinitionPage = componentPage.goToInterfaceDefinition();
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/InterfaceDefinitionOperationsModal.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/InterfaceDefinitionOperationsModal.java
index 78828d7bbe..160c314665 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/InterfaceDefinitionOperationsModal.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/InterfaceDefinitionOperationsModal.java
@@ -19,8 +19,9 @@
package org.onap.sdc.frontend.ci.tests.pages.component.workspace;
+import static org.onap.sdc.frontend.ci.tests.utilities.GeneralUIUtils.waitForLoader;
+
import com.aventstack.extentreports.Status;
-import java.time.Duration;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Getter;
@@ -30,9 +31,6 @@ 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.interactions.Actions;
-
-import static org.onap.sdc.frontend.ci.tests.utilities.GeneralUIUtils.waitForLoader;
/**
* Represents the Composition Interface Operations Modal.
@@ -55,7 +53,9 @@ public class InterfaceDefinitionOperationsModal extends AbstractPageObject {
waitForElementVisibility(By.xpath(XpathSelector.TITLE_SPAN.getXPath()));
waitForElementVisibility(By.xpath(XpathSelector.INTERFACE_NAME_LABEL.getXPath()));
waitForElementVisibility(By.xpath(XpathSelector.OPERATION_NAME_LABEL.getXPath()));
- waitForElementVisibility(By.xpath(XpathSelector.SAVE_BTN.getXPath()));
+ if (!isInViewMode) {
+ waitForElementVisibility(By.xpath(XpathSelector.SAVE_BTN.getXPath()));
+ }
waitToBeClickable(By.xpath(XpathSelector.CANCEL_BTN.getXPath()));
this.inputListComponent = new InterfaceOperationInputListComponent(webDriver);
this.inputListComponent.isLoaded();