diff --git a/catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src/test/java/org/openecomp/sdc/be/plugins/etsi/nfv/nsd/generator/NsDescriptorGeneratorImplTest.java b/catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src/test/java/org/openecomp/sdc/be/plugins/etsi/nfv/nsd/generator/NsDescriptorGeneratorImplTest.java
index 3665149..69d9b0f 100644
--- a/catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src/test/java/org/openecomp/sdc/be/plugins/etsi/nfv/nsd/generator/NsDescriptorGeneratorImplTest.java
+++ b/catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src/test/java/org/openecomp/sdc/be/plugins/etsi/nfv/nsd/generator/NsDescriptorGeneratorImplTest.java
@@ -1,4 +1,3 @@
-
 /*
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2020 Nordix Foundation
@@ -17,6 +16,7 @@
  *  SPDX-License-Identifier: Apache-2.0
  *  ============LICENSE_END=========================================================
  */
+
 package org.openecomp.sdc.be.plugins.etsi.nfv.nsd.generator;
 
 import static org.hamcrest.MatcherAssert.assertThat;
diff --git a/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/config/Config.java b/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/config/Config.java
index fcf79e5..88d6154 100644
--- a/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/config/Config.java
+++ b/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/config/Config.java
@@ -31,7 +31,7 @@
 
 public class Config {
 
-    private static String SDC_DEFAULT_CONFIG_FILE = "src/test/resources/ci/conf/sdc-conf.yaml";
+    private static final String SDC_DEFAULT_CONFIG_FILE = "src/test/resources/ci/conf/sdc-conf.yaml";
     private String downloadAutomationFolder;
     private boolean systemUnderDebug;
     private boolean rerun;
@@ -104,8 +104,7 @@
 
     private static Config configIt = null;
 
-    private static Yaml yaml = new Yaml();
-
+    private static final Yaml yaml = new Yaml();
 
     private Config() {
         super();
@@ -169,18 +168,17 @@
 
     private static Config init() throws IOException {
 
-        Config config = null;
-
         String configFile = System.getProperty("config.resource");
         if (configFile == null) {
             configFile = SDC_DEFAULT_CONFIG_FILE;
         }
 
-        File file = new File(configFile);
-        if (false == file.exists()) {
+        final File file = new File(configFile);
+        if (!file.exists()) {
             throw new RuntimeException("The config file " + configFile + " cannot be found.");
         }
 
+        final Config config;
         InputStream in = null;
         try {
 
@@ -200,10 +198,6 @@
             }
         }
 
-        // JsonReader jsonReader = new JsonReader(new FileReader(configFile));
-        // Config configAttOdlIt = new Gson().fromJson(jsonReader,
-        // Config.class);
-
         return config;
     }
 
diff --git a/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/datatypes/enums/ServiceCategoriesEnum.java b/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/datatypes/enums/ServiceCategoriesEnum.java
index 58918c3..f5200b1 100644
--- a/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/datatypes/enums/ServiceCategoriesEnum.java
+++ b/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/datatypes/enums/ServiceCategoriesEnum.java
@@ -7,9 +7,9 @@
  * 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.
@@ -21,24 +21,25 @@
 package org.onap.sdc.backend.ci.tests.datatypes.enums;
 
 import java.util.Random;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 
+@Getter
+@AllArgsConstructor
 public enum ServiceCategoriesEnum {
 
-	VOIP("VoIP Call Control"), MOBILITY("Mobility"), NETWORK_L4("Network L4+"), NETWORK_L3("Network L1-3"),
-		PARTNERSERVICE("Partner Domain Service");
-	String value;
+    E2E_SERVICE("E2E Service"),
+    ETSI_NFV_NETWORK_SERVICE("ETSI NFV Network Service"),
+    MOBILITY("Mobility"),
+    NETWORK_L3("Network L1-3"),
+    NETWORK_L4("Network L4+"),
+    PARTNER_SERVICE("Partner Domain Service"),
+    VOIP("VoIP Call Control");
 
-	private ServiceCategoriesEnum(String value) {
-		this.value = value;
-	}
-
-	public String getValue() {
-
-		return value;
-	}
+    private final String value;
 
     public static ServiceCategoriesEnum getRandomElement() {
-        Random random = new Random();
+        final Random random = new Random();
         return ServiceCategoriesEnum.values()[random.nextInt(ServiceCategoriesEnum.values().length)];
     }
 }
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/datatypes/ServiceCreateData.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/datatypes/ServiceCreateData.java
new file mode 100644
index 0000000..834522c
--- /dev/null
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/datatypes/ServiceCreateData.java
@@ -0,0 +1,47 @@
+/*
+ * ============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.datatypes;
+
+import java.util.List;
+import java.util.UUID;
+import lombok.Data;
+import org.onap.sdc.backend.ci.tests.datatypes.enums.ServiceInstantiationType;
+
+@Data
+public class ServiceCreateData {
+
+    private String name;
+    private String category;
+    private String etsiVersion;
+    private List<String> tagList;
+    private String description;
+    private String contactId;
+    private Boolean hasGeneratedNaming;
+    private String namingPolicy;
+    private String serviceType;
+    private String serviceRole;
+    private String serviceFunction;
+    private ServiceInstantiationType instantiationType;
+
+    public void setRandomName(final String prefix) {
+        final String randomPart = UUID.randomUUID().toString().split("-")[0];
+        this.name = String.format("%s%s", prefix == null ? "" : prefix, randomPart);
+    }
+}
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/exception/UnzipException.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/exception/UnzipException.java
new file mode 100644
index 0000000..be64e3e
--- /dev/null
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/exception/UnzipException.java
@@ -0,0 +1,27 @@
+/*
+ * ============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.exception;
+
+public class UnzipException extends Exception {
+
+    public UnzipException(final String message, final Throwable cause) {
+        super(message, cause);
+    }
+}
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
new file mode 100644
index 0000000..a2a41b7
--- /dev/null
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/EtsiNetworkServiceUiTests.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.empty;
+import static org.hamcrest.Matchers.hasKey;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.not;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.junit.Assert.fail;
+
+import com.aventstack.extentreports.Status;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Optional;
+import org.apache.commons.io.FilenameUtils;
+import org.junit.jupiter.api.Assertions;
+import org.onap.sdc.backend.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.onap.sdc.backend.ci.tests.datatypes.enums.UserRoleEnum;
+import org.onap.sdc.frontend.ci.tests.datatypes.ServiceCreateData;
+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.CheckEtsiNsPropertiesFlow;
+import org.onap.sdc.frontend.ci.tests.flow.CreateServiceFlow;
+import org.onap.sdc.frontend.ci.tests.flow.DownloadCsarArtifactFlow;
+import org.onap.sdc.frontend.ci.tests.flow.EditServicePropertiesFlow;
+import org.onap.sdc.frontend.ci.tests.flow.exception.UiTestFlowRuntimeException;
+import org.onap.sdc.frontend.ci.tests.pages.ServiceComponentPage;
+import org.onap.sdc.frontend.ci.tests.pages.TopNavComponent;
+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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.Test;
+import org.yaml.snakeyaml.Yaml;
+
+public class EtsiNetworkServiceUiTests extends SetupCDTest {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(EtsiNetworkServiceUiTests.class);
+
+    private WebDriver webDriver;
+
+    @Test
+    public void createEtsiNetworkService() throws UnzipException {
+        webDriver = DriverFactory.getDriver();
+
+        final CreateServiceFlow createServiceFlow = createService();
+        final CheckEtsiNsPropertiesFlow checkEtsiNsPropertiesFlow = checkServiceProperties();
+        final ServiceComponentPage serviceComponentPage = checkEtsiNsPropertiesFlow.getLandedPage()
+            .orElseThrow(() -> new UiTestFlowRuntimeException("Missing expected ServiceComponentPage"));
+
+        final Map<String, Object> propertyMap = createPropertyToEditMap();
+        editProperties(serviceComponentPage, propertyMap);
+
+        final DownloadCsarArtifactFlow downloadCsarArtifactFlow = downloadCsarArtifact(serviceComponentPage);
+        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);
+        checkEtsiNsPackage(createServiceFlow.getServiceCreateData().getName(), downloadedCsarName, propertyMap);
+    }
+
+    private CreateServiceFlow createService() {
+        final ServiceCreateData serviceCreateData = createServiceFormData();
+        final CreateServiceFlow createServiceFlow = new CreateServiceFlow(webDriver, serviceCreateData);
+        final TopNavComponent topNavComponent = new TopNavComponent(webDriver);
+        createServiceFlow.run(new HomePage(webDriver, topNavComponent));
+        return createServiceFlow;
+    }
+
+    private CheckEtsiNsPropertiesFlow checkServiceProperties() {
+        final CheckEtsiNsPropertiesFlow checkEtsiNsPropertiesFlow = new CheckEtsiNsPropertiesFlow(webDriver);
+        checkEtsiNsPropertiesFlow.run();
+        return checkEtsiNsPropertiesFlow;
+    }
+
+    private void editProperties(final ServiceComponentPage serviceComponentPage, final Map<String, Object> propertyMap) {
+        final EditServicePropertiesFlow editServicePropertiesFlow = new EditServicePropertiesFlow(webDriver, propertyMap);
+        editServicePropertiesFlow.run(serviceComponentPage);
+    }
+
+    private DownloadCsarArtifactFlow downloadCsarArtifact(final ServiceComponentPage serviceComponentPage) {
+        final DownloadCsarArtifactFlow downloadCsarArtifactFlow = new DownloadCsarArtifactFlow(webDriver);
+        downloadCsarArtifactFlow.run(serviceComponentPage);
+        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 ServiceCreateData createServiceFormData() {
+        final ServiceCreateData serviceCreateData = new ServiceCreateData();
+        serviceCreateData.setRandomName("EtsiNfvNetworkService");
+        serviceCreateData.setCategory(ServiceCategoriesEnum.ETSI_NFV_NETWORK_SERVICE.getValue());
+        serviceCreateData.setEtsiVersion("2.5.1");
+        serviceCreateData.setDescription("aDescription");
+        return serviceCreateData;
+    }
+
+    private void checkEtsiNsPackage(final String serviceName, final String downloadedCsarName,
+                                    final Map<String, Object> expectedPropertyMap) throws UnzipException {
+        final String downloadFolderPath = getConfig().getDownloadAutomationFolder();
+        final Map<String, byte[]> filesFromZip = FileHandling.getFilesFromZip(downloadFolderPath, downloadedCsarName);
+        final Optional<String> etsiPackageEntryOpt =
+            filesFromZip.keySet().stream().filter(s -> s.startsWith("Artifacts/ETSI_PACKAGE")).findFirst();
+        if (etsiPackageEntryOpt.isEmpty()) {
+            Assertions.fail("Could not find the NSD package in Artifacts/ETSI_PACKAGE");
+        }
+        final String nodeType = String.format("org.openecomp.service.%s",
+            serviceName.substring(0, 1).toUpperCase() + serviceName.substring(1).toLowerCase());
+        final String etsiPackageEntry = etsiPackageEntryOpt.get();
+        final String nsdPackageBaseName = FilenameUtils.getBaseName(etsiPackageEntry);
+        final String nsdCsarFile = nsdPackageBaseName + ".csar";
+        final byte[] etsiPackageBytes = filesFromZip.get(etsiPackageEntry);
+        if (etsiPackageEntry.endsWith(".zip")) {
+            final Map<String, byte[]> nsPackageFileMap = FileHandling.getFilesFromZip(etsiPackageBytes);
+            assertThat("Expecting 3 files inside the NSD CSAR, the CSAR itself and its signature and certificate",
+                nsPackageFileMap.size(), is(3));
+            assertThat("Expecting the NSD CSAR file " + nsdCsarFile, nsPackageFileMap, hasKey(nsdCsarFile));
+            final String nsdCsarSignature = nsdPackageBaseName + ".cms";
+            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));
+            return;
+        }
+        if (etsiPackageEntry.endsWith(".csar")) {
+            final Map<String, byte[]> nsPackageFileMap = FileHandling.getFilesFromZip(etsiPackageBytes);
+            checkNsCsar(nsdPackageBaseName, nodeType, expectedPropertyMap, nsPackageFileMap.get(nsdCsarFile));
+            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) {
+        try {
+            final Map<String, byte[]> csarFileMap = FileHandling.getFilesFromZip(nsCsar);
+            final String mainDefinitionFile = String.format("Definitions/%s.yaml", expectedServiceName);
+            final byte[] mainDefinitionFileBytes = csarFileMap.get(mainDefinitionFile);
+            if (mainDefinitionFileBytes == null) {
+                Assertions.fail(String.format("Could not find the Main Definition file in '%s'", mainDefinitionFile));
+            }
+
+            final Map<String, Object> mainDefinitionYamlMap = loadYamlObject(mainDefinitionFileBytes);
+            final Map<String, Object> topologyTemplateTosca = getMapEntry(mainDefinitionYamlMap, "topology_template");
+            assertThat(String.format("'%s' should contain a topology_template entry", mainDefinitionFile), topologyTemplateTosca, notNullValue());
+            final Map<String, Object> substitutionMappingsTosca = getMapEntry(topologyTemplateTosca, "substitution_mappings");
+            assertThat(String.format("'%s' should contain a substitution_mappings entry", mainDefinitionFile), substitutionMappingsTosca, notNullValue());
+            final String nodeType = (String) substitutionMappingsTosca.get("node_type");
+            assertThat("substitution_mappings->node_type should be as expected", nodeType, is(expectedServiceNodeType));
+
+            final Map<String, Object> nodeTemplatesTosca = getMapEntry(topologyTemplateTosca, "node_templates");
+            assertThat(String.format("'%s' should contain a node_templates entry", mainDefinitionFile), nodeTemplatesTosca, notNullValue());
+            final Map<String, Object> serviceNodeTemplate = getMapEntry(nodeTemplatesTosca, expectedServiceNodeType);
+            assertThat(String.format("'%s' should contain a '%s' entry in node_templates", mainDefinitionFile, expectedServiceNodeType),
+                serviceNodeTemplate, notNullValue());
+            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()) {
+                final String expectedPropertyName = expectedPropertyEntry.getKey();
+                assertThat(String.format("'%s' node template should contain the property '%s'", expectedServiceNodeType, expectedPropertyName),
+                    properties, hasKey(expectedPropertyName));
+                final Object expectedPropertyValue = expectedPropertyEntry.getValue();
+                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);
+                    assertThat(msg, actualPropertyValue, is(expectedPropertyValue));
+                }
+            }
+
+        } catch (final UnzipException e) {
+            final String errorMsg = "Could not unzip Network Service CSAR.";
+            LOGGER.info(errorMsg, e);
+            fail(String.format("%s Error: %s", errorMsg, e.getMessage()));
+        }
+    }
+
+    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);
+            LOGGER.error(errorMsg, e);
+            fail(errorMsg + "Error message: " + e.getMessage());
+        }
+        return null;
+    }
+
+    private Map<String, Object> loadYamlObject(final byte[] mainDefinitionFileBytes) {
+        return new Yaml().load(new String(mainDefinitionFileBytes));
+    }
+
+    @Override
+    protected UserRoleEnum getRole() {
+        return UserRoleEnum.DESIGNER;
+    }
+}
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/OnboardingFlowsUi.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/OnboardingFlowsUi.java
index 73c6d7c..050e696 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/OnboardingFlowsUi.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/OnboardingFlowsUi.java
@@ -21,39 +21,48 @@
 
 package org.onap.sdc.frontend.ci.tests.execute.sanity;
 
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
+
 import com.aventstack.extentreports.ExtentTest;
 import com.aventstack.extentreports.Status;
+import java.io.File;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 import org.onap.sdc.backend.ci.tests.data.providers.OnboardingDataProviders;
-import org.onap.sdc.frontend.ci.tests.dataProvider.OnbordingDataProviders;
-import org.onap.sdc.backend.ci.tests.datatypes.enums.XnfTypeEnum;
-import org.onap.sdc.frontend.ci.tests.flow.CheckSoftwareVersionPropertyFlow;
-import org.onap.sdc.frontend.ci.tests.flow.CreateResourceFlow;
-import org.onap.sdc.frontend.ci.tests.flow.CreateVspFlow;
-import org.onap.sdc.frontend.ci.tests.flow.ImportVspFlow;
-import org.onap.sdc.frontend.ci.tests.flow.exception.UiTestFlowRuntimeException;
-import org.onap.sdc.frontend.ci.tests.pages.*;
-import org.onap.sdc.frontend.ci.tests.utilities.FileHandling;
-import org.onap.sdc.frontend.ci.tests.utilities.GeneralUIUtils;
-import org.onap.sdc.frontend.ci.tests.utilities.OnboardingUiUtils;
-import org.onap.sdc.frontend.ci.tests.utilities.ServiceUIUtils;
-import org.onap.sdc.backend.ci.tests.utils.Utils;
-import org.onap.sdc.frontend.ci.tests.verificator.ServiceVerificator;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.Service;
-import org.onap.sdc.frontend.ci.tests.datatypes.CanvasElement;
-import org.onap.sdc.frontend.ci.tests.datatypes.CanvasManager;
-import org.onap.sdc.frontend.ci.tests.datatypes.DataTestIdEnum;
 import org.onap.sdc.backend.ci.tests.datatypes.ResourceReqDetails;
 import org.onap.sdc.backend.ci.tests.datatypes.ServiceReqDetails;
 import org.onap.sdc.backend.ci.tests.datatypes.VendorLicenseModel;
 import org.onap.sdc.backend.ci.tests.datatypes.VendorSoftwareProductObject;
 import org.onap.sdc.backend.ci.tests.datatypes.enums.UserRoleEnum;
+import org.onap.sdc.backend.ci.tests.datatypes.enums.XnfTypeEnum;
+import org.onap.sdc.backend.ci.tests.utils.Utils;
+import org.onap.sdc.backend.ci.tests.utils.general.AtomicOperationUtils;
+import org.onap.sdc.backend.ci.tests.utils.general.ElementFactory;
+import org.onap.sdc.backend.ci.tests.utils.general.OnboardingUtils;
+import org.onap.sdc.backend.ci.tests.utils.general.VendorLicenseModelRestUtils;
+import org.onap.sdc.backend.ci.tests.utils.general.VendorSoftwareProductRestUtils;
+import org.onap.sdc.frontend.ci.tests.dataProvider.OnbordingDataProviders;
+import org.onap.sdc.frontend.ci.tests.datatypes.CanvasElement;
+import org.onap.sdc.frontend.ci.tests.datatypes.CanvasManager;
+import org.onap.sdc.frontend.ci.tests.datatypes.DataTestIdEnum;
 import org.onap.sdc.frontend.ci.tests.execute.setup.DriverFactory;
 import org.onap.sdc.frontend.ci.tests.execute.setup.ExtentTestActions;
 import org.onap.sdc.frontend.ci.tests.execute.setup.SetupCDTest;
+import org.onap.sdc.frontend.ci.tests.flow.CheckSoftwareVersionPropertyFlow;
+import org.onap.sdc.frontend.ci.tests.flow.CreateResourceFlow;
+import org.onap.sdc.frontend.ci.tests.flow.CreateVspFlow;
+import org.onap.sdc.frontend.ci.tests.flow.ImportVspFlow;
+import org.onap.sdc.frontend.ci.tests.flow.exception.UiTestFlowRuntimeException;
 import org.onap.sdc.frontend.ci.tests.pages.CompositionPage;
 import org.onap.sdc.frontend.ci.tests.pages.DeploymentArtifactPage;
+import org.onap.sdc.frontend.ci.tests.pages.GeneralPageElements;
 import org.onap.sdc.frontend.ci.tests.pages.GovernorOperationPage;
 import org.onap.sdc.frontend.ci.tests.pages.HomePage;
 import org.onap.sdc.frontend.ci.tests.pages.OpsOperationPage;
@@ -64,11 +73,14 @@
 import org.onap.sdc.frontend.ci.tests.pages.TopNavComponent;
 import org.onap.sdc.frontend.ci.tests.pages.VspValidationPage;
 import org.onap.sdc.frontend.ci.tests.pages.VspValidationResultsPage;
-import org.onap.sdc.backend.ci.tests.utils.general.AtomicOperationUtils;
-import org.onap.sdc.backend.ci.tests.utils.general.ElementFactory;
-import org.onap.sdc.backend.ci.tests.utils.general.OnboardingUtils;
-import org.onap.sdc.backend.ci.tests.utils.general.VendorLicenseModelRestUtils;
-import org.onap.sdc.backend.ci.tests.utils.general.VendorSoftwareProductRestUtils;
+import org.onap.sdc.frontend.ci.tests.utilities.FileHandling;
+import org.onap.sdc.frontend.ci.tests.utilities.GeneralUIUtils;
+import org.onap.sdc.frontend.ci.tests.utilities.OnboardingUiUtils;
+import org.onap.sdc.frontend.ci.tests.utilities.ServiceUIUtils;
+import org.onap.sdc.frontend.ci.tests.verificator.ServiceVerificator;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
 import org.slf4j.Logger;
@@ -80,19 +92,6 @@
 import org.testng.annotations.Parameters;
 import org.testng.annotations.Test;
 
-import java.io.File;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertNotNull;
-import static org.testng.AssertJUnit.assertTrue;
-import static org.testng.AssertJUnit.fail;
-
 public class OnboardingFlowsUi extends SetupCDTest {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(OnboardingFlowsUi.class);
@@ -395,10 +394,8 @@
         createVspFlow.run(new TopNavComponent(webDriver));
 
         final ImportVspFlow importVspFlow = new ImportVspFlow(webDriver, resourceName);
-        final ResourceCreatePage resourceCreatePage =
-            (ResourceCreatePage) importVspFlow.run()
-                .orElseThrow(() -> new UiTestFlowRuntimeException("Missing expected return ResourceCreatePage"));
-
+        final ResourceCreatePage resourceCreatePage = importVspFlow.run()
+            .orElseThrow(() -> new UiTestFlowRuntimeException("Missing expected return ResourceCreatePage"));
         final CreateResourceFlow createResourceFlow = new CreateResourceFlow(webDriver, resourceName);
         createResourceFlow.run(resourceCreatePage);
 
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/Service.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/Service.java
index 70bf767..6ff0ee9 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/Service.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/Service.java
@@ -128,7 +128,7 @@
         List<WebElement> ddOptions = ServiceGeneralPage.getCategories();
 
         for (WebElement opt: ddOptions) {
-            assertFalse("Hidden Category visible", ServiceCategoriesEnum.PARTNERSERVICE.equals(opt.getText()));
+            assertFalse("Hidden Category visible", ServiceCategoriesEnum.PARTNER_SERVICE.equals(opt.getText()));
         }
 
     }
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/setup/WebDriverThread.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/setup/WebDriverThread.java
index afc8524..4d08e84 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/setup/WebDriverThread.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/setup/WebDriverThread.java
@@ -20,31 +20,21 @@
 
 package org.onap.sdc.frontend.ci.tests.execute.setup;
 
-import net.lightbody.bmp.BrowserMobProxyServer;
-import net.lightbody.bmp.client.ClientUtil;
-import net.lightbody.bmp.proxy.CaptureType;
+import java.net.MalformedURLException;
+import java.net.URL;
 import org.onap.sdc.backend.ci.tests.config.Config;
 import org.onap.sdc.frontend.ci.tests.exception.WebDriverThreadRuntimeException;
-import org.onap.sdc.frontend.ci.tests.utilities.FileHandling;
 import org.openqa.selenium.Dimension;
-import org.openqa.selenium.Platform;
-import org.openqa.selenium.UnexpectedAlertBehaviour;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.firefox.FirefoxDriver;
 import org.openqa.selenium.firefox.FirefoxOptions;
 import org.openqa.selenium.firefox.FirefoxProfile;
 import org.openqa.selenium.remote.CapabilityType;
-import org.openqa.selenium.remote.DesiredCapabilities;
 import org.openqa.selenium.remote.LocalFileDetector;
 import org.openqa.selenium.remote.RemoteWebDriver;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.UUID;
-
 public class WebDriverThread {
 
     private final static Logger LOGGER = LoggerFactory.getLogger(SetupCDTest.class);
@@ -94,7 +84,10 @@
             LOGGER.info("Opening LOCAL browser");
             System.setProperty("webdriver.gecko.driver", "target/gecko/geckodriver");
             FirefoxOptions firefoxOptions = new FirefoxOptions();
-            firefoxOptions.setProfile(initFirefoxProfile(config));
+            final FirefoxProfile firefoxProfile = initFirefoxProfile(config);
+            firefoxProfile.setPreference("browser.download.dir", config.getDownloadAutomationFolder());
+            firefoxProfile.setPreference("browser.download.folderList", 2);
+            firefoxOptions.setProfile(firefoxProfile);
             firefoxOptions.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
             firefoxOptions.setHeadless(false);
             webdriver = new FirefoxDriver(firefoxOptions);
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/AbstractUiTestFlow.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/AbstractUiTestFlow.java
index 30cfd2e..85c6444 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/AbstractUiTestFlow.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/AbstractUiTestFlow.java
@@ -20,11 +20,15 @@
 package org.onap.sdc.frontend.ci.tests.flow;
 
 import com.aventstack.extentreports.ExtentTest;
-import org.onap.sdc.frontend.ci.tests.flow.exception.MissingParameterRuntimeException;
+import java.util.Optional;
 import org.onap.sdc.frontend.ci.tests.execute.setup.ExtentTestManager;
+import org.onap.sdc.frontend.ci.tests.flow.exception.MissingParameterRuntimeException;
 import org.onap.sdc.frontend.ci.tests.pages.PageObject;
 import org.openqa.selenium.WebDriver;
 
+/**
+ * The base class for a UI test flow.
+ */
 public abstract class AbstractUiTestFlow implements UiTestFlow {
 
     protected final WebDriver webDriver;
@@ -34,15 +38,40 @@
         this.webDriver = webDriver;
     }
 
+    /**
+     * Find a page object within the the page objects array, based on the given class. If the page object is not found, throws an error.
+     *
+     * @param pageObjects           the page object array
+     * @param expectedParameterType the class of the page object to find
+     * @param <T>                   a child class of the page object
+     * @return the found page object
+     * @throws MissingParameterRuntimeException when the page object is not found
+     */
     public <T extends PageObject> T findParameter(final PageObject[] pageObjects,
                                                   final Class<T> expectedParameterType) {
+        final Optional<T> parameter = getParameter(pageObjects, expectedParameterType);
+        if (parameter.isEmpty()) {
+            throw new MissingParameterRuntimeException(expectedParameterType.getName());
+        }
+        return parameter.get();
+    }
+
+    /**
+     * Find a page object within the the page objects array, based on the given class.
+     *
+     * @param pageObjects           the page object array
+     * @param expectedParameterType the class of the page object to find
+     * @param <T>                   a child class of the page object
+     * @return an optional page object
+     */
+    public <T extends PageObject> Optional<T> getParameter(final PageObject[] pageObjects,
+                                                           final Class<T> expectedParameterType) {
         for (final PageObject uiTestFlow : pageObjects) {
-            if(expectedParameterType.isInstance(uiTestFlow)) {
-                return (T) uiTestFlow;
+            if (expectedParameterType.isInstance(uiTestFlow)) {
+                return Optional.of((T) uiTestFlow);
             }
         }
 
-        throw new MissingParameterRuntimeException(expectedParameterType.getName());
+        return Optional.empty();
     }
-
 }
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CheckEtsiNsPropertiesFlow.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CheckEtsiNsPropertiesFlow.java
new file mode 100644
index 0000000..e767dce
--- /dev/null
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CheckEtsiNsPropertiesFlow.java
@@ -0,0 +1,100 @@
+/*
+ * ============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 static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+
+import com.aventstack.extentreports.Status;
+import java.util.Optional;
+import org.onap.sdc.frontend.ci.tests.execute.setup.ExtentTestActions;
+import org.onap.sdc.frontend.ci.tests.pages.PageObject;
+import org.onap.sdc.frontend.ci.tests.pages.ResourceLeftSideMenu;
+import org.onap.sdc.frontend.ci.tests.pages.ResourcePropertiesAssignmentPage;
+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;
+import org.openqa.selenium.WebDriver;
+
+/**
+ * Check the required properties in a Service of category ETSI NFV Network Service.
+ */
+public class CheckEtsiNsPropertiesFlow extends AbstractUiTestFlow {
+
+    private ServiceComponentPage serviceComponentPage;
+
+    public CheckEtsiNsPropertiesFlow(final WebDriver webDriver) {
+        super(webDriver);
+    }
+
+    /**
+     * Starts the flow in the {@link ServiceComponentPage}. From there go to the {@link ResourcePropertiesAssignmentPage} and check for the
+     * properties. It does not require any page object, but can receive:
+     * <ul>
+     *     <li>{@link ServiceComponentPage} or its children:</li>
+     *     <ul>
+     *         <li>{@link TopNavComponent}</li>
+     *         <li>{@link ResourceLeftSideMenu}</li>
+     *         <li>{@link ResourceWorkspaceTopBarComponent}</li>
+     *     </ul>
+     * </ul>
+     *
+     * @param pageObjects any required page object for the flow
+     * @return the {@link ServiceComponentPage}
+     */
+    @Override
+    public Optional<ServiceComponentPage> run(final PageObject... pageObjects) {
+        extendTest.log(Status.INFO, "Checking ETSI NFV Network Service properties");
+        serviceComponentPage = getParameter(pageObjects, ServiceComponentPage.class)
+            .orElseGet(() -> {
+                final TopNavComponent topNavComponent = getParameter(pageObjects, TopNavComponent.class).orElse(new TopNavComponent(webDriver));
+                final ResourceLeftSideMenu resourceLeftSideMenu =
+                    getParameter(pageObjects, ResourceLeftSideMenu.class).orElse(new ResourceLeftSideMenu(webDriver));
+                final ResourceWorkspaceTopBarComponent workspaceTopBarComponent =
+                    getParameter(pageObjects, ResourceWorkspaceTopBarComponent.class).orElse(new ResourceWorkspaceTopBarComponent(webDriver));
+                return new ServiceComponentPage(webDriver, topNavComponent, resourceLeftSideMenu, workspaceTopBarComponent);
+            });
+        serviceComponentPage.isLoaded();
+        final ResourcePropertiesAssignmentPage resourcePropertiesAssignmentPage = serviceComponentPage.goToPropertiesAssignment();
+        checkProperty(resourcePropertiesAssignmentPage, "descriptor_id");
+        checkProperty(resourcePropertiesAssignmentPage, "designer");
+        checkProperty(resourcePropertiesAssignmentPage, "flavour_id");
+        checkProperty(resourcePropertiesAssignmentPage, "invariant_id");
+        checkProperty(resourcePropertiesAssignmentPage, "name");
+        checkProperty(resourcePropertiesAssignmentPage, "ns_profile");
+        checkProperty(resourcePropertiesAssignmentPage, "version");
+        checkProperty(resourcePropertiesAssignmentPage, "ns_profile");
+        checkProperty(resourcePropertiesAssignmentPage, "service_availability_level");
+        ExtentTestActions.takeScreenshot(Status.INFO, "etsi-ns-properties-present", "ETSI NS properties are present");
+        extendTest.log(Status.INFO, "Finished checking ETSI NFV Network Service properties");
+        return Optional.of(serviceComponentPage);
+    }
+
+    @Override
+    public Optional<ServiceComponentPage> getLandedPage() {
+        return Optional.ofNullable(serviceComponentPage);
+    }
+
+    private void checkProperty(final ResourcePropertiesAssignmentPage resourcePropertiesAssignmentPage, final String propertyName) {
+        extendTest.log(Status.INFO, String.format("Checking property '%s'", propertyName));
+        assertThat(String.format("'%s' property should be present", propertyName),
+            resourcePropertiesAssignmentPage.isPropertyPresent(propertyName), is(true));
+    }
+}
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CheckSoftwareVersionPropertyFlow.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CheckSoftwareVersionPropertyFlow.java
index 3b16154..1ec1e03 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CheckSoftwareVersionPropertyFlow.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CheckSoftwareVersionPropertyFlow.java
@@ -28,9 +28,9 @@
 import java.util.List;
 import java.util.Optional;
 
+import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.containsInAnyOrder;
 import static org.hamcrest.Matchers.hasSize;
-import static org.junit.Assert.assertThat;
 
 /**
  * UI Flow for checking the software version property in a resource
@@ -38,6 +38,7 @@
 public class CheckSoftwareVersionPropertyFlow extends AbstractUiTestFlow {
 
     private final List<String> expectedSoftwareVersionList;
+    private ResourcePropertiesAssignmentPage resourcePropertiesAssignmentPage;
 
     public CheckSoftwareVersionPropertyFlow(final WebDriver webDriver, final List<String> expectedSoftwareVersionList) {
         super(webDriver);
@@ -49,12 +50,17 @@
         final ResourceLeftSideMenu resourceLeftSideMenu = new ResourceLeftSideMenu(webDriver);
         resourceLeftSideMenu.isLoaded();
 
-        final ResourcePropertiesAssignmentPage resourcePropertiesAssignmentPage = accessPropertiesAssignmentPage();
+        resourcePropertiesAssignmentPage = accessPropertiesAssignmentPage();
 
         checkSoftwareVersionProperty(resourcePropertiesAssignmentPage);
         return Optional.empty();
     }
 
+    @Override
+    public Optional<ResourcePropertiesAssignmentPage> getLandedPage() {
+        return Optional.ofNullable(resourcePropertiesAssignmentPage);
+    }
+
     /**
      * Checks if the software_version property values are as expected by the {@link #expectedSoftwareVersionList}.
      *
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CreateResourceFlow.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CreateResourceFlow.java
index 4b6f354..0965057 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CreateResourceFlow.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CreateResourceFlow.java
@@ -33,6 +33,7 @@
 public class CreateResourceFlow extends AbstractUiTestFlow {
 
     private final String resourceName;
+    private ResourceCreatePage resourceCreatePage;
 
     public CreateResourceFlow(final WebDriver webDriver, final String resourceName) {
         super(webDriver);
@@ -40,13 +41,18 @@
     }
 
     @Override
-    public Optional<PageObject> run(final PageObject... pageObjects) {
-        final ResourceCreatePage resourceCreatePage = findParameter(pageObjects, ResourceCreatePage.class);
+    public Optional<ResourceCreatePage> run(final PageObject... pageObjects) {
+        resourceCreatePage = findParameter(pageObjects, ResourceCreatePage.class);
         extendTest.log(Status.INFO, String.format("Creating the Resource '%s'", resourceName));
         resourceCreatePage.createResource();
         ExtentTestActions.takeScreenshot(Status.INFO, "resource-created",
             String.format("Resource '%s' was created", resourceName));
-        return Optional.empty();
+        return Optional.ofNullable(resourceCreatePage);
+    }
+
+    @Override
+    public Optional<ResourceCreatePage> getLandedPage() {
+        return Optional.ofNullable(resourceCreatePage);
     }
 
 }
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CreateServiceFlow.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CreateServiceFlow.java
new file mode 100644
index 0000000..bb986c1
--- /dev/null
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CreateServiceFlow.java
@@ -0,0 +1,67 @@
+/*
+ * ============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 lombok.Getter;
+import org.onap.sdc.frontend.ci.tests.datatypes.ServiceCreateData;
+import org.onap.sdc.frontend.ci.tests.execute.setup.ExtentTestActions;
+import org.onap.sdc.frontend.ci.tests.pages.PageObject;
+import org.onap.sdc.frontend.ci.tests.pages.ServiceCreatePage;
+import org.onap.sdc.frontend.ci.tests.pages.home.HomePage;
+import org.openqa.selenium.WebDriver;
+
+public class CreateServiceFlow extends AbstractUiTestFlow {
+
+    @Getter
+    private final ServiceCreateData serviceCreateData;
+    @Getter
+    private HomePage homePage;
+    private ServiceCreatePage serviceCreatePage;
+
+    public CreateServiceFlow(final WebDriver webDriver, final ServiceCreateData serviceCreateData) {
+        super(webDriver);
+        this.serviceCreateData = serviceCreateData;
+    }
+
+    @Override
+    public Optional<ServiceCreatePage> run(final PageObject... pageObjects) {
+        Objects.requireNonNull(serviceCreateData);
+        extendTest.log(Status.INFO, String.format("Creating Service '%s'", serviceCreateData.getName()));
+        homePage = findParameter(pageObjects, HomePage.class);
+        homePage.isLoaded();
+        serviceCreatePage = homePage.clickOnAddService();
+        serviceCreatePage.isLoaded();
+        serviceCreatePage.fillForm(serviceCreateData);
+        ExtentTestActions.takeScreenshot(Status.INFO, "service-form-filled",
+            String.format("Service '%s' form is filled", serviceCreateData.getName()));
+        serviceCreatePage.clickOnCreate();
+        ExtentTestActions.takeScreenshot(Status.INFO, "service-created",
+            String.format("Service '%s' was created", serviceCreateData.getName()));
+        return Optional.of(serviceCreatePage);
+    }
+
+    @Override
+    public Optional<ServiceCreatePage> getLandedPage() {
+        return Optional.ofNullable(serviceCreatePage);
+    }
+}
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CreateVspFlow.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CreateVspFlow.java
index eb80985..3d3d442 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CreateVspFlow.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/CreateVspFlow.java
@@ -19,21 +19,21 @@
 
 package org.onap.sdc.frontend.ci.tests.flow;
 
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
 import com.aventstack.extentreports.Status;
+import java.util.Optional;
+import org.onap.sdc.frontend.ci.tests.execute.setup.ExtentTestActions;
 import org.onap.sdc.frontend.ci.tests.pages.OnboardHomePage;
+import org.onap.sdc.frontend.ci.tests.pages.PageObject;
 import org.onap.sdc.frontend.ci.tests.pages.SoftwareProductOnboarding;
 import org.onap.sdc.frontend.ci.tests.pages.TopNavComponent;
 import org.onap.sdc.frontend.ci.tests.pages.VspCreationModal;
-import org.onap.sdc.frontend.ci.tests.execute.setup.ExtentTestActions;
-import org.onap.sdc.frontend.ci.tests.pages.PageObject;
+import org.onap.sdc.frontend.ci.tests.pages.home.HomePage;
 import org.onap.sdc.frontend.ci.tests.utilities.GeneralUIUtils;
 import org.openqa.selenium.WebDriver;
 
-import java.util.Optional;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
 /**
  * UI Flow for VSP creation
  */
@@ -42,6 +42,7 @@
     private final String resourceName;
     private final String packageFile;
     private final String rootFolder;
+    private HomePage homePage;
 
     public CreateVspFlow(final WebDriver webDriver, final String resourceName, final String packageFile,
                          final String rootFolder) {
@@ -64,6 +65,11 @@
         return Optional.empty();
     }
 
+    @Override
+    public Optional<HomePage> getLandedPage() {
+        return Optional.ofNullable(homePage);
+    }
+
     /**
      * Goes to the onboard home page by clicking in the onboard tab in the top nav component.
      *
@@ -136,7 +142,8 @@
         topNavComponent.isLoaded();
         topNavComponent.clickOnHome();
         GeneralUIUtils.ultimateWait();
-        topNavComponent.isLoaded();
+        homePage = new HomePage(webDriver, topNavComponent);
+        homePage.isLoaded();
         ExtentTestActions.takeScreenshot(Status.INFO, "home-is-loaded", "The Home page is loaded.");
     }
 }
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
new file mode 100644
index 0000000..a325f2b
--- /dev/null
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/DownloadCsarArtifactFlow.java
@@ -0,0 +1,73 @@
+/*
+ * ============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 static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+
+import com.aventstack.extentreports.Status;
+import java.io.File;
+import java.time.Duration;
+import java.util.Optional;
+import org.onap.sdc.frontend.ci.tests.execute.setup.ExtentTestActions;
+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.support.ui.FluentWait;
+
+public class DownloadCsarArtifactFlow extends AbstractUiTestFlow {
+
+    private ToscaArtifactsPage toscaArtifactsPage;
+
+    public DownloadCsarArtifactFlow(final WebDriver webDriver) {
+        super(webDriver);
+    }
+
+    @Override
+    public Optional<PageObject> run(final PageObject... pageObjects) {
+        final ServiceComponentPage serviceComponentPage = findParameter(pageObjects, ServiceComponentPage.class);
+        toscaArtifactsPage = serviceComponentPage.goToToscaArtifacts();
+        toscaArtifactsPage.isLoaded();
+        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");
+
+        return Optional.of(toscaArtifactsPage);
+    }
+
+    @Override
+    public Optional<ToscaArtifactsPage> getLandedPage() {
+        return Optional.ofNullable(toscaArtifactsPage);
+    }
+
+    private File waitAndGetDowloadedCsar() {
+        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/flow/EditServicePropertiesFlow.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/EditServicePropertiesFlow.java
new file mode 100644
index 0000000..716d386
--- /dev/null
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/EditServicePropertiesFlow.java
@@ -0,0 +1,76 @@
+/*
+ * ============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.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.PageObject;
+import org.onap.sdc.frontend.ci.tests.pages.ResourceLeftSideMenu;
+import org.onap.sdc.frontend.ci.tests.pages.ResourcePropertiesAssignmentPage;
+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;
+import org.openqa.selenium.WebDriver;
+
+public class EditServicePropertiesFlow extends AbstractUiTestFlow {
+
+    private final Map<String, Object> propertiesMap;
+    private ServiceComponentPage serviceComponentPage;
+
+    public EditServicePropertiesFlow(final WebDriver webDriver, final Map<String, Object> propertiesMap) {
+        super(webDriver);
+        this.propertiesMap = propertiesMap;
+    }
+
+    @Override
+    public Optional<ServiceComponentPage> run(final PageObject... pageObjects) {
+        serviceComponentPage = getParameter(pageObjects, ServiceComponentPage.class)
+            .orElseGet(() -> {
+                final TopNavComponent topNavComponent = getParameter(pageObjects, TopNavComponent.class).orElse(new TopNavComponent(webDriver));
+                final ResourceLeftSideMenu resourceLeftSideMenu =
+                    getParameter(pageObjects, ResourceLeftSideMenu.class).orElse(new ResourceLeftSideMenu(webDriver));
+                final ResourceWorkspaceTopBarComponent workspaceTopBarComponent =
+                    getParameter(pageObjects, ResourceWorkspaceTopBarComponent.class).orElse(new ResourceWorkspaceTopBarComponent(webDriver));
+                return new ServiceComponentPage(webDriver, topNavComponent, resourceLeftSideMenu, workspaceTopBarComponent);
+            });
+        serviceComponentPage.isLoaded();
+        final ResourcePropertiesAssignmentPage resourcePropertiesAssignmentPage = serviceComponentPage.goToPropertiesAssignment();
+        if (MapUtils.isEmpty(propertiesMap)) {
+            return Optional.of(serviceComponentPage);
+        }
+        final String propertyNames = String.join(", ", propertiesMap.keySet());
+        ExtentTestActions.takeScreenshot(Status.INFO, "etsi-ns-edited-properties",
+            String.format("Before editing properties: %s", propertyNames));
+        extendTest.log(Status.INFO, "Editing properties " + propertyNames);
+        propertiesMap.forEach(resourcePropertiesAssignmentPage::setPropertyValue);
+        resourcePropertiesAssignmentPage.saveProperties();
+        ExtentTestActions.takeScreenshot(Status.INFO, "etsi-ns-edited-properties",
+            String.format("Properties edited: %s", propertyNames));
+        return Optional.of(serviceComponentPage);
+    }
+
+    @Override
+    public Optional<ServiceComponentPage> getLandedPage() {
+        return Optional.ofNullable(serviceComponentPage);
+    }
+}
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/ImportVspFlow.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/ImportVspFlow.java
index bb90988..0f1330f 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/ImportVspFlow.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/ImportVspFlow.java
@@ -20,21 +20,21 @@
 package org.onap.sdc.frontend.ci.tests.flow;
 
 import com.aventstack.extentreports.Status;
+import java.util.Optional;
+import org.onap.sdc.frontend.ci.tests.execute.setup.ExtentTestActions;
+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.TopNavComponent;
 import org.onap.sdc.frontend.ci.tests.pages.VspRepositoryModalComponent;
-import org.onap.sdc.frontend.ci.tests.execute.setup.ExtentTestActions;
-import org.onap.sdc.frontend.ci.tests.pages.PageObject;
 import org.openqa.selenium.WebDriver;
 
-import java.util.Optional;
-
 /**
  * UI Flow for importing a VSP
  */
 public class ImportVspFlow extends AbstractUiTestFlow {
 
     private final String resourceName;
+    private ResourceCreatePage resourceCreatePage;
 
     public ImportVspFlow(final WebDriver webDriver, final String resourceName) {
         super(webDriver);
@@ -42,10 +42,16 @@
     }
 
     @Override
-    public Optional<PageObject> run(final PageObject... pageObjects) {
+    public Optional<ResourceCreatePage> run(final PageObject... pageObjects) {
         final VspRepositoryModalComponent vspRepositoryModalComponent = openVspRepository();
         searchForVsp(vspRepositoryModalComponent);
-        return Optional.of(importVsp(vspRepositoryModalComponent));
+        resourceCreatePage = importVsp(vspRepositoryModalComponent);
+        return Optional.of(resourceCreatePage);
+    }
+
+    @Override
+    public Optional<ResourceCreatePage> getLandedPage() {
+        return Optional.ofNullable(resourceCreatePage);
     }
 
     /**
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/UiTestFlow.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/UiTestFlow.java
index 513a626..098f25c 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/UiTestFlow.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/flow/UiTestFlow.java
@@ -19,14 +19,12 @@
 
 package org.onap.sdc.frontend.ci.tests.flow;
 
-import org.onap.sdc.frontend.ci.tests.pages.PageObject;
-
 import java.util.Optional;
+import org.onap.sdc.frontend.ci.tests.pages.PageObject;
 
 /**
  * Represents a UI test flow
  */
-@FunctionalInterface
 public interface UiTestFlow {
 
     /**
@@ -34,6 +32,12 @@
      * @param pageObjects any required page object for the flow
      * @return an optional page object representing the page that the flow has ended
      */
-    Optional<PageObject> run(final PageObject... pageObjects);
+    Optional<? extends PageObject> run(final PageObject... pageObjects);
+
+    /**
+     * Gets the page where the flow finished.
+     * @return the page where the flow finished
+     */
+    Optional<? extends PageObject> getLandedPage();
 
 }
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 06c3280..2564d0d 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
@@ -163,4 +163,34 @@
             .until(ExpectedConditions.invisibilityOfElementLocated(locator));
     }
 
+    /**
+     * Waits for element invisibility with the provided timeout.
+     *
+     * @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
+     */
+    protected Boolean waitForElementInvisibility(final By locator, final int timeoutInSeconds) {
+        return getWait(timeoutInSeconds)
+            .until(ExpectedConditions.invisibilityOfElementLocated(locator));
+    }
+
+    /**
+     * 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
+     */
+    protected WebElement waitToBeClickable(final String xpath) {
+        return waitToBeClickable(By.xpath(xpath));
+    }
+
+    /**
+     * 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
+     */
+    protected WebElement waitToBeClickable(final By locator) {
+        return getWait().until(ExpectedConditions.elementToBeClickable(locator));
+    }
+
 }
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 08724c9..b856a13 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,8 +21,8 @@
 
 import org.onap.sdc.frontend.ci.tests.datatypes.LifeCycleStateEnum;
 import org.onap.sdc.frontend.ci.tests.utilities.LoaderHelper;
-import org.onap.sdc.frontend.ci.tests.utilities.NotificationHelper;
-import org.onap.sdc.frontend.ci.tests.utilities.NotificationHelper.NotificationType;
+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;
@@ -30,9 +30,9 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.equalToIgnoringCase;
 import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
 import static org.onap.sdc.frontend.ci.tests.pages.ResourceCreatePage.XpathSelector.FORM_LIFE_CYCLE_STATE;
 
 /**
@@ -42,14 +42,14 @@
 
     private static final Logger LOGGER = LoggerFactory.getLogger(ResourceCreatePage.class);
     private final LoaderHelper loaderHelper;
-    private final NotificationHelper notificationHelper;
+    private final NotificationComponent notificationComponent;
     private WebElement createBtn;
 
     public ResourceCreatePage(final WebDriver webDriver, final LoaderHelper loaderHelper,
-                              final NotificationHelper notificationHelper) {
+                              final NotificationComponent notificationComponent) {
         super(webDriver);
         this.loaderHelper = loaderHelper;
-        this.notificationHelper = notificationHelper;
+        this.notificationComponent = notificationComponent;
         timeoutInSeconds = 5;
     }
 
@@ -69,7 +69,7 @@
     public void createResource() {
         createBtn.click();
         loaderHelper.waitForLoader(60);
-        notificationHelper.waitForNotification(NotificationType.SUCCESS, 60);
+        notificationComponent.waitForNotification(NotificationType.SUCCESS, 60);
     }
 
     /**
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourceLeftSideMenu.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourceLeftSideMenu.java
index 35c8b09..03df126 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourceLeftSideMenu.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourceLeftSideMenu.java
@@ -19,13 +19,16 @@
 
 package org.onap.sdc.frontend.ci.tests.pages;
 
+import org.onap.sdc.frontend.ci.tests.pages.component.workspace.ToscaArtifactsPage;
 import org.openqa.selenium.By;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.support.ui.ExpectedConditions;
 
+import static org.onap.sdc.frontend.ci.tests.pages.ResourceLeftSideMenu.XpathSelector.GENERAL_MENU;
 import static org.onap.sdc.frontend.ci.tests.pages.ResourceLeftSideMenu.XpathSelector.MAIN_DIV;
 import static org.onap.sdc.frontend.ci.tests.pages.ResourceLeftSideMenu.XpathSelector.PROPERTIES_ASSIGNMENT_MENU;
+import static org.onap.sdc.frontend.ci.tests.pages.ResourceLeftSideMenu.XpathSelector.TOSCA_ARTIFACTS_MENU;
 
 /**
  * Handles the Resource Page Left Side Menu UI actions
@@ -65,11 +68,33 @@
     }
 
     /**
+     * Clicks on the TOSCA artifacts menu item.
+     *
+     * @return the next page object
+     */
+    public ToscaArtifactsPage clickOnToscaArtifactsMenuItem() {
+        wrappingElement.findElement(By.xpath(TOSCA_ARTIFACTS_MENU.getXpath())).click();
+        return new ToscaArtifactsPage(webDriver);
+    }
+
+    /**
+     * Clicks on the TOSCA artifacts menu item.
+     *
+     * @return the next page object
+     */
+    public ServiceCreatePage clickOnGeneralMenuItem() {
+        wrappingElement.findElement(By.xpath(GENERAL_MENU.getXpath())).click();
+        return new ServiceCreatePage(webDriver);
+    }
+
+    /**
      * Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
      */
     public enum XpathSelector {
         MAIN_DIV("w-sdc-left-sidebar", "//div[@class='%s']"),
-        PROPERTIES_ASSIGNMENT_MENU("Properties AssignmentLeftSideMenu", "//*[@data-tests-id='%s']");
+        PROPERTIES_ASSIGNMENT_MENU("Properties AssignmentLeftSideMenu", "//*[@data-tests-id='%s']"),
+        GENERAL_MENU("GeneralLeftSideMenu", "//*[@data-tests-id='%s']"),
+        TOSCA_ARTIFACTS_MENU("TOSCA ArtifactsLeftSideMenu", "//*[@data-tests-id='%s']");
 
         private final String id;
         private final String xpathFormat;
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 726a73f0..bf99e03 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
@@ -19,30 +19,42 @@
 
 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.ResourcePropertiesAssignmentPage.XpathSelector.INPUT_PROPERTY;
+import static org.onap.sdc.frontend.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.MAIN_DIV;
+import static org.onap.sdc.frontend.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.NO_DATA_MESSAGE;
+import static org.onap.sdc.frontend.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.PROPERTIES_TABLE;
+import static org.onap.sdc.frontend.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.PROPERTY_CHECKBOX;
+import static org.onap.sdc.frontend.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.PROPERTY_SAVE_BTN;
+import static org.onap.sdc.frontend.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.SOFTWARE_VERSION_INPUT;
+import static org.onap.sdc.frontend.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.SOFTWARE_VERSION_PROPERTY_CHECKBOX;
+import static org.onap.sdc.frontend.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.TITLE_DIV;
+
+import java.util.ArrayList;
+import java.util.List;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+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 org.openqa.selenium.support.ui.ExpectedConditions;
 
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.onap.sdc.frontend.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.MAIN_DIV;
-import static org.onap.sdc.frontend.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.NO_DATA_MESSAGE;
-import static org.onap.sdc.frontend.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.PROPERTIES_TABLE;
-import static org.onap.sdc.frontend.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.SOFTWARE_VERSION_INPUT;
-import static org.onap.sdc.frontend.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.SOFTWARE_VERSION_PROPERTY_CHECKBOX;
-import static org.onap.sdc.frontend.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.TITLE_DIV;
-
 /**
  * Handles the Resource Properties Assignment Page UI actions
  */
 public class ResourcePropertiesAssignmentPage extends AbstractPageObject {
 
     private WebElement wrappingElement;
+    private LoaderHelper loaderHelper;
+    private NotificationComponent notificationComponent;
 
     public ResourcePropertiesAssignmentPage(final WebDriver webDriver) {
         super(webDriver);
+        notificationComponent = new NotificationComponent(webDriver);
+        loaderHelper = new LoaderHelper(webDriver);
     }
 
     @Override
@@ -61,7 +73,7 @@
     public List<String> getSoftwareVersionProperty() {
         waitPropertiesToLoad();
         final By swVersionCheckboxLocator = By.xpath(SOFTWARE_VERSION_PROPERTY_CHECKBOX.getXpath());
-        getWait(5).until(ExpectedConditions.visibilityOfElementLocated(swVersionCheckboxLocator));
+        waitForElementVisibility(swVersionCheckboxLocator, 5);
 
         final List<String> softwareVersionList = new ArrayList<>();
         final List<WebElement> elements = wrappingElement.findElements(By.xpath(SOFTWARE_VERSION_INPUT.getXpath()));
@@ -73,41 +85,118 @@
     }
 
     /**
+     * Gets the value of a string TOSCA property.
+     *
+     * @return the value of the property
+     */
+    public String getStringPropertyValue(final String propertyName) {
+        waitPropertiesToLoad();
+        final By propertyCheckboxLocator = By.xpath(PROPERTY_CHECKBOX.getXpath(propertyName));
+        final WebElement propertyCheckbox = waitForElementVisibility(propertyCheckboxLocator, 5);
+        final WebElement propertyRow = propertyCheckbox.findElement(By.xpath("./../../.."));
+        final WebElement propertyInput = propertyRow.findElement(By.xpath(INPUT_PROPERTY.getXpath(propertyName)));
+        return propertyInput.getAttribute("value");
+    }
+
+    /**
+     * Set a value to a TOSCA string property.
+     */
+    public void setStringPropertyValue(final String propertyName, final String value) {
+        if (value == null) {
+            return;
+        }
+        waitPropertiesToLoad();
+        final By propertyCheckboxLocator = By.xpath(PROPERTY_CHECKBOX.getXpath(propertyName));
+        final WebElement propertyCheckbox = waitForElementVisibility(propertyCheckboxLocator, 5);
+        final WebElement propertyRow = propertyCheckbox.findElement(By.xpath("./../../.."));
+        final WebElement propertyInput = propertyRow.findElement(By.xpath(INPUT_PROPERTY.getXpath(propertyName)));
+        propertyInput.sendKeys(value);
+    }
+
+    public void setPropertyValue(final String propertyName, final Object value) {
+        if (value == null) {
+            return;
+        }
+
+        if (value instanceof String) {
+            setStringPropertyValue(propertyName, (String) value);
+            return;
+        }
+
+        if (value instanceof Integer) {
+            setStringPropertyValue(propertyName, ((Integer) value).toString());
+            return;
+        }
+
+        if (value instanceof Boolean) {
+            setStringPropertyValue(propertyName, ((Boolean) value).toString());
+            return;
+        }
+
+        throw new UnsupportedOperationException("Cannot set property value of type: " + value.getClass());
+    }
+
+    /**
+     * Checks if a property exists.
+     *
+     * @return the value of the property
+     */
+    public boolean isPropertyPresent(final String propertyName) {
+        waitPropertiesToLoad();
+        try {
+            waitForElementVisibility(By.xpath(PROPERTY_CHECKBOX.getXpath(propertyName)), 5);
+        } catch (final Exception ignored) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
      * Waits for the properties loading.
      */
     private void waitPropertiesToLoad() {
-        getWait(5)
-            .until(ExpectedConditions.visibilityOfElementLocated(By.xpath(PROPERTIES_TABLE.getXpath())));
-        getWait(5)
-            .until(ExpectedConditions.invisibilityOfElementLocated(By.xpath(NO_DATA_MESSAGE.getXpath())));
+        waitForElementVisibility(By.xpath(PROPERTIES_TABLE.getXpath()), 5);
+        waitForElementInvisibility(By.xpath(NO_DATA_MESSAGE.getXpath()), 5);
+    }
+
+    public void saveProperties() {
+        final WebElement saveBtn = waitForElementVisibility(By.xpath(PROPERTY_SAVE_BTN.getXpath()));
+        assertTrue(saveBtn.isEnabled(), "Property save button should be enabled.");
+        saveBtn.click();
+        loaderHelper.waitForLoader(20);
+        notificationComponent.waitForNotification(NotificationType.SUCCESS, 20);
     }
 
     /**
      * Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
      */
+    @AllArgsConstructor
     public enum XpathSelector {
         MAIN_DIV("w-sdc-main-right-container", "//div[@class='%s']"),
         TITLE_DIV("tab-title", "//div[contains(@class,'%s') and contains(text(), 'Properties Assignment')]"),
         PROPERTIES_TABLE("properties-table", "//div[contains(@class,'%s')]"),
         NO_DATA_MESSAGE("no-data", "//div[contains(@class,'%s') and text()='No data to display']"),
         SOFTWARE_VERSION_PROPERTY_CHECKBOX("software_versions", "//checkbox[@data-tests-id='%s']"),
-        SOFTWARE_VERSION_INPUT("value-prop-software_versions.", "//input[starts-with(@data-tests-id,'%s')]");
+        SOFTWARE_VERSION_INPUT("value-prop-software_versions", "//input[starts-with(@data-tests-id,'%s')]"),
+        PROPERTY_CHECKBOX("//checkbox[@data-tests-id='%s']"),
+        PROPERTY_SAVE_BTN("properties-save-button", "//button[@data-tests-id='%s']"),
+        INPUT_PROPERTY("//input[@data-tests-id='value-prop-%s']");
 
-        private final String id;
+        @Getter
+        private String id;
         private final String xpathFormat;
 
-        XpathSelector(final String id, final String xpathFormat) {
-            this.id = id;
+        XpathSelector(final String xpathFormat) {
             this.xpathFormat = xpathFormat;
         }
 
-        public String getId() {
-            return id;
-        }
-
         public String getXpath() {
             return String.format(xpathFormat, id);
         }
+
+        public String getXpath(final String... xpathParams) {
+            return String.format(xpathFormat, xpathParams);
+        }
     }
 
 }
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
new file mode 100644
index 0000000..70d068f
--- /dev/null
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ResourceWorkspaceTopBarComponent.java
@@ -0,0 +1,91 @@
+/*
+ * ============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.pages;
+
+import static org.onap.sdc.frontend.ci.tests.pages.ResourceWorkspaceTopBarComponent.XpathSelector.FORM_LIFE_CYCLE_STATE;
+import static org.onap.sdc.frontend.ci.tests.pages.ResourceWorkspaceTopBarComponent.XpathSelector.ACTION_BUTTON_DIV;
+import static org.onap.sdc.frontend.ci.tests.pages.ResourceWorkspaceTopBarComponent.XpathSelector.LIFECYCLE_STATE_DIV;
+import static org.onap.sdc.frontend.ci.tests.pages.ResourceWorkspaceTopBarComponent.XpathSelector.MAIN_DIV;
+import static org.onap.sdc.frontend.ci.tests.pages.ResourceWorkspaceTopBarComponent.XpathSelector.VERSION_CONTAINER_DIV;
+import static org.onap.sdc.frontend.ci.tests.pages.ServiceCreatePage.XpathSelector.CREATE_BTN;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Represents the top bar component of the a resource workspace, which contains the resource version, status, progress bar, and some action buttons.
+ */
+public class ResourceWorkspaceTopBarComponent extends AbstractPageObject {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(ResourceWorkspaceTopBarComponent.class);
+
+    private WebElement wrappingElement;
+    private WebElement lifecycleStateDiv;
+    private WebElement versionContainerDiv;
+    private WebElement actionButtonsDiv;
+
+    public ResourceWorkspaceTopBarComponent(final WebDriver webDriver) {
+        super(webDriver);
+    }
+
+    @Override
+    public void isLoaded() {
+        LOGGER.debug("Waiting for element visibility with xpath '{}'", MAIN_DIV.getXpath());
+        wrappingElement = waitForElementVisibility(By.xpath(MAIN_DIV.getXpath()), 5);
+        lifecycleStateDiv = wrappingElement.findElement(By.xpath(LIFECYCLE_STATE_DIV.getXpath()));
+        versionContainerDiv = wrappingElement.findElement(By.xpath(VERSION_CONTAINER_DIV.getXpath()));
+        actionButtonsDiv = wrappingElement.findElement(By.xpath(ACTION_BUTTON_DIV.getXpath()));
+    }
+
+    public void clickOnCreate() {
+        waitToBeClickable(CREATE_BTN.getXpath()).click();
+    }
+
+    public String getLifecycleState() {
+        return lifecycleStateDiv.findElement(By.xpath(FORM_LIFE_CYCLE_STATE.getXpath())).getText();
+    }
+
+    /**
+     * Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
+     */
+    @AllArgsConstructor
+    public enum XpathSelector {
+        MAIN_DIV("sdc-workspace-top-bar", "//div[@class='%s']"),
+        LIFECYCLE_STATE_DIV("lifecycle-state", "//div[@class='%s']"),
+        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']"),
+        FORM_LIFE_CYCLE_STATE("formlifecyclestate", "//span[@data-tests-id='%s']");
+
+        @Getter
+        private final String id;
+        private final String xpathFormat;
+
+        public String getXpath() {
+            return String.format(xpathFormat, id);
+        }
+
+    }
+}
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
new file mode 100644
index 0000000..254a0ec
--- /dev/null
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceComponentPage.java
@@ -0,0 +1,55 @@
+/*
+ * ============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.pages;
+
+import org.onap.sdc.frontend.ci.tests.pages.component.workspace.ToscaArtifactsPage;
+import org.openqa.selenium.WebDriver;
+
+public class ServiceComponentPage extends AbstractPageObject {
+
+    private final TopNavComponent topNavComponent;
+    private final ResourceLeftSideMenu resourceLeftSideMenu;
+    private final ResourceWorkspaceTopBarComponent workspaceTopBarComponent;
+
+    public ServiceComponentPage(final WebDriver webDriver, final TopNavComponent topNavComponent,
+                                final ResourceLeftSideMenu resourceLeftSideMenu,
+                                final ResourceWorkspaceTopBarComponent workspaceTopBarComponent) {
+        super(webDriver);
+        this.topNavComponent = topNavComponent;
+        this.resourceLeftSideMenu = resourceLeftSideMenu;
+        this.workspaceTopBarComponent = workspaceTopBarComponent;
+    }
+
+    @Override
+    public void isLoaded() {
+        topNavComponent.isLoaded();
+        resourceLeftSideMenu.isLoaded();
+        workspaceTopBarComponent.isLoaded();
+    }
+
+    public ResourcePropertiesAssignmentPage goToPropertiesAssignment() {
+        return resourceLeftSideMenu.clickOnPropertiesAssignmentMenuItem();
+    }
+
+    public ToscaArtifactsPage goToToscaArtifacts() {
+        return resourceLeftSideMenu.clickOnToscaArtifactsMenuItem();
+    }
+
+}
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceCreatePage.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceCreatePage.java
new file mode 100644
index 0000000..3a1f3bc
--- /dev/null
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceCreatePage.java
@@ -0,0 +1,139 @@
+/*
+ * ============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.pages;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.equalToIgnoringCase;
+import static org.hamcrest.core.Is.is;
+import static org.onap.sdc.frontend.ci.tests.pages.ServiceCreatePage.XpathSelector.CATEGORY_SELECT;
+import static org.onap.sdc.frontend.ci.tests.pages.ServiceCreatePage.XpathSelector.DESCRIPTION_TEXT_AREA;
+import static org.onap.sdc.frontend.ci.tests.pages.ServiceCreatePage.XpathSelector.ETSI_VERSION_SELECT;
+import static org.onap.sdc.frontend.ci.tests.pages.ServiceCreatePage.XpathSelector.NAME_INPUT;
+
+import org.onap.sdc.frontend.ci.tests.datatypes.LifeCycleStateEnum;
+import org.onap.sdc.frontend.ci.tests.datatypes.ServiceCreateData;
+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.support.ui.Select;
+
+/**
+ * Represents the Service Create Page
+ */
+public class ServiceCreatePage extends AbstractPageObject {
+
+    private final LoaderHelper loaderHelper;
+    private final NotificationComponent notificationComponent;
+    private final ResourceWorkspaceTopBarComponent topBarComponent;
+
+    public ServiceCreatePage(final WebDriver webDriver) {
+        super(webDriver);
+        this.loaderHelper = new LoaderHelper(webDriver);
+        this.notificationComponent = new NotificationComponent(webDriver);
+        this.topBarComponent = new ResourceWorkspaceTopBarComponent(webDriver);
+    }
+
+    @Override
+    public void isLoaded() {
+        topBarComponent.isLoaded();
+        final String lifeCycleState = topBarComponent.getLifecycleState();
+        assertThat("Life cycle state should be as expected",
+            lifeCycleState, is(equalToIgnoringCase(LifeCycleStateEnum.IN_DESIGN.getValue())));
+    }
+
+    /**
+     * Fill the service create form based on the given ServiceCreateData
+     * @param serviceCreateData the form data
+     */
+    public void fillForm(final ServiceCreateData serviceCreateData) {
+        fillName(serviceCreateData.getName());
+        setCategory(serviceCreateData.getCategory());
+        setEtsiVersion(serviceCreateData.getEtsiVersion());
+        fillDescription(serviceCreateData.getDescription());
+    }
+
+    private void setEtsiVersion(final String etsiVersion) {
+        if (etsiVersion == null) {
+            return;
+        }
+        final Select categorySelect = new Select(waitForElementVisibility(By.xpath(ETSI_VERSION_SELECT.getXpath())));
+        categorySelect.selectByVisibleText(etsiVersion);
+    }
+
+    private void setCategory(final String category) {
+        if (category == null) {
+            return;
+        }
+        final Select categorySelect = new Select(findElement(By.xpath(CATEGORY_SELECT.getXpath())));
+        categorySelect.selectByVisibleText(category);
+    }
+
+    public void fillDescription(final String description) {
+        if (description == null) {
+            return;
+        }
+        findElement(By.xpath(DESCRIPTION_TEXT_AREA.getXpath()))
+            .sendKeys(description);
+    }
+
+    public void fillName(final String name) {
+        if (name == null) {
+            return;
+        }
+        findElement(By.xpath(NAME_INPUT.getXpath()))
+            .sendKeys(name);
+    }
+
+    public void clickOnCreate() {
+        topBarComponent.clickOnCreate();
+        loaderHelper.waitForLoader(20);
+        notificationComponent.waitForNotification(NotificationType.SUCCESS, 20);
+    }
+
+    /**
+     * Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
+     */
+    public enum XpathSelector {
+        CREATE_BTN("create/save", "//button[@data-tests-id='%s']"),
+        FORM_LIFE_CYCLE_STATE("formlifecyclestate", "//span[@data-tests-id='%s']"),
+        NAME_INPUT("name", "//input[@data-tests-id='%s']"),
+        CATEGORY_SELECT("selectGeneralCategory", "//select[@data-tests-id='%s']"),
+        ETSI_VERSION_SELECT("ETSI Version", "//select[@data-tests-id='%s']"),
+        DESCRIPTION_TEXT_AREA("description", "//textarea[@data-tests-id='%s']");
+
+        private final String id;
+        private final String xpathFormat;
+
+        XpathSelector(final String id, final String xpathFormat) {
+            this.id = id;
+            this.xpathFormat = xpathFormat;
+        }
+
+        public String getId() {
+            return id;
+        }
+
+        public String getXpath() {
+            return String.format(xpathFormat, id);
+        }
+    }
+}
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/SoftwareProductOnboarding.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/SoftwareProductOnboarding.java
index 189cb5a..cb485b7 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/SoftwareProductOnboarding.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/SoftwareProductOnboarding.java
@@ -19,15 +19,7 @@
 
 package org.onap.sdc.frontend.ci.tests.pages;
 
-import org.hamcrest.core.Is;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
 import static org.onap.sdc.frontend.ci.tests.pages.SoftwareProductOnboarding.XpathSelector.ATTACHMENT_VIEW;
 import static org.onap.sdc.frontend.ci.tests.pages.SoftwareProductOnboarding.XpathSelector.BNT_SUBMIT;
 import static org.onap.sdc.frontend.ci.tests.pages.SoftwareProductOnboarding.XpathSelector.FILE_INPUT;
@@ -37,6 +29,13 @@
 import static org.onap.sdc.frontend.ci.tests.pages.SoftwareProductOnboarding.XpathSelector.PAGE_MAIN_DIV;
 import static org.onap.sdc.frontend.ci.tests.pages.SoftwareProductOnboarding.XpathSelector.SELECTED_NAV_BAR_GROUP_ITEM;
 
+import org.hamcrest.core.Is;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 public class SoftwareProductOnboarding extends AbstractPageObject {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(SoftwareProductOnboarding.class);
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/TopNavComponent.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/TopNavComponent.java
index 8fc5419..6b8e4cf 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/TopNavComponent.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/TopNavComponent.java
@@ -31,6 +31,7 @@
 
 import java.util.List;
 
+import static org.onap.sdc.frontend.ci.tests.pages.TopNavComponent.XpathSelector.*;
 import static org.onap.sdc.frontend.ci.tests.pages.TopNavComponent.XpathSelector.ARROW_DROPDOWN;
 import static org.onap.sdc.frontend.ci.tests.pages.TopNavComponent.XpathSelector.MAIN_MENU_ONBOARD_BTN;
 import static org.onap.sdc.frontend.ci.tests.pages.TopNavComponent.XpathSelector.NAV;
@@ -79,6 +80,15 @@
             .until(ExpectedConditions.visibilityOfElementLocated(By.xpath(REPOSITORY_ICON.getXpath())));
     }
 
+    public boolean isHomeSelected() {
+        final By homeLinkLocator = By.xpath(MAIN_MENU_LINK_HOME.getXpath());
+        getWait().until(ExpectedConditions.visibilityOfElementLocated(homeLinkLocator));
+        final WebElement homeLinkElement = findElement(homeLinkLocator);
+        final WebElement homeLinkParentElement = homeLinkElement.findElement(By.xpath("./.."));
+        final String aClass = homeLinkParentElement.getAttribute("class");
+        return "selected".equals(aClass);
+    }
+
     /**
      * Clicks on the VSP repository icon.
      *
@@ -122,6 +132,7 @@
     public enum XpathSelector {
         NAV("top-nav", "//nav[@class='%s']"),
         SUB_MENU_BUTTON_HOME("sub-menu-button-home", "//*[@data-tests-id='%s']"),
+        MAIN_MENU_LINK_HOME("main-menu-button-home", "//*[@data-tests-id='%s']"),
         ARROW_DROPDOWN("triangle-dropdown", "//li[contains(@class, '%s')]"),
         MAIN_MENU_ONBOARD_BTN("main-menu-button-onboard", "//a[@data-tests-id='%s']"),
         REPOSITORY_ICON("repository-icon", "//*[@data-tests-id='%s']");
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/VspRepositoryModalComponent.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/VspRepositoryModalComponent.java
index 75887fb..4e3b939 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/VspRepositoryModalComponent.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/VspRepositoryModalComponent.java
@@ -19,26 +19,25 @@
 
 package org.onap.sdc.frontend.ci.tests.pages;
 
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.empty;
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsNot.not;
+import static org.onap.sdc.frontend.ci.tests.pages.VspRepositoryModalComponent.XpathSelector.IMPORT_VSP_BTN;
+import static org.onap.sdc.frontend.ci.tests.pages.VspRepositoryModalComponent.XpathSelector.MODAL_DIV;
+import static org.onap.sdc.frontend.ci.tests.pages.VspRepositoryModalComponent.XpathSelector.RESULTS_CONTAINER_DIV;
+import static org.onap.sdc.frontend.ci.tests.pages.VspRepositoryModalComponent.XpathSelector.SEARCH_TXT;
+
+import java.util.List;
 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.NotificationHelper;
+import org.onap.sdc.frontend.ci.tests.utilities.NotificationComponent;
 import org.openqa.selenium.By;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.List;
-
-import static org.hamcrest.Matchers.empty;
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.core.IsNot.not;
-import static org.junit.Assert.assertThat;
-import static org.onap.sdc.frontend.ci.tests.pages.VspRepositoryModalComponent.XpathSelector.IMPORT_VSP_BTN;
-import static org.onap.sdc.frontend.ci.tests.pages.VspRepositoryModalComponent.XpathSelector.MODAL_DIV;
-import static org.onap.sdc.frontend.ci.tests.pages.VspRepositoryModalComponent.XpathSelector.RESULTS_CONTAINER_DIV;
-import static org.onap.sdc.frontend.ci.tests.pages.VspRepositoryModalComponent.XpathSelector.SEARCH_TXT;
-
 /**
  * Handles the VSP Repository Modal UI actions
  */
@@ -73,7 +72,7 @@
             findSubElements(wrappingElement, By.className(RESULTS_CONTAINER_DIV.getId()));
         vspResultList.get(listPosition).click();
         GeneralUIUtils.clickOnElementByTestId(IMPORT_VSP_BTN.getId());
-        return new ResourceCreatePage(webDriver, new LoaderHelper(), new NotificationHelper());
+        return new ResourceCreatePage(webDriver, new LoaderHelper(), new NotificationComponent(webDriver));
     }
 
     /**
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/ToscaArtifactsPage.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/ToscaArtifactsPage.java
new file mode 100644
index 0000000..17ddae1
--- /dev/null
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/component/workspace/ToscaArtifactsPage.java
@@ -0,0 +1,96 @@
+/*
+ * ============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.pages.component.workspace;
+
+import static org.onap.sdc.frontend.ci.tests.pages.component.workspace.ToscaArtifactsPage.XpathSelector.DATA_TABLE_BODY;
+import static org.onap.sdc.frontend.ci.tests.pages.component.workspace.ToscaArtifactsPage.XpathSelector.DOWNLOAD_LINK;
+import static org.onap.sdc.frontend.ci.tests.pages.component.workspace.ToscaArtifactsPage.XpathSelector.MAIN_DIV;
+import static org.onap.sdc.frontend.ci.tests.pages.component.workspace.ToscaArtifactsPage.XpathSelector.TITLE_DIV;
+
+import java.util.ArrayList;
+import java.util.List;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import org.onap.sdc.frontend.ci.tests.pages.AbstractPageObject;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+
+public class ToscaArtifactsPage extends AbstractPageObject {
+
+    private WebElement wrappingElement;
+    private WebElement artifactsTableBody;
+    private final List<String> downloadedArtifactList = new ArrayList<>();
+
+    public ToscaArtifactsPage(final WebDriver webDriver) {
+        super(webDriver);
+    }
+
+    @Override
+    public void isLoaded() {
+        wrappingElement = waitForElementVisibility(By.xpath(MAIN_DIV.getXpath()), 5);
+        waitForElementVisibility(By.xpath(TITLE_DIV.getXpath()), 5);
+        artifactsTableBody = waitForElementVisibility(By.xpath(DATA_TABLE_BODY.getXpath()), 5);
+    }
+
+    public void clickOnDownload(final String artifactName) {
+        artifactsTableBody.findElement(By.xpath(DOWNLOAD_LINK.getXpath(artifactName))).click();
+    }
+
+    public void addToDownloadedArtifactList(final String downloadedArtifactName) {
+        if (downloadedArtifactName == null) {
+            return;
+        }
+        downloadedArtifactList.add(downloadedArtifactName);
+    }
+
+    public List<String> getDownloadedArtifactList() {
+        return new ArrayList<>(downloadedArtifactList);
+    }
+
+    /**
+     * Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
+     */
+    @AllArgsConstructor
+    public enum XpathSelector {
+        MAIN_DIV("w-sdc-main-right-container", "//div[@class='%s']"),
+        TITLE_DIV("tab-title", "//div[contains(@class,'%s') and contains(text(), 'TOSCA Artifacts')]"),
+        DATA_TABLE_BODY("//datatable-body"),
+        DOWNLOAD_LINK("//div[contains(@data-tests-id,'download_%s')]");
+
+        @Getter
+        private String id;
+
+        private final String xpathFormat;
+
+        XpathSelector(final String xpathFormat) {
+            this.xpathFormat = xpathFormat;
+        }
+
+        public String getXpath() {
+            return String.format(xpathFormat, id);
+        }
+
+        public String getXpath(final String... params) {
+            return String.format(xpathFormat, params);
+        }
+
+    }
+}
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
new file mode 100644
index 0000000..b4f17dd
--- /dev/null
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/home/HomePage.java
@@ -0,0 +1,105 @@
+/*
+ * ============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.pages.home;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+import static org.onap.sdc.frontend.ci.tests.pages.home.HomePage.XpathSelector.ADD_BUTTONS_AREA;
+import static org.onap.sdc.frontend.ci.tests.pages.home.HomePage.XpathSelector.ADD_SERVICE_BTN;
+
+import lombok.Getter;
+import org.onap.sdc.frontend.ci.tests.pages.AbstractPageObject;
+import org.onap.sdc.frontend.ci.tests.pages.ServiceCreatePage;
+import org.onap.sdc.frontend.ci.tests.pages.TopNavComponent;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
+
+/**
+ * Represents the user home page
+ */
+public class HomePage extends AbstractPageObject {
+
+    @Getter
+    private final TopNavComponent topNavComponent;
+
+    public HomePage(final WebDriver webDriver, final TopNavComponent topNavComponent) {
+        super(webDriver);
+        this.topNavComponent = topNavComponent;
+    }
+
+    @Override
+    public void isLoaded() {
+        topNavComponent.isLoaded();
+        assertThat("The Home tab should be selected", topNavComponent.isHomeSelected(), is(true));
+    }
+
+    /**
+     * Clicks on the add service button.
+     *
+     * @return the following service create page
+     */
+    public ServiceCreatePage clickOnAddService() {
+        hoverToAddArea();
+        final By addServiceBtnLocator = By.xpath(ADD_SERVICE_BTN.getXpath());
+        waitForElementVisibility(addServiceBtnLocator);
+        final WebElement addServiceBtn = findElement(addServiceBtnLocator);
+        addServiceBtn.click();
+        return new ServiceCreatePage(webDriver);
+    }
+
+    /**
+     * Hovers to the Add buttons area.
+     *
+     * @return the add buttons area element
+     */
+    public WebElement hoverToAddArea() {
+        final Actions actions = new Actions(webDriver);
+        final By addButtonsAreaLocator = By.xpath(ADD_BUTTONS_AREA.getXpath());
+        final WebElement addButtonsAreaElement = findElement(addButtonsAreaLocator);
+        actions.moveToElement(addButtonsAreaElement).build().perform();
+        return addButtonsAreaElement;
+    }
+
+    /**
+     * Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
+     */
+    public enum XpathSelector {
+        ADD_SERVICE_BTN("createServiceButton", "//*[@data-tests-id='%s']"),
+        ADD_BUTTONS_AREA("AddButtonsArea", "//*[@data-tests-id='%s']");
+
+        private final String id;
+        private final String xpathFormat;
+
+        XpathSelector(final String id, final String xpathFormat) {
+            this.id = id;
+            this.xpathFormat = xpathFormat;
+        }
+
+        public String getId() {
+            return id;
+        }
+
+        public String getXpath() {
+            return String.format(xpathFormat, id);
+        }
+    }
+}
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/FileHandling.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/FileHandling.java
index 7ae346c..04b2037 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/FileHandling.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/FileHandling.java
@@ -22,9 +22,14 @@
 
 import com.aventstack.extentreports.Status;
 import com.clearspring.analytics.util.Pair;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.FileNotFoundException;
+import java.nio.file.Path;
 import org.apache.commons.io.FileUtils;
 import org.onap.sdc.backend.ci.tests.config.Config;
 import org.onap.sdc.backend.ci.tests.utils.general.OnboardingUtils;
+import org.onap.sdc.frontend.ci.tests.exception.UnzipException;
 import org.openecomp.sdc.be.model.DataTypeDefinition;
 import org.onap.sdc.frontend.ci.tests.execute.setup.ExtentTestActions;
 import org.onap.sdc.frontend.ci.tests.execute.setup.SetupCDTest;
@@ -243,6 +248,57 @@
 
     }
 
+    public static Map<String, byte[]> getFilesFromZip(byte[] zipFileBytes) throws UnzipException {
+        final Map<String, byte[]> pathAndByteMap = new HashMap<>();
+        try (final ZipInputStream zipInputStream = new ZipInputStream(new ByteArrayInputStream(zipFileBytes))) {
+            ZipEntry zipEntry = zipInputStream.getNextEntry();
+            final byte[] buffer = new byte[1024];
+            while (zipEntry != null) {
+                final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+                try (final ByteArrayOutputStream baos = byteArrayOutputStream) {
+                    int length;
+                    while ((length = zipInputStream.read(buffer)) >= 0) {
+                        baos.write(buffer, 0, length);
+                    }
+                }
+                final byte[] bytes = byteArrayOutputStream.toByteArray();
+                pathAndByteMap.put(zipEntry.getName(), bytes);
+                zipEntry = zipInputStream.getNextEntry();
+            }
+        } catch (final IOException e) {
+            throw new UnzipException("Could not unzip file", e);
+        }
+
+        return pathAndByteMap;
+    }
+
+    public static Map<String, byte[]> getFilesFromZip(final String filepath, final String zipFilename) throws UnzipException {
+        final Path zipFilePath = Path.of(filepath, zipFilename);
+        final Map<String, byte[]> pathAndByteMap = new HashMap<>();
+        try (final ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(zipFilePath.toString()))) {
+            ZipEntry zipEntry = zipInputStream.getNextEntry();
+            final byte[] buffer = new byte[1024];
+            while (zipEntry != null) {
+                final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+                try (final ByteArrayOutputStream baos = byteArrayOutputStream) {
+                    int length;
+                    while ((length = zipInputStream.read(buffer)) >= 0) {
+                        baos.write(buffer, 0, length);
+                    }
+                }
+                final byte[] bytes = byteArrayOutputStream.toByteArray();
+                pathAndByteMap.put(zipEntry.getName(), bytes);
+                zipEntry = zipInputStream.getNextEntry();
+            }
+        } catch (final FileNotFoundException e) {
+            throw new UnzipException("Could not find given file " + zipFilename, e);
+        } catch (final IOException e) {
+            throw new UnzipException("Could not unzip file " + zipFilename, e);
+        }
+
+        return pathAndByteMap;
+    }
+
     public static List<String> getZipFileNamesFromFolder(String filepath) {
         return filterFileNamesListFromFolder(filepath, ".zip");
     }
@@ -261,9 +317,8 @@
 
     /**
      * @return last modified file name from default directory
-     * @throws Exception
      */
-    public static synchronized File getLastModifiedFileNameFromDir() throws Exception {
+    public static synchronized File getLastModifiedFileNameFromDir() {
         return getLastModifiedFileNameFromDir(SetupCDTest.getWindowTest().getDownloadDirectory());
     }
 
@@ -274,8 +329,7 @@
     public static synchronized File getLastModifiedFileNameFromDir(String dirPath) {
         File dir = new File(dirPath);
         File[] files = dir.listFiles();
-        if (files == null) {
-            assertTrue("File not found under directory " + dirPath, false);
+        if (files == null || files.length == 0) {
             return null;
         }
 
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 0170fbf..4149a91 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
@@ -19,13 +19,22 @@
 
 package org.onap.sdc.frontend.ci.tests.utilities;
 
+import lombok.NoArgsConstructor;
 import org.onap.sdc.frontend.ci.tests.execute.setup.DriverFactory;
 import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.support.ui.ExpectedConditions;
 import org.openqa.selenium.support.ui.WebDriverWait;
 
+@NoArgsConstructor
 public class LoaderHelper {
 
+    private WebDriver webDriver;
+
+    public LoaderHelper(final WebDriver webDriver) {
+        this.webDriver = webDriver;
+    }
+
     private final By locator = By.className("tlv-loader");
 
     public void waitForLoader(final int timeout) {
@@ -43,7 +52,7 @@
     }
 
     private WebDriverWait getWait(final int timeout) {
-        return new WebDriverWait(DriverFactory.getDriver(), timeout);
+        return new WebDriverWait(webDriver == null ? DriverFactory.getDriver() : webDriver, timeout);
     }
 
 }
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/NotificationHelper.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/NotificationComponent.java
similarity index 70%
rename from integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/NotificationHelper.java
rename to integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/NotificationComponent.java
index 46d5c64..676b0a1 100644
--- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/NotificationHelper.java
+++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/NotificationComponent.java
@@ -19,25 +19,30 @@
 
 package org.onap.sdc.frontend.ci.tests.utilities;
 
-import org.onap.sdc.frontend.ci.tests.execute.setup.DriverFactory;
+import static org.onap.sdc.frontend.ci.tests.utilities.NotificationComponent.XpathSelector.MAIN_CONTAINER_DIV;
+import static org.onap.sdc.frontend.ci.tests.utilities.NotificationComponent.XpathSelector.MESSAGE_CONTENT_DIV;
+import static org.onap.sdc.frontend.ci.tests.utilities.NotificationComponent.XpathSelector.MESSAGE_SUCCESS_DIV;
+
+import org.onap.sdc.frontend.ci.tests.pages.AbstractPageObject;
 import org.openqa.selenium.By;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.WebDriverWait;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.onap.sdc.frontend.ci.tests.utilities.NotificationHelper.XpathSelector.MAIN_CONTAINER_DIV;
-import static org.onap.sdc.frontend.ci.tests.utilities.NotificationHelper.XpathSelector.MESSAGE_CONTENT_DIV;
-import static org.onap.sdc.frontend.ci.tests.utilities.NotificationHelper.XpathSelector.MESSAGE_SUCCESS_DIV;
+public class NotificationComponent extends AbstractPageObject {
 
-public class NotificationHelper {
+    public NotificationComponent(final WebDriver webDriver) {
+        super(webDriver);
+    }
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(NotificationHelper.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(NotificationComponent.class);
 
     public void waitForNotification(final NotificationType notificationType, final int timeout) {
         final By messageLocator = getMessageLocator(notificationType);
-        waitForVisibility(messageLocator, timeout);
-        waitForInvisibility(messageLocator, timeout);
+        final WebElement webElement = waitForElementVisibility(messageLocator, timeout);
+        webElement.click();
+        waitForElementInvisibility(messageLocator, 5);
     }
 
     private By getMessageLocator(final NotificationType notificationType) {
@@ -49,28 +54,19 @@
             return String.format("%s%s%s", MAIN_CONTAINER_DIV.getXpath(), MESSAGE_CONTENT_DIV.getXpath(), MESSAGE_SUCCESS_DIV.getXpath());
         }
 
-        LOGGER.warn("Xpath for NotificationType {} not yet implemented. Returning empty Xpath.", notificationType);
-        return "";
+        LOGGER.warn("Xpath for NotificationType {} not yet implemented.", notificationType);
+        return "notYetImplemented";
     }
 
-    private void waitForVisibility(By messageLocator, final int timeout) {
-        getWait(timeout)
-            .until(ExpectedConditions.visibilityOfElementLocated(messageLocator));
-    }
-
-    private void waitForInvisibility(By messageLocator, int timeout) {
-        getWait(timeout)
-            .until(ExpectedConditions.invisibilityOfElementLocated(messageLocator));
-    }
-
-    private WebDriverWait getWait(final int timeout) {
-        return new WebDriverWait(DriverFactory.getDriver(), timeout);
+    @Override
+    public void isLoaded() {
+        //will not be loaded when needed
     }
 
     public enum XpathSelector {
         MAIN_CONTAINER_DIV("notification-container", "//div[@class='%s']"),
         MESSAGE_CONTENT_DIV("msg-content", "//div[@class='%s']"),
-        MESSAGE_SUCCESS_DIV("message", "//div[contains(@class, '%s') and contains(text(),'successfully')]");
+        MESSAGE_SUCCESS_DIV("message", "//div[contains(@class, 'message') and (contains(text(),'successfully') or contains(text(), 'Successfully'))]");
 
         private final String id;
         private final String xpath;
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 5303e3b..e4b07d3 100644
--- a/integration-tests/src/test/resources/ci/conf/sdc-conf.yaml
+++ b/integration-tests/src/test/resources/ci/conf/sdc-conf.yaml
@@ -13,7 +13,7 @@
 #remoteTesting: false
 #useBrowserMobProxy: false
 #captureTraffic: false
-#downloadAutomationFolder: /home/seb/Downloads
+#downloadAutomationFolder: /tmp/sdc-integration-tests/downloadAutomation
 #uiSimulator: true
 
 #### Backend Testing
diff --git a/integration-tests/src/test/resources/ci/testSuites/frontend/onapUiSanity.xml b/integration-tests/src/test/resources/ci/testSuites/frontend/onapUiSanity.xml
index db352d3..2cc0808 100644
--- a/integration-tests/src/test/resources/ci/testSuites/frontend/onapUiSanity.xml
+++ b/integration-tests/src/test/resources/ci/testSuites/frontend/onapUiSanity.xml
@@ -26,6 +26,11 @@
         </methods>
       </class>
       <class name="org.onap.sdc.frontend.ci.tests.execute.sanity.GAB"/>
+      <class name="org.onap.sdc.frontend.ci.tests.execute.sanity.EtsiNetworkServiceUiTests">
+        <methods>
+          <include name="createEtsiNetworkService"/>
+        </methods>
+      </class>
     </classes>
   </test>
 </suite>
