From c37bada019850822df28e2d28f10b64241467fdf Mon Sep 17 00:00:00 2001 From: franciscovila Date: Tue, 16 Aug 2022 13:00:48 +0100 Subject: Import VFC not importing interfaces Fix when import VFC with Standard Interfaces to ETSI model Issue-ID: SDC-4134 Signed-off-by: franciscovila Change-Id: Ibf6700b406f4b71dcae9327e14fb3ad04ad5e762 --- .../ci/tests/execute/sanity/ImportVfcUiTest.java | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) (limited to 'integration-tests/src') 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 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 map, final ResourceCreateData createdData) { + final Map 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 map) { final Map mapEntry = getMapEntry(map, "node_types"); final Map nodeTypes = getMapEntry(mapEntry, mapEntry.keySet().iterator().next()); -- cgit 1.2.3-korg