diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/datatypes/DataTestIdEnum.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/datatypes/DataTestIdEnum.java
index 7e8f936..506a686 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/datatypes/DataTestIdEnum.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/datatypes/DataTestIdEnum.java
@@ -20,13 +20,12 @@
 
 package org.onap.sdc.frontend.ci.tests.datatypes;
 
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import org.onap.sdc.frontend.ci.tests.pages.TopSearchComponent;
-
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import org.onap.sdc.frontend.ci.tests.pages.TopSearchComponent;
 
 public final class DataTestIdEnum {
 
@@ -42,7 +41,7 @@
         BUTTON_ADD_SERVICE("createServiceButton"),
         IMPORT_VFC("importVFCbutton"),
         IMPORT_VF("importVFbutton"),
-        IMPORT_VFC_FILE("file-importVFCbutton"),
+        IMPORT_VFC_FILE("fileimportVFCbutton"),
         IMPORT_VF_FILE("file-importVFbutton"),
         BUTTON_ADD_PRODUCT("createProductButton"),
         BUTTON_ADD_PNF("createPNFButton"),
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/datatypes/LifeCycleStateEnum.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/datatypes/LifeCycleStateEnum.java
index 4e8dcee..3c6c960 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/datatypes/LifeCycleStateEnum.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/datatypes/LifeCycleStateEnum.java
@@ -20,6 +20,11 @@
 
 package org.onap.sdc.frontend.ci.tests.datatypes;
 
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
 public enum LifeCycleStateEnum {
 
     CHECKOUT("IN DESIGN CHECK OUT"),
@@ -33,15 +38,6 @@
     DISTRIBUTED("DISTRIBUTED"),
     IN_DESIGN("IN DESIGN");
 
-    private String value;
-    private String value2;
-
-    public String getValue() {
-        return value;
-    }
-
-    LifeCycleStateEnum(String value) {
-        this.value = value;
-    }
+    private final String value;
 
 }
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/EtsiOnboardVnfCnfUiTests.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/EtsiOnboardVnfCnfUiTests.java
index 55b4f53..dfe6679 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/EtsiOnboardVnfCnfUiTests.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/EtsiOnboardVnfCnfUiTests.java
@@ -135,7 +135,7 @@
             webDriver);
         workspaceTopBarComponent.isLoaded();
         final ComponentPage componentPage = Optional
-            .of(new ComponentPage(webDriver, topNavComponent, resourceLeftSideMenu, workspaceTopBarComponent))
+            .of(new ComponentPage(webDriver))
             .orElseThrow(() -> new UiTestFlowRuntimeException("Missing expected ComponentPage"));
         componentPage.isLoaded();
         return componentPage;
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
new file mode 100644
index 0000000..336a2fb
--- /dev/null
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/ImportVfcUiTest.java
@@ -0,0 +1,237 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2021 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.execute.sanity;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.anEmptyMap;
+import static org.hamcrest.Matchers.empty;
+import static org.hamcrest.Matchers.emptyString;
+import static org.hamcrest.Matchers.not;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.fail;
+
+import java.util.Arrays;
+import java.util.Map;
+import java.util.Optional;
+import org.onap.sdc.backend.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.onap.sdc.backend.ci.tests.utils.general.ElementFactory;
+import org.onap.sdc.frontend.ci.tests.datatypes.ResourceCreateData;
+import org.onap.sdc.frontend.ci.tests.exception.UnzipException;
+import org.onap.sdc.frontend.ci.tests.execute.setup.DriverFactory;
+import org.onap.sdc.frontend.ci.tests.execute.setup.SetupCDTest;
+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.exception.UiTestFlowRuntimeException;
+import org.onap.sdc.frontend.ci.tests.pages.ResourceCreatePage;
+import org.onap.sdc.frontend.ci.tests.pages.component.workspace.ToscaArtifactsPage;
+import org.onap.sdc.frontend.ci.tests.pages.home.HomePage;
+import org.onap.sdc.frontend.ci.tests.utilities.FileHandling;
+import org.openqa.selenium.WebDriver;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+import org.yaml.snakeyaml.Yaml;
+
+public class ImportVfcUiTest extends SetupCDTest {
+
+    private String filePath;
+    private WebDriver webDriver;
+    private HomePage homePage;
+    private ResourceCreateData vfcCreateData;
+    private ResourceCreateData vfCreateData;
+
+    @BeforeClass
+    public void beforeClass() {
+        filePath = FileHandling.getFilePath("importVfc/");
+    }
+
+    @BeforeSuite
+    public void beforeSuite() {
+        webDriver = DriverFactory.getDriver();
+        homePage = new HomePage(webDriver);
+    }
+
+    @Test
+    public void importVFC_createVF_addVFC2VF_test() throws UnzipException {
+        // TC - Import VFC with root namespace
+        String fileName = "org.openecomp.resource.VFC-root.yml";
+        CreateVfcFlow createVfcFlow = createVFC(fileName);
+
+        createVfcFlow.getLandedPage().get().clickOnCertify();
+
+        Map<String, Object> yamlObject = downloadToscaArtifact(createVfcFlow.getLandedPage().get());
+        checkMetadata(yamlObject, vfcCreateData);
+        checkNodeTypes(yamlObject);
+        homePage.getTopNavComponent().clickOnHome();
+
+        // TC - Import hierarchy of VFCs
+        fileName = "org.openecomp.resource.VFC-child.yml";
+        createVfcFlow = createVFC(fileName);
+        createVfcFlow.getLandedPage().get().clickOnCertify();
+
+        yamlObject = downloadToscaArtifact(createVfcFlow.getLandedPage().get());
+        checkMetadata(yamlObject, vfcCreateData);
+        checkNodeTypes(yamlObject);
+        homePage.getTopNavComponent().clickOnHome();
+
+        // TC - Import VFC with interface inputs
+        // TC - Import VFC with attributes
+        final CreateVfFlow createVfFlow = createVF();
+
+        final AddNodeToCompositionFlow addNodeToCompositionFlow = addNodeToCompositionFlow(createVfFlow);
+
+        createVfFlow.getLandedPage().get().clickOnCertify();
+        yamlObject = downloadToscaArtifact(createVfFlow.getLandedPage().get());
+        checkMetadata(yamlObject, vfCreateData);
+        checkTopologyTemplate(yamlObject);
+
+    }
+
+    private AddNodeToCompositionFlow addNodeToCompositionFlow(final CreateVfFlow createVfFlow) {
+        final AddNodeToCompositionFlow addNodeToCompositionFlow = new AddNodeToCompositionFlow(webDriver, vfCreateData, vfcCreateData);
+        addNodeToCompositionFlow.run(createVfFlow.getLandedPage().get());
+        return addNodeToCompositionFlow;
+    }
+
+    private Map<String, Object> downloadToscaArtifact(final ResourceCreatePage resourceCreatePage) throws UnzipException {
+        final DownloadCsarArtifactFlow downloadCsarArtifactFlow = downloadCsarArtifact(resourceCreatePage);
+        final ToscaArtifactsPage toscaArtifactsPage = downloadCsarArtifactFlow.getLandedPage()
+            .orElseThrow(() -> new UiTestFlowRuntimeException("Missing expected ToscaArtifactsPage"));
+
+        assertThat("No artifact download was found", toscaArtifactsPage.getDownloadedArtifactList(), not(empty()));
+        final String downloadedCsarName = toscaArtifactsPage.getDownloadedArtifactList().get(0);
+        final String downloadFolderPath = getConfig().getDownloadAutomationFolder();
+        final Map<String, byte[]> filesFromZip = FileHandling.getFilesFromZip(downloadFolderPath, downloadedCsarName);
+        final Optional<String> resourceEntryOpt = filesFromZip.keySet().stream()
+            .filter(s -> s.equals("Definitions/" + downloadedCsarName.replace("-csar.csar", "-template.yml")))
+            .findFirst();
+        if (resourceEntryOpt.isEmpty()) {
+            fail("Could not find the resource package in Definitions");
+        }
+        return loadYamlObject(filesFromZip.get(resourceEntryOpt.get()));
+    }
+
+    private Map<String, Object> getMapEntry(final Map<String, Object> yamlObj, final String entryName) {
+        try {
+            return (Map<String, Object>) yamlObj.get(entryName);
+        } catch (final Exception e) {
+            final String errorMsg = String.format("Could not get the '%s' entry.", entryName);
+            fail(errorMsg + "Error message: " + e.getMessage());
+        }
+        return null;
+    }
+
+    private Map<String, Object> loadYamlObject(final byte[] mainDefinitionFileBytes) {
+        return new Yaml().load(new String(mainDefinitionFileBytes));
+    }
+
+    private DownloadCsarArtifactFlow downloadCsarArtifact(final ResourceCreatePage resourceCreatePage) {
+        final DownloadCsarArtifactFlow downloadCsarArtifactFlow = new DownloadCsarArtifactFlow(webDriver);
+        downloadCsarArtifactFlow.setWaitBeforeGetTheFile(5L);
+        downloadCsarArtifactFlow.run(resourceCreatePage);
+        return downloadCsarArtifactFlow;
+    }
+
+    private CreateVfcFlow createVFC(final String fileName) {
+        vfcCreateData = createVfcFormData();
+        final CreateVfcFlow createVfcFlow = new CreateVfcFlow(webDriver, vfcCreateData, filePath + fileName);
+        createVfcFlow.run(homePage);
+        return createVfcFlow;
+    }
+
+    private CreateVfFlow createVF() {
+        vfCreateData = createVfFormData();
+        final CreateVfFlow createVfFlow = new CreateVfFlow(webDriver, vfCreateData);
+        createVfFlow.run(homePage);
+        return createVfFlow;
+    }
+
+    private ResourceCreateData createVfcFormData() {
+        final ResourceCreateData vfcCreateData = new ResourceCreateData();
+        vfcCreateData.setRandomName(ElementFactory.getResourcePrefix() + "-VFC");
+        vfcCreateData.setCategory(ResourceCategoryEnum.NETWORK_L4.getSubCategory());
+        vfcCreateData.setTagList(Arrays.asList(vfcCreateData.getName(), "importVFC"));
+        vfcCreateData.setDescription("aDescription");
+        vfcCreateData.setVendorName("Ericsson");
+        vfcCreateData.setVendorRelease("1.2.3");
+        vfcCreateData.setVendorModelNumber("4.5.6");
+        return vfcCreateData;
+    }
+
+    private ResourceCreateData createVfFormData() {
+        final ResourceCreateData vfCreateData = new ResourceCreateData();
+        vfCreateData.setRandomName(ElementFactory.getResourcePrefix() + "-VF");
+        vfCreateData.setCategory(ResourceCategoryEnum.NETWORK_L4.getSubCategory());
+        vfCreateData.setTagList(Arrays.asList(vfCreateData.getName(), "createVF"));
+        vfCreateData.setDescription("aDescription");
+        vfCreateData.setVendorName("Ericsson");
+        vfCreateData.setVendorRelease("6.5.4");
+        vfCreateData.setVendorModelNumber("3.2.1");
+        return vfCreateData;
+    }
+
+    private void checkMetadata(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("Network 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());
+
+        assertNotNull(nodeTypes);
+        assertEquals("aDescription", nodeTypes.get("description"));
+
+        final Map<String, Object> properties = getMapEntry(nodeTypes, "properties");
+        assertThat(properties, not(anEmptyMap()));
+
+        final Map<String, Object> attributes = getMapEntry(nodeTypes, "attributes");
+        assertThat(attributes, not(anEmptyMap()));
+
+        final Map<String, Object> interfaces = getMapEntry(nodeTypes, "interfaces");
+        assertThat(interfaces, not(anEmptyMap()));
+
+    }
+
+    private void checkTopologyTemplate(final Map<String, Object> map) {
+        final Map<String, Object> mapEntry = getMapEntry(map, "topology_template");
+        assertNotNull(mapEntry);
+
+        final Map<String, Object> properties = getMapEntry(mapEntry, "inputs");
+        assertThat(properties, not(anEmptyMap()));
+
+        final Map<String, Object> attributes = getMapEntry(mapEntry, "node_templates");
+        assertThat(attributes, not(anEmptyMap()));
+
+        final Map<String, Object> interfaces = getMapEntry(mapEntry, "substitution_mappings");
+        assertThat(interfaces, not(anEmptyMap()));
+
+    }
+}
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/AddNodeToCompositionFlow.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/AddNodeToCompositionFlow.java
new file mode 100644
index 0000000..fbc311d
--- /dev/null
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/AddNodeToCompositionFlow.java
@@ -0,0 +1,45 @@
+package org.onap.sdc.frontend.ci.tests.flow;
+
+import com.aventstack.extentreports.Status;
+import java.util.Objects;
+import java.util.Optional;
+import org.onap.sdc.frontend.ci.tests.datatypes.ResourceCreateData;
+import org.onap.sdc.frontend.ci.tests.pages.PageObject;
+import org.onap.sdc.frontend.ci.tests.pages.ResourceCreatePage;
+import org.onap.sdc.frontend.ci.tests.pages.component.workspace.CompositionPage;
+import org.openqa.selenium.WebDriver;
+
+public class AddNodeToCompositionFlow extends AbstractUiTestFlow {
+
+    private final ResourceCreateData destination;
+    private final ResourceCreateData resource;
+    private CompositionPage compositionPage;
+    private ResourceCreatePage resourceCreatePage;
+
+    public AddNodeToCompositionFlow(final WebDriver webDriver, final ResourceCreateData destination, final ResourceCreateData resource) {
+        super(webDriver);
+        this.destination = destination;
+        this.resource = resource;
+    }
+
+    @Override
+    public Optional<? extends PageObject> run(final PageObject... pageObjects) {
+        Objects.requireNonNull(destination);
+        Objects.requireNonNull(resource);
+        extendTest.log(Status.INFO, String.format("Adding Resource '%s' to VF/Service '%s'", resource.getName(), destination.getName()));
+
+        resourceCreatePage = findParameter(pageObjects, ResourceCreatePage.class);
+        resourceCreatePage.isLoaded();
+
+        compositionPage = resourceCreatePage.goToComposition();
+        compositionPage.isLoaded();
+        compositionPage.addNodeToResourceCompositionUsingApi(destination.getName(), "0.1", resource.getName(), "1.0");
+        compositionPage.goToGeneral();
+        return Optional.of(compositionPage);
+    }
+
+    @Override
+    public Optional<? extends PageObject> getLandedPage() {
+        return Optional.ofNullable(resourceCreatePage);
+    }
+}
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CreateVfFlow.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CreateVfFlow.java
new file mode 100644
index 0000000..898b278
--- /dev/null
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CreateVfFlow.java
@@ -0,0 +1,61 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2021 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.Objects;
+import java.util.Optional;
+import org.onap.sdc.frontend.ci.tests.datatypes.ResourceCreateData;
+import org.onap.sdc.frontend.ci.tests.pages.PageObject;
+import org.onap.sdc.frontend.ci.tests.pages.ResourceCreatePage;
+import org.onap.sdc.frontend.ci.tests.pages.component.workspace.CompositionPage;
+import org.onap.sdc.frontend.ci.tests.pages.home.HomePage;
+import org.openqa.selenium.WebDriver;
+
+public class CreateVfFlow extends AbstractUiTestFlow {
+
+    private final ResourceCreateData vfCreateData;
+    private ResourceCreatePage vfCreatePage;
+
+    public CreateVfFlow(final WebDriver webDriver, final ResourceCreateData vfCreateData) {
+        super(webDriver);
+        this.vfCreateData = vfCreateData;
+    }
+
+    @Override
+    public Optional<? extends PageObject> run(final PageObject... pageObjects) {
+        Objects.requireNonNull(vfCreateData);
+        extendTest.log(Status.INFO, String.format("Creating VF '%s'", vfCreateData.getName()));
+        final HomePage homePage = findParameter(pageObjects, HomePage.class);
+        homePage.isLoaded();
+
+        vfCreatePage = homePage.clickOnAddVf();
+        vfCreatePage.isLoaded();
+        vfCreatePage.fillForm(vfCreateData);
+
+        vfCreatePage.clickOnCreate();
+        return Optional.of(vfCreatePage);
+    }
+
+    @Override
+    public Optional<ResourceCreatePage> getLandedPage() {
+        return Optional.ofNullable(vfCreatePage);
+    }
+
+}
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CreateVfcFlow.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CreateVfcFlow.java
new file mode 100644
index 0000000..94f69c1
--- /dev/null
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CreateVfcFlow.java
@@ -0,0 +1,63 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2021 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.Objects;
+import java.util.Optional;
+import org.onap.sdc.frontend.ci.tests.datatypes.ResourceCreateData;
+import org.onap.sdc.frontend.ci.tests.pages.PageObject;
+import org.onap.sdc.frontend.ci.tests.pages.ResourceCreatePage;
+import org.onap.sdc.frontend.ci.tests.pages.home.HomePage;
+import org.openqa.selenium.WebDriver;
+
+public class CreateVfcFlow extends AbstractUiTestFlow {
+
+    private final ResourceCreateData vfcCreateData;
+    private final String fullFileName;
+    private HomePage homePage;
+    private ResourceCreatePage vfcCreatePage;
+
+    public CreateVfcFlow(final WebDriver webDriver, final ResourceCreateData vfcCreateData, final String fullFileName) {
+        super(webDriver);
+        this.vfcCreateData = vfcCreateData;
+        this.fullFileName = fullFileName;
+    }
+
+    @Override
+    public Optional<? extends PageObject> run(final PageObject... pageObjects) {
+        Objects.requireNonNull(vfcCreateData);
+        extendTest.log(Status.INFO, String.format("Creating VFC '%s'", vfcCreateData.getName()));
+        homePage = findParameter(pageObjects, HomePage.class);
+        homePage.isLoaded();
+
+        vfcCreatePage = homePage.clickOnImportVfc(fullFileName);
+        vfcCreatePage.isLoaded();
+        vfcCreatePage.fillForm(vfcCreateData);
+
+        vfcCreatePage.clickOnCreate();
+        return Optional.of(vfcCreatePage);
+    }
+
+    @Override
+    public Optional<ResourceCreatePage> getLandedPage() {
+        return Optional.ofNullable(vfcCreatePage);
+    }
+
+}
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/DownloadCsarArtifactFlow.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/DownloadCsarArtifactFlow.java
index a325f2b..621d512 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/DownloadCsarArtifactFlow.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/DownloadCsarArtifactFlow.java
@@ -27,17 +27,21 @@
 import java.io.File;
 import java.time.Duration;
 import java.util.Optional;
+import lombok.Setter;
 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.ServiceComponentPage;
 import org.onap.sdc.frontend.ci.tests.pages.component.workspace.ToscaArtifactsPage;
 import org.onap.sdc.frontend.ci.tests.utilities.FileHandling;
 import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.interactions.Actions;
 import org.openqa.selenium.support.ui.FluentWait;
 
 public class DownloadCsarArtifactFlow extends AbstractUiTestFlow {
 
     private ToscaArtifactsPage toscaArtifactsPage;
+    @Setter
+    private long waitBeforeGetTheFile = 0L;
 
     public DownloadCsarArtifactFlow(final WebDriver webDriver) {
         super(webDriver);
@@ -45,16 +49,16 @@
 
     @Override
     public Optional<PageObject> run(final PageObject... pageObjects) {
-        final ServiceComponentPage serviceComponentPage = findParameter(pageObjects, ServiceComponentPage.class);
-        toscaArtifactsPage = serviceComponentPage.goToToscaArtifacts();
+        final ComponentPage componentPage = findParameter(pageObjects, ComponentPage.class);
+        toscaArtifactsPage = (ToscaArtifactsPage) componentPage.goToToscaArtifacts();
         toscaArtifactsPage.isLoaded();
-        toscaArtifactsPage.clickOnDownload("Tosca Model");
 
+        toscaArtifactsPage.clickOnDownload("Tosca Model");
         final File downloadedCsar = waitAndGetDowloadedCsar();
         assertThat("The downloaded CSAR should exist", downloadedCsar, is(notNullValue()));
         assertThat("The downloaded CSAR should exist", downloadedCsar.exists(), is(true));
         toscaArtifactsPage.addToDownloadedArtifactList(downloadedCsar.getName());
-        ExtentTestActions.takeScreenshot(Status.INFO, "etsi-ns-csar-downloaded", "ETSI NS CSAR downloaded");
+        ExtentTestActions.takeScreenshot(Status.INFO, "tosca-artifact-csar-download", "TOSCA Artifact downloaded");
 
         return Optional.of(toscaArtifactsPage);
     }
@@ -65,8 +69,8 @@
     }
 
     private File waitAndGetDowloadedCsar() {
-        final FluentWait<String> fluentWait = new FluentWait<>("")
-            .withTimeout(Duration.ofSeconds(5)).pollingEvery(Duration.ofSeconds(1));
+        new Actions(webDriver).pause(Duration.ofSeconds(waitBeforeGetTheFile)).perform();
+        final FluentWait<String> fluentWait = new FluentWait<>("").withTimeout(Duration.ofSeconds(5)).pollingEvery(Duration.ofSeconds(1));
         fluentWait.until(s -> FileHandling.getLastModifiedFileNameFromDir() != null);
         return FileHandling.getLastModifiedFileNameFromDir();
     }
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/AbstractPageObject.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/AbstractPageObject.java
index 2564d0d..5983970 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/AbstractPageObject.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/AbstractPageObject.java
@@ -16,17 +16,15 @@
  *  SPDX-License-Identifier: Apache-2.0
  *  ============LICENSE_END=========================================================
  */
-
 package org.onap.sdc.frontend.ci.tests.pages;
 
+import java.util.List;
 import org.openqa.selenium.By;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.support.ui.ExpectedConditions;
 import org.openqa.selenium.support.ui.WebDriverWait;
 
-import java.util.List;
-
 /**
  * Base UI test object that represents a page or component in a html page
  */
@@ -90,7 +88,7 @@
      * Find an element inside the provided element using the provided xpath.
      *
      * @param element the parent element
-     * @param xpath the xpath expression to search for the internal element
+     * @param xpath   the xpath expression to search for the internal element
      * @return the WebElement if found, otherwise throws an exception
      */
     protected WebElement findSubElement(final WebElement element, final String xpath) {
@@ -143,7 +141,7 @@
     /**
      * Waits for element visibility with the provided timeout.
      *
-     * @param locator the By locator to search for the element
+     * @param locator          the By locator to search for the element
      * @param timeoutInSeconds the wait timeout in seconds
      * @return the WebElement if visible before timeout, otherwise throws an exception
      */
@@ -166,7 +164,7 @@
     /**
      * Waits for element invisibility with the provided timeout.
      *
-     * @param locator the By locator to search for the element
+     * @param locator          the By locator to search for the element
      * @param timeoutInSeconds the wait timeout in seconds
      * @return the WebElement if invisible before timeout, false otherwise
      */
@@ -177,6 +175,7 @@
 
     /**
      * Waits elements to be clickable with the default timeout.
+     *
      * @param xpath the xpath to find the element(s)
      * @return the WebElement if clickable before timeout, otherwise throws an exception
      */
@@ -186,6 +185,7 @@
 
     /**
      * Waits elements to be clickable with the default timeout.
+     *
      * @param locator the By locator to search for the element(s)
      * @return the WebElement if clickable before timeout, otherwise throws an exception
      */
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ComponentPage.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ComponentPage.java
index 13ab884..50ee327 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ComponentPage.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ComponentPage.java
@@ -16,7 +16,6 @@
  *  SPDX-License-Identifier: Apache-2.0
  *  ============LICENSE_END=========================================================
  */
-
 package org.onap.sdc.frontend.ci.tests.pages;
 
 import org.onap.sdc.frontend.ci.tests.pages.component.workspace.ToscaArtifactsPage;
@@ -28,13 +27,11 @@
     private final ResourceLeftSideMenu resourceLeftSideMenu;
     private final ResourceWorkspaceTopBarComponent workspaceTopBarComponent;
 
-    public ComponentPage(final WebDriver webDriver, final TopNavComponent topNavComponent,
-                         final ResourceLeftSideMenu resourceLeftSideMenu,
-                         final ResourceWorkspaceTopBarComponent workspaceTopBarComponent) {
+    public ComponentPage(final WebDriver webDriver) {
         super(webDriver);
-        this.topNavComponent = topNavComponent;
-        this.resourceLeftSideMenu = resourceLeftSideMenu;
-        this.workspaceTopBarComponent = workspaceTopBarComponent;
+        this.topNavComponent = new TopNavComponent(webDriver);
+        this.resourceLeftSideMenu = new ResourceLeftSideMenu(webDriver);
+        this.workspaceTopBarComponent = new ResourceWorkspaceTopBarComponent(webDriver);
     }
 
     @Override
@@ -47,5 +44,4 @@
     public ToscaArtifactsPage goToToscaArtifacts() {
         return resourceLeftSideMenu.clickOnToscaArtifactsMenuItem();
     }
-
 }
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourceCreatePage.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourceCreatePage.java
index 025c42a..3737577 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourceCreatePage.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourceCreatePage.java
@@ -21,33 +21,46 @@
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.equalToIgnoringCase;
+import static org.hamcrest.Matchers.startsWithIgnoringCase;
 import static org.hamcrest.core.Is.is;
 
+import java.util.List;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
+import org.onap.sdc.frontend.ci.tests.datatypes.DataTestIdEnum;
 import org.onap.sdc.frontend.ci.tests.datatypes.LifeCycleStateEnum;
 import org.onap.sdc.frontend.ci.tests.datatypes.ResourceCreateData;
+import org.onap.sdc.frontend.ci.tests.pages.component.workspace.CompositionPage;
+import org.onap.sdc.frontend.ci.tests.pages.component.workspace.ToscaArtifactsPage;
+import org.onap.sdc.frontend.ci.tests.utilities.GeneralUIUtils;
 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.Keys;
 import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
 import org.openqa.selenium.support.ui.Select;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Handles the Resource Create Page UI actions
  */
-public class ResourceCreatePage extends AbstractPageObject {
+public class ResourceCreatePage extends ComponentPage {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(ResourceCreatePage.class);
     private final LoaderHelper loaderHelper;
     private final NotificationComponent notificationComponent;
     private final ResourceWorkspaceTopBarComponent topBarComponent;
+    private final ResourceLeftSideMenu resourceLeftSideMenu;
 
     public ResourceCreatePage(final WebDriver webDriver) {
         super(webDriver);
-        loaderHelper = new LoaderHelper(webDriver);
-        notificationComponent = new NotificationComponent(webDriver);
-        topBarComponent = new ResourceWorkspaceTopBarComponent(webDriver);
+        this.loaderHelper = new LoaderHelper(webDriver);
+        this.notificationComponent = new NotificationComponent(webDriver);
+        this.resourceLeftSideMenu = new ResourceLeftSideMenu(webDriver);
+        this.topBarComponent = new ResourceWorkspaceTopBarComponent(webDriver);
         timeoutInSeconds = 5;
     }
 
@@ -56,7 +69,7 @@
         topBarComponent.isLoaded();
         final String lifeCycleState = topBarComponent.getLifecycleState();
         assertThat("Life cycle state should be as expected",
-            lifeCycleState, is(equalToIgnoringCase(LifeCycleStateEnum.IN_DESIGN.getValue())));
+            lifeCycleState, is(startsWithIgnoringCase(LifeCycleStateEnum.IN_DESIGN.getValue())));
     }
 
     /**
@@ -68,9 +81,30 @@
         notificationComponent.waitForNotification(NotificationType.SUCCESS, 20);
     }
 
+    /**
+     * Certify the resource and wait for success notification.
+     */
+    public void clickOnCertify() {
+        topBarComponent.clickOnCertify();
+        findElement(By.xpath(XpathSelector.APPROVE_MESSAGE.getXpath())).sendKeys("Resource certified successfully");
+        GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ModalItems.OK.getValue()).click();
+        notificationComponent.waitForNotification(NotificationType.SUCCESS, 20);
+    }
+
+    public ToscaArtifactsPage goToToscaArtifacts() {
+        resourceLeftSideMenu.isLoaded();
+        return resourceLeftSideMenu.clickOnToscaArtifactsMenuItem();
+    }
+
+    public CompositionPage goToComposition() {
+        resourceLeftSideMenu.isLoaded();
+        return resourceLeftSideMenu.clickOnCompositionMenuItem();
+    }
+
     public void fillForm(final ResourceCreateData resourceCreateData) {
         fillName(resourceCreateData.getName());
         setCategory(resourceCreateData.getCategory());
+        defineTags(resourceCreateData.getTagList());
         fillDescription(resourceCreateData.getDescription());
         fillContactId(resourceCreateData.getContactId());
         fillVendorName(resourceCreateData.getVendorName());
@@ -78,31 +112,40 @@
         fillVendorModelNumber(resourceCreateData.getVendorModelNumber());
     }
 
-    public void fillName(final String name) {
+    private void fillName(final String name) {
         setInputField(By.xpath(XpathSelector.NAME_INPUT.getXpath()), name);
     }
 
-    public void setCategory(final String category) {
+    private void setCategory(final String category) {
         setSelectField(By.xpath(XpathSelector.CATEGORY_SELECT.getXpath()), category);
     }
 
-    public void fillDescription(final String description) {
+    private void defineTags(final List<String> tagList) {
+        final WebElement tagsTextbox = findElement(By.xpath(XpathSelector.TAGS.getXpath()));
+        for (final String tag : tagList) {
+            tagsTextbox.clear();
+            tagsTextbox.sendKeys(tag);
+            tagsTextbox.sendKeys(Keys.ENTER);
+        }
+    }
+
+    private void fillDescription(final String description) {
         setTextAreaField(By.xpath(XpathSelector.DESCRIPTION_TEXT_AREA.getXpath()), description);
     }
 
-    public void fillContactId(final String contactId) {
+    private void fillContactId(final String contactId) {
         setInputField(By.xpath(XpathSelector.CONTACT_ID_INPUT.getXpath()), contactId);
     }
 
-    public void fillVendorName(final String vendorName) {
+    private void fillVendorName(final String vendorName) {
         setInputField(By.xpath(XpathSelector.VENDOR_NAME_INPUT.getXpath()), vendorName);
     }
 
-    public void fillVendorRelease(final String vendorRelease) {
+    private void fillVendorRelease(final String vendorRelease) {
         setInputField(By.xpath(XpathSelector.VENDOR_RELEASE_INPUT.getXpath()), vendorRelease);
     }
 
-    public void fillVendorModelNumber(final String vendorModelNumber) {
+    private void fillVendorModelNumber(final String vendorModelNumber) {
         setInputField(By.xpath(XpathSelector.VENDOR_MODEL_NUMBER_INPUT.getXpath()), vendorModelNumber);
     }
 
@@ -131,10 +174,12 @@
     private enum XpathSelector {
         NAME_INPUT("name", "//input[@data-tests-id='%s']"),
         CATEGORY_SELECT("selectGeneralCategory", "//select[@data-tests-id='%s']"),
+        TAGS("i-sdc-tag-input", "//input[@data-tests-id='%s']"),
         DESCRIPTION_TEXT_AREA("description", "//textarea[@data-tests-id='%s']"),
         CONTACT_ID_INPUT("contactId", "//input[@data-tests-id='%s']"),
         VENDOR_NAME_INPUT("vendorName", "//input[@data-tests-id='%s']"),
         VENDOR_RELEASE_INPUT("vendorRelease", "//input[@data-tests-id='%s']"),
+        APPROVE_MESSAGE("checkindialog", "//textarea[@data-tests-id='%s']"),
         VENDOR_MODEL_NUMBER_INPUT("resourceVendorModelNumber", "//input[@data-tests-id='%s']");
 
         @Getter
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourceWorkspaceTopBarComponent.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourceWorkspaceTopBarComponent.java
index f92069e..942c32a 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourceWorkspaceTopBarComponent.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourceWorkspaceTopBarComponent.java
@@ -16,7 +16,6 @@
  *  SPDX-License-Identifier: Apache-2.0
  *  ============LICENSE_END=========================================================
  */
-
 package org.onap.sdc.frontend.ci.tests.pages;
 
 import lombok.AllArgsConstructor;
@@ -56,6 +55,10 @@
         waitToBeClickable(XpathSelector.CREATE_BTN.getXpath()).click();
     }
 
+    public void clickOnCertify() {
+        waitToBeClickable(XpathSelector.CERTIFY_BTN.getXpath()).click();
+    }
+
     public String getLifecycleState() {
         return lifecycleStateDiv.findElement(By.xpath(XpathSelector.FORM_LIFE_CYCLE_STATE.getXpath())).getText();
     }
@@ -70,6 +73,7 @@
         VERSION_CONTAINER_DIV("version-container", "//div[@class='%s']"),
         ACTION_BUTTON_DIV("sdc-workspace-top-bar-buttons", "//div[@class='%s']"),
         CREATE_BTN("create/save", "//button[@data-tests-id='%s']"),
+        CERTIFY_BTN("certify", "//button[@data-tests-id='%s']"),
         FORM_LIFE_CYCLE_STATE("formlifecyclestate", "//span[@data-tests-id='%s']");
 
         @Getter
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceComponentPage.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceComponentPage.java
index a33bdc3..d2b5167 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceComponentPage.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceComponentPage.java
@@ -23,7 +23,7 @@
 import org.onap.sdc.frontend.ci.tests.pages.component.workspace.ToscaArtifactsPage;
 import org.openqa.selenium.WebDriver;
 
-public class ServiceComponentPage extends AbstractPageObject {
+public class ServiceComponentPage extends ComponentPage {
 
     private final TopNavComponent topNavComponent;
     private final ResourceLeftSideMenu resourceLeftSideMenu;
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/CompositionCanvasComponent.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/CompositionCanvasComponent.java
index 6ecea47..f339412 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/CompositionCanvasComponent.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/CompositionCanvasComponent.java
@@ -19,6 +19,8 @@
 
 package org.onap.sdc.frontend.ci.tests.pages.component.workspace;
 
+import static org.onap.sdc.backend.ci.tests.datatypes.enums.UserRoleEnum.DESIGNER;
+
 import com.aventstack.extentreports.Status;
 import com.google.gson.JsonObject;
 import com.google.gson.JsonParser;
@@ -31,7 +33,6 @@
 import lombok.AllArgsConstructor;
 import lombok.Getter;
 import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.onap.sdc.backend.ci.tests.datatypes.enums.UserRoleEnum;
 import org.onap.sdc.backend.ci.tests.utils.general.AtomicOperationUtils;
 import org.onap.sdc.frontend.ci.tests.datatypes.CanvasNodeElement;
 import org.onap.sdc.frontend.ci.tests.exception.CompositionCanvasRuntimeException;
@@ -151,11 +152,11 @@
         final Point pointFromCanvasCenter = calculateOffsetFromCenter(freePositionInCanvas);
         try {
             final Service service =
-                AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, serviceName, serviceVersion);
+                AtomicOperationUtils.getServiceObjectByNameAndVersion(DESIGNER, serviceName, serviceVersion);
             final Resource resourceToAdd =
-                AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceName, resourceVersion);
+                AtomicOperationUtils.getResourceObjectByNameAndVersion(DESIGNER, resourceName, resourceVersion);
             final ComponentInstance componentInstance = AtomicOperationUtils
-                .addComponentInstanceToComponentContainer(resourceToAdd, service, UserRoleEnum.DESIGNER, true,
+                .addComponentInstanceToComponentContainer(resourceToAdd, service, DESIGNER, true,
                     String.valueOf(pointFromCanvasCenter.getX()), String.valueOf(pointFromCanvasCenter.getY()))
                 .left().value();
 
@@ -166,6 +167,24 @@
         }
     }
 
+    public ComponentInstance createNodeOnResourceCanvas(final String serviceName, final String serviceVersion, final String resourceName,
+                                                        final String resourceVersion) {
+        final Point freePositionInCanvas = getFreePositionInCanvas(20);
+        final Point pointFromCanvasCenter = calculateOffsetFromCenter(freePositionInCanvas);
+        try {
+            final Resource service = AtomicOperationUtils.getResourceObjectByNameAndVersion(DESIGNER, serviceName, serviceVersion);
+            final Resource resourceToAdd = AtomicOperationUtils.getResourceObjectByNameAndVersion(DESIGNER, resourceName, resourceVersion);
+            final ComponentInstance componentInstance =
+                AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceToAdd, service, DESIGNER, true,
+                    String.valueOf(pointFromCanvasCenter.getX()), String.valueOf(pointFromCanvasCenter.getY())).left().value();
+
+            LOGGER.debug("Created instance {} in the Service {}", componentInstance.getName(), serviceName);
+            return componentInstance;
+        } catch (final Exception e) {
+            throw new CompositionCanvasRuntimeException("Could not create node through the API", e);
+        }
+    }
+
     private Point getFreePositionInCanvas(int maxAttempts) {
         boolean isPositionFree;
         final int minSpace = 150;
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/CompositionPage.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/CompositionPage.java
index c013247..19a2150 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/CompositionPage.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/CompositionPage.java
@@ -20,6 +20,7 @@
 package org.onap.sdc.frontend.ci.tests.pages.component.workspace;
 
 import org.onap.sdc.frontend.ci.tests.pages.AbstractPageObject;
+import org.onap.sdc.frontend.ci.tests.pages.ResourceCreatePage;
 import org.onap.sdc.frontend.ci.tests.pages.ResourceWorkspaceTopBarComponent;
 import org.onap.sdc.frontend.ci.tests.pages.ServiceComponentPage;
 import org.onap.sdc.frontend.ci.tests.pages.TopNavComponent;
@@ -55,11 +56,16 @@
         compositionDetailSideBarComponent.isLoaded();
     }
 
-    public ComponentInstance addNodeToCompositionUsingApi(final String serviceName, final String serviceVersion, final String resourceName,
+    public ComponentInstance addNodeToServiceCompositionUsingApi(final String serviceName, final String serviceVersion, final String resourceName,
                                                           final String resourceVersion) {
         return compositionCanvasComponent.createNodeOnServiceCanvas(serviceName, serviceVersion, resourceName, resourceVersion);
     }
 
+    public ComponentInstance addNodeToResourceCompositionUsingApi(final String serviceName, final String serviceVersion, final String resourceName,
+                                                          final String resourceVersion) {
+        return compositionCanvasComponent.createNodeOnResourceCanvas(serviceName, serviceVersion, resourceName, resourceVersion);
+    }
+
     /**
      * Select a node in the canvas
      *
@@ -70,9 +76,9 @@
         compositionDetailSideBarComponent.checkComponentIsSelected(nodeName);
     }
 
-    public ServiceComponentPage goToServiceGeneral() {
+    public ResourceCreatePage goToGeneral() {
         topNavComponent.clickOnBreadCrumb(1);
-        return new ServiceComponentPage(webDriver);
+        return new ResourceCreatePage(webDriver);
     }
 
     /**
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/home/HomePage.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/home/HomePage.java
index 7a0d7a1..94568ca 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/home/HomePage.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/home/HomePage.java
@@ -51,6 +51,11 @@
         this.topNavComponent = topNavComponent;
     }
 
+    public HomePage(final WebDriver webDriver) {
+        super(webDriver);
+        this.topNavComponent = new TopNavComponent(webDriver);
+    }
+
     @Override
     public void isLoaded() {
         new Actions(webDriver).pause(Duration.ofSeconds(2)).perform();
@@ -93,6 +98,20 @@
     }
 
     /**
+     * Clicks on the Import VFC button.
+     *
+     * @return the following resource create page
+     */
+    public ResourceCreatePage clickOnImportVfc(final String fullFileName) {
+        clickOnImport(By.xpath(XpathSelector.IMPORT_VFC_BTN.getXpath()), fullFileName);
+        return new ResourceCreatePage(webDriver);
+    }
+
+    private void clickOnImport(final By locator, final String fullFileName) {
+        hoverToImportArea().findElement(locator).sendKeys(fullFileName);
+    }
+
+    /**
      * Clicks on the add PNF button.
      *
      * @return the following resource create page
@@ -102,16 +121,6 @@
         return new ResourceCreatePage(webDriver);
     }
 
-    /**
-     * Clicks on the Import VFC button.
-     *
-     * @return the following resource create page
-     */
-    public ResourceCreatePage clickOnImportVfc() {
-        clickOnImport(By.xpath(XpathSelector.IMPORT_VFC_BTN.getXpath()));
-        return new ResourceCreatePage(webDriver);
-    }
-
     public AbstractPageObject clickOnComponent(final String component) {
         WebElement element = waitForElementVisibility(By.xpath(XpathSelector.COMPONENT.getXpath(component)));
         final WebElement componentTypeDiv = element.findElement(By.xpath("./../../../div[contains(@class, 'sdc-tile-header')]/div"));
@@ -125,17 +134,12 @@
         throw new UnsupportedOperationException("Return not yet implemented for " + text);
     }
 
-
     private void clickOnAdd(final By locator) {
-        hoverToAddArea();
-        waitForElementVisibility(locator);
-        findElement(locator).click();
+        hoverToAddArea().findElement(locator).click();
     }
 
     private void clickOnImport(final By locator) {
-        hoverToImportArea();
-        waitForElementVisibility(locator);
-        findElement(locator).click();
+        hoverToImportArea().findElement(locator).click();
     }
 
     /**
@@ -143,7 +147,7 @@
      *
      * @return the add buttons area element
      */
-    public WebElement hoverToAddArea() {
+    private WebElement hoverToAddArea() {
         return hoverTo(By.xpath(XpathSelector.ADD_BUTTONS_AREA.getXpath()));
     }
 
@@ -152,11 +156,10 @@
      *
      * @return the Import buttons area element
      */
-    public WebElement hoverToImportArea() {
+    private WebElement hoverToImportArea() {
         return hoverTo(By.xpath(XpathSelector.IMPORT_BUTTONS_AREA.getXpath()));
     }
 
-
     private WebElement hoverTo(final By locator) {
         final WebElement addButtonsAreaElement = findElement(locator);
         final Actions actions = new Actions(webDriver);
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/LoaderHelper.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/LoaderHelper.java
index e5bfc2b..b45d329 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/LoaderHelper.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/LoaderHelper.java
@@ -32,7 +32,7 @@
     }
 
     public void waitForLoader(final int timeout) {
-        waitForElementVisibility(loaderLocator, 5);
+        waitForElementVisibility(loaderLocator, timeout);
         waitForElementInvisibility(loaderLocator, timeout);
     }
 
diff --git a/integration-tests/src/test/resources/Files/importVfc/org.openecomp.resource.VFC-child.yml b/integration-tests/src/test/resources/Files/importVfc/org.openecomp.resource.VFC-child.yml
new file mode 100644
index 0000000..2c00cbd
--- /dev/null
+++ b/integration-tests/src/test/resources/Files/importVfc/org.openecomp.resource.VFC-child.yml
@@ -0,0 +1,24 @@
+tosca_definitions_version: tosca_simple_yaml_1_3
+node_types:
+  org.openecomp.resource.VFC-child:
+    derived_from: org.openecomp.resource.VFC-root
+    properties:
+      aProperty:
+        type: string
+        required: false
+    attributes:
+      test_1:
+        type: string
+        default: 'MydefaultValue'
+
+      test_2:
+        type: integer
+        default: 266305
+
+      test_3:
+        type: string
+        default: 'TestValue3'
+
+      test_4:
+        type: boolean
+        default: true
\ No newline at end of file
diff --git a/integration-tests/src/test/resources/Files/importVfc/org.openecomp.resource.VFC-root.yml b/integration-tests/src/test/resources/Files/importVfc/org.openecomp.resource.VFC-root.yml
new file mode 100644
index 0000000..679f1b6
--- /dev/null
+++ b/integration-tests/src/test/resources/Files/importVfc/org.openecomp.resource.VFC-root.yml
@@ -0,0 +1,8 @@
+tosca_definitions_version: tosca_simple_yaml_1_3
+node_types:
+  org.openecomp.resource.VFC-root:
+    derived_from: tosca.nodes.Root
+    properties:
+      aProperty:
+        type: string
+        required: false
\ No newline at end of file
diff --git a/integration-tests/src/test/resources/ci/conf/sdc-conf.yaml b/integration-tests/src/test/resources/ci/conf/sdc-conf.yaml
index e4b07d3..eb20978 100644
--- a/integration-tests/src/test/resources/ci/conf/sdc-conf.yaml
+++ b/integration-tests/src/test/resources/ci/conf/sdc-conf.yaml
@@ -3,18 +3,17 @@
 remoteTestingMachineIP: 127.0.0.1
 remoteTestingMachinePort: 4444
 remoteTesting: true
-useBrowserMobProxy: false
-captureTraffic: false
 downloadAutomationFolder: /tmp/sdc-integration-tests/downloadAutomation
-uiSimulator: true
 
 #### Local Front end testing
 #url: http://localhost:8285/sdc1
 #remoteTesting: false
-#useBrowserMobProxy: false
-#captureTraffic: false
 #downloadAutomationFolder: /tmp/sdc-integration-tests/downloadAutomation
-#uiSimulator: true
+
+#####################
+useBrowserMobProxy: false
+captureTraffic: false
+uiSimulator: true
 
 #### Backend Testing
 outputFolder: target
