summaryrefslogtreecommitdiffstats
path: root/integration-tests/src
diff options
context:
space:
mode:
authorfranciscovila <javier.paradela.vila@est.tech>2022-08-16 13:00:48 +0100
committerMichael Morris <michael.morris@est.tech>2022-09-08 06:32:46 +0000
commitc37bada019850822df28e2d28f10b64241467fdf (patch)
treeb87f8e1c6406daa48e73ea498ac9313ca2fd8e51 /integration-tests/src
parent7dbe567ed096dd03a41803c6aac47c8dda68e220 (diff)
Import VFC not importing interfaces
Fix when import VFC with Standard Interfaces to ETSI model Issue-ID: SDC-4134 Signed-off-by: franciscovila <javier.paradela.vila@est.tech> Change-Id: Ibf6700b406f4b71dcae9327e14fb3ad04ad5e762
Diffstat (limited to 'integration-tests/src')
-rw-r--r--integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/ImportVfcUiTest.java69
1 files changed, 69 insertions, 0 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 72810c5806..4f8a1b80ee 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
@@ -143,6 +143,62 @@ public class ImportVfcUiTest extends SetupCDTest {
}
+ @Test
+ public void importVFC_createVF_etsi_addVFC2VF_test() throws UnzipException {
+ ComponentPage componentPage;
+ // TC - Import VFC with root namespace
+ String fileName = "org.openecomp.resource.VFC-root.yml";
+ String subCategory = ResourceCategoryEnum.GENERIC_DATABASE.getSubCategory();
+ CreateVfcFlow createVfcFlow = createVFC(fileName, ModelName.ETSI_SOL001_v2_5_1.getName(), subCategory);
+
+ componentPage = createVfcFlow.getLandedPage().orElseThrow(() -> new UiTestFlowRuntimeException("Missing expected return ResourceCreatePage"));
+ componentPage.isLoaded();
+ componentPage.certifyComponent();
+ componentPage.isLoaded();
+
+ Map<String, Object> yamlObject = downloadToscaArtifact(componentPage);
+ checkEtsiMetadata(yamlObject, vfcCreateData);
+ checkNodeTypes(yamlObject);
+ homePage.getTopNavComponent().clickOnHome();
+
+ // TC - Import hierarchy of VFCs
+ fileName = "org.openecomp.resource.VFC-child.yml";
+ createVfcFlow = createVFC(fileName, ModelName.ETSI_SOL001_v2_5_1.getName(), subCategory);
+ componentPage = createVfcFlow.getLandedPage().orElseThrow(() -> new UiTestFlowRuntimeException("Missing expected return ResourceCreatePage"));
+ componentPage.isLoaded();
+
+ componentPage = manageAttributes(componentPage);
+ componentPage.isLoaded();
+ componentPage.certifyComponent();
+ componentPage.isLoaded();
+
+ yamlObject = downloadToscaArtifact(componentPage);
+ checkEtsiMetadata(yamlObject, vfcCreateData);
+ checkNodeTypes(yamlObject);
+
+ componentPage = viewInterfaceDefinitionFromVFC(componentPage);
+ componentPage.isLoaded();
+
+ homePage.getTopNavComponent().clickOnHome();
+
+ // TC - Import VFC with interface inputs
+ // TC - Import VFC with attributes
+ final CreateVfFlow createVfFlow = createVF();
+ componentPage = createVfFlow.getLandedPage().orElseThrow(() -> new UiTestFlowRuntimeException("Missing expected return ResourceCreatePage"));
+ componentPage.isLoaded();
+
+ final CompositionPage compositionPage = addInterfaceOperations(componentPage);
+ componentPage = compositionPage.goToGeneral();
+ componentPage.isLoaded();
+ componentPage.certifyComponent();
+ componentPage.isLoaded();
+
+ yamlObject = downloadToscaArtifact(componentPage);
+ checkMetadata(yamlObject, vfCreateData);
+ checkTopologyTemplate(yamlObject);
+
+ }
+
private ComponentPage viewInterfaceDefinitionFromVFC(final ComponentPage componentPage) {
final GoToInterfaceDefinitionPageFlow goToInterfaceDefinitionPageFlow = new GoToInterfaceDefinitionPageFlow(webDriver);
goToInterfaceDefinitionPageFlow.run(componentPage);
@@ -368,6 +424,19 @@ public class ImportVfcUiTest extends SetupCDTest {
assertEquals(createdData.getVendorModelNumber(), metadata.get("reourceVendorModelNumber"));
}
+ private void checkEtsiMetadata(final Map<String, Object> map, final ResourceCreateData createdData) {
+ final Map<String, Object> metadata = getMapEntry(map, "metadata");
+
+ assertEquals(createdData.getName(), metadata.get("name"));
+ assertEquals(createdData.getDescription(), metadata.get("description"));
+ assertEquals("Application L4+", metadata.get("category"));
+ assertThat((String) metadata.get("type"), not(emptyString()));
+ assertEquals(createdData.getCategory(), metadata.get("subcategory"));
+ assertEquals(createdData.getVendorName(), metadata.get("resourceVendor"));
+ assertEquals(createdData.getVendorRelease(), metadata.get("resourceVendorRelease"));
+ assertEquals(createdData.getVendorModelNumber(), metadata.get("reourceVendorModelNumber"));
+ }
+
private void checkNodeTypes(final Map<String, Object> map) {
final Map<String, Object> mapEntry = getMapEntry(map, "node_types");
final Map<String, Object> nodeTypes = getMapEntry(mapEntry, mapEntry.keySet().iterator().next());