aboutsummaryrefslogtreecommitdiffstats
path: root/ui-ci/src
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2018-03-04 14:53:33 +0200
committerMichael Lando <ml636r@att.com>2018-03-07 13:19:05 +0000
commita5445100050e49e83f73424198d73cd72d672a4d (patch)
treecacf4df817df31be23e4e790d1dda857bdae061e /ui-ci/src
parent51157f92c21976cba4914c378aaa3cba49826931 (diff)
Sync Integ to Master
Change-Id: I71e3acc26fa612127756ac04073a522b9cc6cd74 Issue-ID: SDC-977 Signed-off-by: Gitelman, Tal (tg851x) <tg851x@intl.att.com>
Diffstat (limited to 'ui-ci/src')
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/AddComponentInstancesArtifactsInCsar.java25
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/ImportUpdateInformationalDeploymentArtifacts.java132
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/LocalGeneralUtilities.java17
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MIBsArtifactsOnResourceInstance.java3
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Service_Tests_UI.java10
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Testing.java3
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/VfModule.java49
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/businesslogic/ArtifactBusinessLogic.java7
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProvider/OnbordingDataProviders.java17
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasElement.java6
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasManager.java125
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java91
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PortMirrioringConfigurationObject.java74
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PortMirroringEnum.java48
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/UserManagementTab.java3
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java4
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/CreatePath.java997
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathValidations.java23
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/AdminUserManagment.java14
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTest.java25
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportDCAE.java6
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportVFCAsset.java9
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardViaApis.java62
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsThroughAPI.java (renamed from ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlows.java)142
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsUI.java (renamed from ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Onboard.java)97
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java48
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PortMirroring.java648
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignment.java43
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Service.java85
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ToscaValidationTest.java434
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VFCArtifacts.java76
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java21
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfAPI.java738
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfArtifacts.java52
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfDeploymentInformationalArtifacts.java42
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/DriverFactory.java16
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentManager.java39
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestManager.java7
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java33
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/CompositionPage.java37
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/DeploymentArtifactPage.java9
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertiesAssignmentPage.java83
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ArtifactUIUtils.java3
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/FileHandling.java14
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/GeneralUIUtils.java113
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/HomeUtils.java28
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUiUtils.java833
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/PortMirroringUtils.java132
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/RestCDUtils.java25
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/DeploymentViewVerificator.java21
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PortMirroringVerificator.java85
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PropertiesAssignmentVerificator.java18
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ServiceVerificator.java17
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ToscaValidation.java295
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfModuleVerificator.java16
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfVerificator.java37
-rw-r--r--ui-ci/src/main/resources/META-INF/aop-ajc.xml15
-rw-r--r--ui-ci/src/main/resources/ci/conf/attsdc.yaml2
-rw-r--r--ui-ci/src/main/resources/ci/scripts/addUsersFromList_new.sh4
-rw-r--r--ui-ci/src/main/resources/ci/scripts/sendMail.sh5
-rw-r--r--ui-ci/src/main/resources/ci/scripts/startTest.sh34
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/PortMirroring.xml9
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/andreyPara.xml29
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/devOnboardE2EOneFileSanity.xml2
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/extendedSanity.xml13
-rw-r--r--ui-ci/src/main/resources/log4j2.xml38
-rw-r--r--ui-ci/src/main/resources/reportportal.properties5
67 files changed, 4369 insertions, 1824 deletions
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/AddComponentInstancesArtifactsInCsar.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/AddComponentInstancesArtifactsInCsar.java
index 47fd8330c5..f72e531b61 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/AddComponentInstancesArtifactsInCsar.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/AddComponentInstancesArtifactsInCsar.java
@@ -37,10 +37,7 @@ import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.model.ComponentInstance;
import org.openecomp.sdc.be.model.Resource;
import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.*;
import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
import org.openecomp.sdc.ci.tests.execute.devCI.ArtifactFromCsar;
@@ -52,14 +49,15 @@ import org.openecomp.sdc.ci.tests.utilities.FileHandling;
import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import com.clearspring.analytics.util.Pair;
-
+import org.openecomp.sdc.ci.tests.utils.general.VendorLicenseModelRestUtils;
+import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
public class AddComponentInstancesArtifactsInCsar extends SetupCDTest {
@@ -84,15 +82,14 @@ public class AddComponentInstancesArtifactsInCsar extends SetupCDTest {
String vnfFile = "FDNT.zip";
String snmpFile = "Fault-alarms-ASDC-vprobes-vLB.zip";
- AmdocsLicenseMembers amdocsLicenseMembers = OnboardingUtils.createVendorLicense(getUser());
+ AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Pair<String, Map<String, String>> createVSP = OnboardingUtils.createVSP(resourceReqDetails, vnfFile, filePath, getUser(), amdocsLicenseMembers);
+ Pair<String, VendorSoftwareProductObject> createVSP = VendorSoftwareProductRestUtils.createVSP(resourceReqDetails, vnfFile, filePath, getUser(), amdocsLicenseMembers);
String vspName = createVSP.left;
resourceMetaData.setName(vspName);
- Map<String, String> resourceMeta = createVSP.right;
- String vspid = resourceMeta.get("vspId");
- OnboardingUtils.addVFCArtifacts(filePath, snmpFile, null, vspid, getUser());
- OnboardingUtils.prepareVspForUse(getUser(), vspid, "0.1");
+ VendorSoftwareProductObject resourceMeta = createVSP.right;
+ VendorSoftwareProductRestUtils.addVFCArtifacts(filePath, snmpFile, null, resourceMeta, getUser());
+ VendorSoftwareProductRestUtils.prepareVspForUse(getUser(), resourceMeta, true);
HomePage.showVspRepository();
OnboardingUiUtils.importVSP(createVSP);
@@ -355,7 +352,7 @@ public class AddComponentInstancesArtifactsInCsar extends SetupCDTest {
Integer responseCode = uploadArtifactRestResponse.getErrorCode();
Assert.assertEquals(responseCode, (Integer)200, "Response code is not correct.");
- ImmutablePair<ComponentInstance, ArtifactDefinition> pair = ImmutablePair.of(componentInstance, ArtifactRestUtils.getArtifactDataFromJson(uploadArtifactRestResponse.getResponse()));
+ ImmutablePair<ComponentInstance, ArtifactDefinition> pair = ImmutablePair.of(componentInstance, ResponseParser.convertArtifactDefinitionResponseToJavaObject(uploadArtifactRestResponse.getResponse()));
return pair;
}
@@ -381,7 +378,7 @@ public class AddComponentInstancesArtifactsInCsar extends SetupCDTest {
Assert.assertEquals(responseCode, (Integer)200, "Response code is not correct.");
- ImmutablePair<ComponentInstance, ArtifactDefinition> pair = ImmutablePair.of(componentInstance, ArtifactRestUtils.getArtifactDataFromJson(uploadArtifactRestResponse.getResponse()));
+ ImmutablePair<ComponentInstance, ArtifactDefinition> pair = ImmutablePair.of(componentInstance, ResponseParser.convertArtifactDefinitionResponseToJavaObject(uploadArtifactRestResponse.getResponse()));
return pair;
}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/ImportUpdateInformationalDeploymentArtifacts.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/ImportUpdateInformationalDeploymentArtifacts.java
index 8fd3c469be..efe2ca1466 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/ImportUpdateInformationalDeploymentArtifacts.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/ImportUpdateInformationalDeploymentArtifacts.java
@@ -44,7 +44,6 @@ import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
import org.openecomp.sdc.common.api.ArtifactTypeEnum;
-import org.testng.SkipException;
import org.testng.annotations.Test;
public class ImportUpdateInformationalDeploymentArtifacts extends SetupCDTest {
@@ -56,10 +55,6 @@ public class ImportUpdateInformationalDeploymentArtifacts extends SetupCDTest {
@Test
public void importVfvArtifactsDeploymentArtifactsMultipleArtifactsMultipleTypes() throws Exception {
- if(true){
- throw new SkipException("Due to the new design the test should be updated accordingly");
- }
-
String filePath = FileHandling.getFilePath(folder);
ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
@@ -80,6 +75,8 @@ public class ImportUpdateInformationalDeploymentArtifacts extends SetupCDTest {
List<ArtifactDefinition> filteredArtifactNames =
//Stream of component Instances
resource.getComponentInstances().stream()
+ //filter out all nulls
+ .filter( e -> e.getDeploymentArtifacts() != null )
//Stream of all the artifacts on all the component instances
.flatMap( e -> e.getDeploymentArtifacts().values().stream())
//filter relevant artifact types
@@ -87,7 +84,6 @@ public class ImportUpdateInformationalDeploymentArtifacts extends SetupCDTest {
//collect to list
.collect(Collectors.toList());
-
assertTrue("Not contain all SNMP TRAP artifacts.", filteredArtifactNames.stream()
.filter(e -> e.getArtifactType().equals(ArtifactTypeEnum.SNMP_TRAP.getType()))
.map(e -> e.getArtifactName())
@@ -109,81 +105,31 @@ public class ImportUpdateInformationalDeploymentArtifacts extends SetupCDTest {
});
}
-
-
-
- // US747946 - Import artifacts to component instances
- // TC1408044 - Import VFC Artifacts - Informational Artifacts on Single VFC
- @Test
- public void importVfcArtifactsInformationalArtifactsOnSingleVfc() throws Exception {
-
- if(true){
- throw new SkipException("Due to the new design the test should be updated accordingly");
- }
-
- String filePath = FileHandling.getFilePath(folder);
- String fileName = "TC1408044.csar";
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
-
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
-
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), "0.1");
-
- resource.getComponentInstances().forEach(e -> {
-
- if(e.getToscaComponentName().endsWith("heat.ltm")) {
- Map<String, List<String>> artifactsMap = new HashMap<String, List<String>>() {
- {
- put(ArtifactTypeEnum.GUIDE.getType(), Arrays.asList("module_1_ldsa.yaml", "vendor-license-model.xml"));
- put(ArtifactTypeEnum.OTHER.getType(), Arrays.asList("module_2_ldsa.yaml", "vf-license-model.xml"));
- }
- };
-
- validateInformationalArtifactOnComponetInstance(e, artifactsMap, "heat.ltm");
- }
- });
- }
-
+
// TODO: Note there is performance issue with this CSAR
// US747946 - Import artifacts to component instances
// TC1407998 - Import VFC Artifacts - Deployment & Informational Artifacts - Multiple VFCs
@Test
public void importVfcArtifactsDeploymentAndInformationalArtifactsMultipleVfcs() throws Exception {
- if(true){
- throw new SkipException("Due to the new design the test should be updated accordingly");
- }
-
String filePath = FileHandling.getFilePath(folder);
String fileName = "TC1407998.csar";
ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
-
-// resourceMetaData.setName("TC1407998");
Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), "0.1");
resource.getComponentInstances().forEach(e -> {
- if(e.getToscaComponentName().endsWith("heat.ps")) {
+ if(e.getToscaComponentName().endsWith("heat.cm")) {
Map<String, List<String>> deployArtifactsMap = new HashMap<String, List<String>>() {
{
put(ArtifactTypeEnum.SNMP_POLL.getType(), Arrays.asList("PS_DEPL_Poll1.mib", "PS_DEPL_Poll2.xml", "PS_DEPL_Poll3.yaml"));
put(ArtifactTypeEnum.SNMP_TRAP.getType(), Arrays.asList("PS_DEPL_Trap1.mib", "PS_DEPL_Trap2.xml", "PS_DEPL_Trap3.sh", "PS_DEPL_Trap4.yml"));
}
};
- validateDeploymentArtifactOnComponetInstance(e, deployArtifactsMap, "heat.ps");
-
- Map<String, List<String>> infoArtifactsMap = new HashMap<String, List<String>>() {
- {
- put(ArtifactTypeEnum.GUIDE.getType(), Arrays.asList("PS_INFO_GUIDE1.yaml", "PS_INFO_GUIDE2.xml"));
- put(ArtifactTypeEnum.OTHER.getType(), Arrays.asList("PS_INFO_OTHER1.yaml", "PS_INFO_OTHER2.xml"));
- }
- };
- validateInformationalArtifactOnComponetInstance(e, infoArtifactsMap, "heat.ps");
-
+ validateDeploymentArtifactOnComponetInstance(e, deployArtifactsMap, "heat.cm");
} else if (e.getToscaComponentName().endsWith("heat.sm")) {
Map<String, List<String>> deployArtifactsMap = new HashMap<String, List<String>>() {
@@ -193,14 +139,6 @@ public class ImportUpdateInformationalDeploymentArtifacts extends SetupCDTest {
}
};
validateDeploymentArtifactOnComponetInstance(e, deployArtifactsMap, "heat.sm");
-
- Map<String, List<String>> infoArtifactsMap = new HashMap<String, List<String>>() {
- {
- put(ArtifactTypeEnum.GUIDE.getType(), Arrays.asList("SM_INFO_GUIDE1.yaml", "SM_INFO_GUIDE2.xml"));
- put(ArtifactTypeEnum.OTHER.getType(), Arrays.asList("SM_INFO_OTHER1.yaml", "SM_INFO_OTHER2.xml"));
- }
- };
- validateInformationalArtifactOnComponetInstance(e, infoArtifactsMap, "heat.sm");
}
});
@@ -211,18 +149,12 @@ public class ImportUpdateInformationalDeploymentArtifacts extends SetupCDTest {
@Test
public void importVfcArtifactsDeploymentArtifactsExtraFolderUnderVfcIdentification() throws Exception {
- if(true){
- throw new SkipException("Due to the new design the test should be updated accordingly");
- }
-
String filePath = FileHandling.getFilePath(folder);
String fileName = "TC1410352.csar";
ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
-
-// resourceMetaData.setName("TC1410352");
Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), "0.1");
resource.getComponentInstances().forEach(e -> {
@@ -235,14 +167,6 @@ public class ImportUpdateInformationalDeploymentArtifacts extends SetupCDTest {
}
};
validateDeploymentArtifactOnComponetInstance(e, deployArtifactsMap, "heat.ltm");
-
- Map<String, List<String>> infoArtifactsMap = new HashMap<String, List<String>>() {
- {
- put(ArtifactTypeEnum.GUIDE.getType(), Arrays.asList("GUIDE1.yaml", "GUIDE2.xml"));
- put(ArtifactTypeEnum.OTHER.getType(), Arrays.asList("OTHER1.yaml", "OTHER2.xml"));
- }
- };
- validateInformationalArtifactOnComponetInstance(e, infoArtifactsMap, "heat.ltm");
}
});
}
@@ -253,18 +177,12 @@ public class ImportUpdateInformationalDeploymentArtifacts extends SetupCDTest {
@Test
public void importVfcArtifactsDeploymentArtifactsInvalidArtifactType() throws Exception {
- if(true){
- throw new SkipException("Due to the new design the test should be updated accordingly");
- }
-
String filePath = FileHandling.getFilePath(folder);
String fileName = "TC1425032.csar";
ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
-
-// resourceMetaData.setName("TC1425032");
Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), "0.1");
resource.getComponentInstances().forEach(e -> {
@@ -277,44 +195,15 @@ public class ImportUpdateInformationalDeploymentArtifacts extends SetupCDTest {
}
};
validateDeploymentArtifactOnComponetInstance(e, deployArtifactsMap, "heat.ltm");
-
- Map<String, List<String>> infoArtifactsMap = new HashMap<String, List<String>>() {
- {
- put(ArtifactTypeEnum.GUIDE.getType(), Arrays.asList("InfoGuide1.yaml", "InfoGuide2.xml"));
- put(ArtifactTypeEnum.OTHER.getType(), Arrays.asList("InfoOther1.yaml", "InfoOther2.xml", "InfoInvalid1.yaml"));
- }
- };
- validateInformationalArtifactOnComponetInstance(e, infoArtifactsMap, "heat.ltm");
}
});
}
-
-
- private void validateInformationalArtifactOnComponetInstance(ComponentInstance instacne, Map<String, List<String>> artifactsMap, String endswith){
- if(instacne.getToscaComponentName().endsWith(endswith) ){
- Set<String> types = artifactsMap.keySet();
- Map<String, List<ArtifactDefinition>> collect = instacne.getArtifacts().values().stream()
- .filter( a -> types.contains(a.getArtifactType()))
- .collect(Collectors.groupingBy( e -> e.getArtifactType()));
-
- types.forEach(m -> {
- if(collect.containsKey(m)){
- List<String> found = collect.get(m).stream().map(e -> e.getArtifactName()).collect(Collectors.toList());
- boolean isValid = found.containsAll(artifactsMap.get(m)) && artifactsMap.get(m).containsAll(found);
- assertTrue("Not contain all artifact of type: " + m, isValid);
- } else{
- assertTrue("Contains informational artifact which not in provided list", false);
- }
- });
- }
- }
-
- private void validateDeploymentArtifactOnComponetInstance(ComponentInstance instacne, Map<String, List<String>> artifactsMap, String endswith){
- if(instacne.getToscaComponentName().endsWith(endswith) ){
+ private void validateDeploymentArtifactOnComponetInstance(ComponentInstance instance, Map<String, List<String>> artifactsMap, String endswith){
+ if(instance.getToscaComponentName().endsWith(endswith) ){
Set<String> types = artifactsMap.keySet();
- Map<String, List<ArtifactDefinition>> collect = instacne.getDeploymentArtifacts().values().stream()
+ Map<String, List<ArtifactDefinition>> collect = instance.getDeploymentArtifacts().values().stream()
.filter( a -> types.contains(a.getArtifactType()))
.collect(Collectors.groupingBy( e -> e.getArtifactType()));
@@ -330,11 +219,6 @@ public class ImportUpdateInformationalDeploymentArtifacts extends SetupCDTest {
}
}
-
-
-
-
-
@Override
protected UserRoleEnum getRole() {
return UserRoleEnum.DESIGNER;
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/LocalGeneralUtilities.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/LocalGeneralUtilities.java
index e2650fe4b3..9018da6eae 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/LocalGeneralUtilities.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/LocalGeneralUtilities.java
@@ -19,11 +19,8 @@
*/
package org.openecomp.sdc.ci.tests.US;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+import com.clearspring.analytics.util.Pair;
import org.json.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
@@ -31,14 +28,18 @@ import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
import org.openecomp.sdc.ci.tests.pages.HomePage;
import org.openecomp.sdc.ci.tests.utilities.FileHandling;
import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
+import org.openecomp.sdc.ci.tests.utils.general.VendorLicenseModelRestUtils;
+import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
-import com.clearspring.analytics.util.Pair;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
public class LocalGeneralUtilities {
@@ -76,8 +77,8 @@ public static List<String> getValuesFromJsonArray(RestResponse message) throws E
}
public static String simpleOnBoarding(ResourceReqDetails resourceReqDetails, String fileName, String filePath,User user) throws Exception {
- AmdocsLicenseMembers amdocsLicenseMembers = OnboardingUiUtils.createVendorLicense(user);
- Pair<String, Map<String, String>> createVendorSoftwareProduct = OnboardingUtils.createVendorSoftwareProduct(resourceReqDetails, fileName, filePath, user, amdocsLicenseMembers);
+ AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(user);
+ Pair<String, VendorSoftwareProductObject> createVendorSoftwareProduct = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, fileName, filePath, user, amdocsLicenseMembers);
String vspName = createVendorSoftwareProduct.left;
HomePage.showVspRepository();
OnboardingUiUtils.importVSP(createVendorSoftwareProduct);
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MIBsArtifactsOnResourceInstance.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MIBsArtifactsOnResourceInstance.java
index a7d96dd2c7..7815f69d99 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MIBsArtifactsOnResourceInstance.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MIBsArtifactsOnResourceInstance.java
@@ -86,7 +86,7 @@ public class MIBsArtifactsOnResourceInstance extends SetupCDTest {
// 2. Upload MIBs artifacts - SNMP_TRAP & SNMP_POLL.
ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
- List<ArtifactInfo> deploymentArtifactList = new ArrayList<ArtifactInfo>();
+ List<ArtifactInfo> deploymentArtifactList = new ArrayList<>();
deploymentArtifactList.add(new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "SNMP_TRAP"));
deploymentArtifactList.add(new ArtifactInfo(filePath, "sample-xml-alldata-1-1.xml", "cuku", "artifact2", "SNMP_POLL"));
for (ArtifactInfo deploymentArtifact : deploymentArtifactList) {
@@ -101,6 +101,7 @@ public class MIBsArtifactsOnResourceInstance extends SetupCDTest {
// Verify that uploaded correct file by download artifact via external api
RestResponse restResponse = ArtifactRestUtils.getResourceDeploymentArtifactExternalAPI(resourceUUID, artifactUUID, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ComponentTypeEnum.RESOURCE.toString());
File file = new File(deploymentArtifact.getFilepath() + deploymentArtifact.getFilename());
+
String readFileToString = FileUtils.readFileToString(file);
Assert.assertEquals(restResponse.getResponse(), readFileToString);
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Service_Tests_UI.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Service_Tests_UI.java
index 6ae9a34a84..2362a1acab 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Service_Tests_UI.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Service_Tests_UI.java
@@ -24,12 +24,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
+import org.openecomp.sdc.ci.tests.datatypes.*;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.StepsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
@@ -54,7 +50,7 @@ public class Service_Tests_UI extends SetupCDTest{
public void declareVL_CP_InputsInServiceLevel() throws Exception {
String vnfFile = "FDNT.zip";
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Pair<String,Map<String,String>> VspName = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, FileHandling.getVnfRepositoryPath(), vnfFile, getUser());
+ Pair<String, VendorSoftwareProductObject> VspName = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, FileHandling.getVnfRepositoryPath(), vnfFile, getUser());
ServiceReqDetails servicemetadata = ElementFactory.getDefaultService(getUser());
ServiceUIUtils.createService(servicemetadata, getUser());
GeneralUIUtils.moveToStep(StepsEnum.COMPOSITION);
@@ -73,7 +69,7 @@ public class Service_Tests_UI extends SetupCDTest{
public void CreateServiceWithCpInstance() throws Exception {
String vnfFile = "FDNT.zip";
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Pair<String,Map<String,String>> VspName = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, FileHandling.getVnfRepositoryPath(), vnfFile, getUser());
+ Pair<String, VendorSoftwareProductObject> VspName = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, FileHandling.getVnfRepositoryPath(), vnfFile, getUser());
ServiceReqDetails servicemetadata = ElementFactory.getDefaultService(getUser());
ServiceUIUtils.createService(servicemetadata, getUser());
GeneralUIUtils.moveToStep(StepsEnum.COMPOSITION);
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Testing.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Testing.java
index 9c727bb100..69f90baee5 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Testing.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Testing.java
@@ -22,6 +22,7 @@ package org.openecomp.sdc.ci.tests.US;
import java.io.File;
import java.text.SimpleDateFormat;
+import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@@ -34,6 +35,8 @@ import org.openecomp.sdc.ci.tests.utilities.FileHandling;
import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils;
import org.testng.Assert;
+import fj.data.Array;
+
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/VfModule.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/VfModule.java
index 3efb42d569..515649a486 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/VfModule.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/VfModule.java
@@ -20,50 +20,33 @@
package org.openecomp.sdc.ci.tests.US;
-import static org.testng.AssertJUnit.assertNotNull;
-
-import java.awt.AWTException;
-import java.io.File;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
+import com.aventstack.extentreports.Status;
+import com.clearspring.analytics.util.Pair;
import org.openecomp.sdc.be.model.Service;
import org.openecomp.sdc.ci.tests.dataProviders.OnbordingDataProviders;
-import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
+import org.openecomp.sdc.ci.tests.datatypes.*;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ToscaArtifactsScreenEnum;
-import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.TypeHeatMetaDefinition;
import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
import org.openecomp.sdc.ci.tests.execute.devCI.ArtifactFromCsar;
import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
+import org.openecomp.sdc.ci.tests.pages.*;
import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.DownloadManager;
+import org.openecomp.sdc.ci.tests.utilities.*;
import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
import org.openecomp.sdc.ci.tests.utils.CsarParserUtils;
import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils;
-import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
+import org.openecomp.sdc.ci.tests.utils.general.*;
import org.openecomp.sdc.ci.tests.verificator.ServiceVerificator;
import org.openecomp.sdc.ci.tests.verificator.VfModuleVerificator;
import org.testng.annotations.Test;
-import com.aventstack.extentreports.Status;
-import com.clearspring.analytics.util.Pair;
+import java.awt.*;
+import java.io.File;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import static org.testng.AssertJUnit.assertNotNull;
/**
* @author al714h
@@ -87,12 +70,12 @@ public class VfModule extends SetupCDTest {
getExtendTest().log(Status.INFO, String.format("Going to onboard the VNF %s......", vnfFile));
System.out.println(String.format("Going to onboard the VNF %s......", vnfFile));
- AmdocsLicenseMembers amdocsLicenseMembers = OnboardingUiUtils.createVendorLicense(getUser());
+ AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Pair<String, Map<String, String>> createVendorSoftwareProduct = OnboardingUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filepath, getUser(), amdocsLicenseMembers);
+ Pair<String, VendorSoftwareProductObject> createVendorSoftwareProduct = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filepath, getUser(), amdocsLicenseMembers);
String vspName = createVendorSoftwareProduct.left;
//
- DownloadManager.downloadCsarByNameFromVSPRepository(vspName, createVendorSoftwareProduct.right.get("vspId"));
+ DownloadManager.downloadCsarByNameFromVSPRepository(vspName, createVendorSoftwareProduct.right.getVspId());
File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir();
List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition = CsarParserUtils.getListTypeHeatMetaDefinition(latestFilefromDir);
//
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/businesslogic/ArtifactBusinessLogic.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/businesslogic/ArtifactBusinessLogic.java
index 3b15686733..272e0c16b6 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/businesslogic/ArtifactBusinessLogic.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/businesslogic/ArtifactBusinessLogic.java
@@ -31,6 +31,8 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import ch.qos.logback.classic.util.ContextInitializer;
+import com.google.gson.Gson;
import org.openecomp.sdc.be.datatypes.elements.HeatParameterDataDefinition;
import org.openecomp.sdc.be.model.ArtifactDefinition;
import org.openecomp.sdc.ci.tests.datatypes.HeatAndHeatEnvNamesPair;
@@ -65,14 +67,14 @@ public class ArtifactBusinessLogic {
String artifactsFilePath = filePath + "Artifacts" + File.separator;
List<File> fileListFromArtifactsDirectory = FileHandling.getHeatAndHeatEnvArtifactsFromZip(new File(artifactsFilePath), okFileExtensions);
Map<String, Object> combinedMap = ArtifactFromCsar.combineHeatArtifacstWithFolderArtifacsToMap(pathToDirectory.toString());
- LinkedList<HeatMetaFirstLevelDefinition> deploymentArtifacts = ((LinkedList<HeatMetaFirstLevelDefinition>) combinedMap.get(DEPLOYMENT));
+ LinkedList<HeatMetaFirstLevelDefinition> deploymentArtifacts = (LinkedList<HeatMetaFirstLevelDefinition>) combinedMap.get(DEPLOYMENT);
for(HeatMetaFirstLevelDefinition deploymentArtifact : deploymentArtifacts){
String type = deploymentArtifact.getType();
if(type.equals(ArtifactTypeEnum.HEAT.getType()) ||
type.equals(ArtifactTypeEnum.HEAT_ENV.getType()) ||
type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) ||
type.equals(ArtifactTypeEnum.HEAT_NET.getType())){
- File file = (new File(artifactsFilePath + deploymentArtifact.getFileName()));
+ File file = new File(artifactsFilePath + deploymentArtifact.getFileName());
if(fileListFromArtifactsDirectory.contains(file)){
fileList.add(file);
}else{
@@ -184,7 +186,6 @@ public class ArtifactBusinessLogic {
if(parameter.getValue() instanceof java.util.LinkedHashMap){
pairValue = gson.toJson(parameter.getValue());
}
-// pair = Pair.create(envParametersMap.get(key).left, "\"" + pairValue + "\"");
pair = Pair.create(envParametersMap.get(key).left, pairValue );
}else if(envParametersMap.get(key).left.equals("json") && parameter.getValue() == null){
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProvider/OnbordingDataProviders.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProvider/OnbordingDataProviders.java
index ad9ce781c8..c201eb8f94 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProvider/OnbordingDataProviders.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProvider/OnbordingDataProviders.java
@@ -1,14 +1,15 @@
package org.openecomp.sdc.ci.tests.dataProvider;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
import org.openecomp.sdc.ci.tests.execute.sanity.ToscaValidationTest;
import org.openecomp.sdc.ci.tests.utilities.FileHandling;
import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Factory;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
public class OnbordingDataProviders {
protected static String filepath = FileHandling.getVnfRepositoryPath();
@@ -50,10 +51,10 @@ public class OnbordingDataProviders {
}
// -----------------------factories-----------------------------------------
- @Factory(dataProvider = "VNF_List")
- public Object[] OnbordingDataProviders(String filepath, String vnfFile){
- return new Object[] { new ToscaValidationTest(filepath, vnfFile)};
- }
+// @Factory(dataProvider = "VNF_List")
+// public Object[] OnbordingDataProviders(String filepath, String vnfFile){
+// return new Object[] { new ToscaValidationTest(filepath, vnfFile)};
+// }
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasElement.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasElement.java
index 818b488d64..e217847815 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasElement.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasElement.java
@@ -43,6 +43,12 @@ public final class CanvasElement {
elementType = canvasItem;
}
+ public CanvasElement(String name, ImmutablePair<Integer, Integer> location) {
+ super();
+ this.uniqueId = name;
+ this.location = location;
+ }
+
public String getUniqueId() {
return uniqueId;
}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasManager.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasManager.java
index b4f50020df..910cc54dad 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasManager.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasManager.java
@@ -20,14 +20,8 @@
package org.openecomp.sdc.ci.tests.datatypes;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.UUID;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-
+import com.aventstack.extentreports.Status;
+import com.clearspring.analytics.util.Pair;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.LeftPanelCanvasItems;
import org.openecomp.sdc.ci.tests.datatypes.enums.CircleSize;
@@ -40,9 +34,11 @@ import org.openqa.selenium.StaleElementReferenceException;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.testng.Assert;
+import org.testng.SkipException;
-import com.aventstack.extentreports.Status;
-import com.clearspring.analytics.util.Pair;
+import java.util.*;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
public final class CanvasManager {
private Map<String, CanvasElement> canvasElements;
@@ -110,7 +106,7 @@ public final class CanvasManager {
actions.clickAndHold();
actions.release();
actions.perform();
- isKeepWaiting = GeneralUIUtils.getWebElementByTestID("selectedCompTitle").getText()
+ isKeepWaiting = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionRightPanel.COMPONENT_TITLE.getValue()).getText()
.equals(containerName);
sumOfWaiting += napPeriod;
if (sumOfWaiting > maxWait) {
@@ -131,6 +127,56 @@ public final class CanvasManager {
ExtentTestActions.log(Status.INFO, String.format("Canvas element %s selected", canvasElement.getElementType()));
}
+ public void openLinkPopupReqsCapsConnection(CanvasElement canvasElement)
+ {
+ ExtentTestActions.log(Status.INFO, "Open Link popup");
+ clickOnCanvasLink(canvasElement);
+ int x = canvasElement.getLocation().getLeft() + 30; // view button x delta
+ int y = canvasElement.getLocation().getRight() + 11; // view button y delta
+ clickOnCanvasPosition(x,y);
+ GeneralUIUtils.ultimateWait();
+ }
+ public void closeLinkPopupReqsCapsConnection()
+ {
+ GeneralUIUtils.clickOnElementByTestId("Cancel");
+ GeneralUIUtils.ultimateWait();
+ }
+
+ public void clickSaveOnLinkPopup()
+ {
+ ExtentTestActions.log(Status.INFO, "Click save on link popup");
+ GeneralUIUtils.clickOnElementByTestId("Save");
+ GeneralUIUtils.ultimateWait();
+ }
+
+ public void deleteLinkPopupReqsCapsConnection(CanvasElement canvasElement)
+ {
+ clickOnCanvasLink(canvasElement);
+ int x = canvasElement.getLocation().getLeft() + 30; // delete button x delta
+ int y = canvasElement.getLocation().getRight() + 30; // delete button x delta
+ clickOnCanvasPosition(x,y);
+ }
+
+ public void clickOnCanvasLink(CanvasElement canvasElement) {
+ actions.moveToElement(canvas, canvasElement.getLocation().left, canvasElement.getLocation().right);
+ actions.click().perform();
+ GeneralUIUtils.ultimateWait();
+ }
+
+ public void clickOnCanvasPosition(int x, int y) {
+
+ try {
+ actions.moveToElement(canvas, x, y);
+ actions.click();
+ actions.perform();
+ GeneralUIUtils.ultimateWait();
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+ }
+
public void moveElementOnCanvas(CanvasElement canvasElement) throws Exception {
moveElementOnCanvas(canvasElement, getFreePosition());
}
@@ -182,6 +228,7 @@ public final class CanvasManager {
private CanvasElement createElementOnCanvasWithoutDuration(String elementDataTestId) throws Exception {
try {
+ CompositionPage.searchForElement(elementDataTestId);
WebElement element = findClickElement(elementDataTestId);
ImmutablePair<Integer, Integer> freePosition = getFreePosition();
actions.moveToElement(element, 20, 20);
@@ -245,12 +292,12 @@ public final class CanvasManager {
}
private void selectReqAndCapAndConnect() throws Exception {
- addFitstReqOrCapAndPressNext();
- addFitstReqOrCapAndPressNext();
+ addFirstReqOrCapAndPressNext();
+ addFirstReqOrCapAndPressNext();
linkMenuClickOnFinishButton();
}
- private void addFitstReqOrCapAndPressNext() throws Exception {
+ private void addFirstReqOrCapAndPressNext() throws Exception {
addFirstReqOrCap();
linkMenuClickOnNextButton();
}
@@ -344,12 +391,35 @@ public final class CanvasManager {
* Validate that instance was selected on right sidebar
*/
public void validateInstanceSelected(CanvasElement canvasElement) {
- long maxWait = 3000;
+ long maxWait = 5000;
+ long sumOfWaiting = 0;
+ long napPeriod = 200;
+ boolean isInstanceSelected;
+ do {
+ isInstanceSelected = CompositionPage.getSelectedInstanceName().toLowerCase().contains(canvasElement.getElementType().toLowerCase());
+
+ if (!isInstanceSelected) {
+ try {
+ TimeUnit.MILLISECONDS.sleep(napPeriod);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ sumOfWaiting += napPeriod;
+ if (sumOfWaiting > maxWait) {
+ throw new SkipException(String.format("Open bug 342260, can't select instance properly, waited for %s seconds", (int) (maxWait/1000)));
+ }
+ } while (!isInstanceSelected);
+ }
+
+ public void validateLinkIsSelected() {
+ long maxWait = 5000;
long sumOfWaiting = 0;
long napPeriod = 200;
boolean isInstanceSelected;
do {
- isInstanceSelected = CompositionPage.getSelectedInstanceName().contains(canvasElement.getElementType());
+ isInstanceSelected = GeneralUIUtils.isWebElementExistByClass("w-sdc-menu-item w-sdc-canvas-menu-item-view");
if (!isInstanceSelected) {
try {
@@ -361,7 +431,7 @@ public final class CanvasManager {
sumOfWaiting += napPeriod;
if (sumOfWaiting > maxWait) {
- Assert.fail(String.format("Can't select instance properly, waited for %s seconds", (int) (maxWait/1000)));
+ Assert.fail(String.format("Can't select link properly, waited for %s seconds", (int) (maxWait/1000)));
}
} while (!isInstanceSelected);
}
@@ -372,18 +442,27 @@ public final class CanvasManager {
GeneralUIUtils.ultimateWait();
}
- private void selectTypeOfReqCap(String reqCapType)
+ private void selectTypeOfReqCap(String dataTestId, String reqCapType)
{
- GeneralUIUtils.getSelectList(reqCapType,DataTestIdEnum.LinkMenuItems.REQ_CAP_SELECT_DATA_TESTS_ID.getValue());
- GeneralUIUtils.ultimateWait();
+ GeneralUIUtils.selectByValueTextContained(dataTestId, reqCapType);
}
public void linkElementsAndSelectCapReqTypeAndCapReqName(CanvasElement firstElement, CircleSize firstElementSize, CanvasElement secondElement, CircleSize secondElementSize, ConnectionWizardPopUpObject connectionWizardPopUpObject) throws Exception {
- drawSimpleLink(firstElement, firstElementSize, secondElement, secondElementSize);
- selectTypeOfReqCap(connectionWizardPopUpObject.getCapabilityTypeSecondItem());
- addFitstReqOrCapAndPressNext();
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating link between %s and %s", firstElement.getElementType(), secondElement.getElementType()));
+ drawSimpleLink(firstElement, firstElementSize, secondElement, secondElementSize);
+ selectTypeOfReqCap(DataTestIdEnum.LinkMenuItems.REQ_CAP_SELECT_DATA_TESTS_ID.getValue(),connectionWizardPopUpObject.getCapabilityTypeSecondItem());
+ addFirstReqOrCapAndPressNext();
selectReqCapByName(connectionWizardPopUpObject.getCapabilityNameSecondItem());
linkMenuClickOnNextButton();
linkMenuClickOnFinishButton();
}
+
+ public ImmutablePair<Integer, Integer> calcMidOfLink(ImmutablePair<Integer, Integer> location1, ImmutablePair<Integer, Integer> location2)
+ {
+ int x = (location1.getLeft()+location2.getLeft())/2;
+ int y = (location1.getRight()+location2.getRight())/2;
+
+ ImmutablePair<Integer, Integer> location = new ImmutablePair<>(x,y);
+ return location;
+ }
}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java
index fdd6a572a4..65fdb9dc47 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java
@@ -525,9 +525,10 @@ public final class DataTestIdEnum {
public enum DashboardCardEnum {
ASSET_TYPE("asset-type"), LIFECYCLE_STATE("span[class^='w-sdc-dashboard-card-info-lifecycleState']"),
- INFO_NAME("div.sdc-tile-content-info-item-name"),
+ INFO_NAME("div.sdc-tile-info-line"),
VERSION("div[class^='w-sdc-dashboard-card-info-user']"),
DASHBOARD_CARD("div[class^='w-sdc-dashboard-card ']"),
+ INFO_TITLE_XPATH("//div[contains(@class,'sdc-tile-info-line title')]"),
ASSET_TYPE_CSS("span[data-tests-id='asset-type']");
private String value;
@@ -820,7 +821,13 @@ public final class DataTestIdEnum {
INPUT_DELETE_BUTTON("delete-input-button"),
INPUT_DELETE_DIALOG_DELETE("Delete"),
INPUT_DELETE_DIALOG_CLOSE("Close"),
- FILTER_CHECKBOX_ALL("filter-checkbox-all");
+ FILTER_CHECKBOX_ALL("filter-checkbox-all"),
+ FILTER_CHECKBOX_CP("filter-checkbox-cp"),
+ FILTER_CHECKBOX_VFC("filter-checkbox-vfc"),
+ FILTER_CHECKBOX_VL("filter-checkbox-vl"),
+ FILTER_APPLY_BUTTON("filter-apply-button"),
+ FILTER_CLOSE_BUTTON("filter-close-button"),
+ PROPERTY_NAME_COLUMN("property-name");
private String value;
@@ -867,6 +874,82 @@ public final class DataTestIdEnum {
this.value = value;
}
}
-
-
+
+ public enum ComplexServiceAmdocs {
+ CREATE_BUTTON("Create"),
+ PATH_LIST_BUTTON("pathsListMenuItem"),
+ CREATE_PATH_MENU_BUTTON("createPathMenuItem"),
+ PATH_NAME("pathName"),
+ PATH_PROTOCOL("pathProtocol"),
+ PATH_PORT_NUMBER("pathPortNumbers"),
+ SAVE("Save"),
+ EXTEND_BUTTON("extendPathlnk");
+
+ private String value;
+
+ public String getValue() {
+ return value;
+ }
+
+ private ComplexServiceAmdocs(String value) {
+ this.value = value;
+ }
+ }
+
+ public enum PortMirroring {
+ COLLECTOR_NODE("collector_node"),
+ EQUIP_MODEL("equip_model"),
+ EQUIP_VENDOR("equip_vendor"),
+ PMC_NAME_IN_PALLETE("Port Mirroring Configuration"),
+ PMCP_NAME_IN_PALLETE("Port Mirroring Configuration By Policy");
+
+ private String value;
+
+ public String getValue() {
+ return value;
+ }
+
+ private PortMirroring(String value) {
+ this.value = value;
+ }
+ }
+
+ public enum CompositionRightPanel_GenerInfo {
+ TYPE("rightTab_componentType"),
+ RESOURCE_TYPE("rightTab_resourceType"),
+ SELECT_VERSION("changeVersion"),
+ CATEGORY("rightTab_category"),
+ SUB_CATEGORY("rightTab_subCategory");
+
+ private String value;
+
+ public String getValue() {
+ return value;
+ }
+
+ private CompositionRightPanel_GenerInfo(String value) {
+ this.value = value;
+ }
+ }
+
+ public enum CompositionRightPanel {
+
+ COMPONENT_TITLE("selectedCompTitle"),
+ REQS_AND_CAPS_TAB("requirements-and-capabilities"),
+ EDIT_PENCIL("editPencil"),
+ INSTANCE_NAME_TEXTBOX("instanceName"),
+ DELETE_ITEM("e-sdc-small-icon-delete"),
+ REQS_AND_CAPS_TAB_XPATH("//button[@tooltip-content='Requirements and Capabilities']");
+
+ private String value;
+
+ public String getValue() {
+ return value;
+ }
+
+ private CompositionRightPanel(String value) {
+ this.value = value;
+ }
+ }
+
}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PortMirrioringConfigurationObject.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PortMirrioringConfigurationObject.java
new file mode 100644
index 0000000000..60804cb278
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PortMirrioringConfigurationObject.java
@@ -0,0 +1,74 @@
+package org.openecomp.sdc.ci.tests.datatypes;
+
+import org.openecomp.sdc.be.model.Service;
+
+public class PortMirrioringConfigurationObject {
+
+ private ServiceReqDetails serviceReqDetails;
+ private String vmmeSourceName;
+ private String vprobeSourceName;
+ private CanvasManager canvasManager;
+ private CanvasElement serviceElementVmmeSourceName;
+ private CanvasElement serviceElementVprobeCollector;
+ private CanvasElement portMirroringConfigurationElement;
+ private Service service;
+ private Service serviceContainerVmme_Source;
+ private Service serviceContainerVprobe_Collector;
+
+ public PortMirrioringConfigurationObject(ServiceReqDetails serviceReqDetails, String vmmeSourceName, String vprobeSourceName,
+ CanvasManager canvasManager, CanvasElement serviceElementVmmeSourceName,
+ CanvasElement serviceElementVprobeCollector, Service service, CanvasElement portMirroringConfigurationElement,
+ Service serviceContainerVmme_Source, Service serviceContainerVprobe_Collector )
+ {
+ this.serviceReqDetails = serviceReqDetails;
+ this.vmmeSourceName = vmmeSourceName;
+ this.vprobeSourceName = vprobeSourceName;
+ this.canvasManager = canvasManager;
+ this.serviceElementVmmeSourceName = serviceElementVmmeSourceName;
+ this.serviceElementVprobeCollector = serviceElementVprobeCollector;
+ this.service = service;
+ this.portMirroringConfigurationElement = portMirroringConfigurationElement;
+ this.serviceContainerVmme_Source = serviceContainerVmme_Source;
+ this.serviceContainerVprobe_Collector = serviceContainerVprobe_Collector;
+ }
+
+ public Service getServiceContainerVmme_Source() {
+ return serviceContainerVmme_Source;
+ }
+
+ public Service getServiceContainerVprobe_Collector() {
+ return serviceContainerVprobe_Collector;
+ }
+
+ public CanvasElement getPortMirroringConfigurationElement() {
+ return portMirroringConfigurationElement;
+ }
+
+ public ServiceReqDetails getServiceReqDetails() {
+ return serviceReqDetails;
+ }
+
+ public String getVmmeSourceName() {
+ return vmmeSourceName;
+ }
+
+ public String getVprobeSourceName() {
+ return vprobeSourceName;
+ }
+
+ public CanvasManager getCanvasManager() {
+ return canvasManager;
+ }
+
+ public CanvasElement getServiceElementVmmeSourceName() {
+ return serviceElementVmmeSourceName;
+ }
+
+ public CanvasElement getServiceElementVprobeCollector() {
+ return serviceElementVprobeCollector;
+ }
+
+ public Service getService() {
+ return service;
+ }
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PortMirroringEnum.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PortMirroringEnum.java
new file mode 100644
index 0000000000..7cbdf6fc9c
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PortMirroringEnum.java
@@ -0,0 +1,48 @@
+package org.openecomp.sdc.ci.tests.datatypes;
+
+public enum PortMirroringEnum {
+
+ PMC_ELEMENT_IN_PALLETE("Port Mirroring Configuration"),
+ PMCP_ELEMENT_IN_PALLETE("Port Mirroring Configuration By Policy"),
+ PM_REQ_TYPE("org.openecomp.capabilities.PortMirroring"),
+ PMC_SOURCE_CAP("Port Mirroring Configuration 0: source: [1, UNBOUNDED]"),
+ PMC1_SOURCE_CAP("Port Mirroring Configuration 1: source: [1, UNBOUNDED]"),
+ PMCP_SOURCE_CAP("Port Mirroring Configuration By Policy 0: source: [1, UNBOUNDED]"),
+ PMCP1_SOURCE_CAP("Port Mirroring Configuration By Policy 1: source: [1, UNBOUNDED]"),
+ PMC_COLLECTOR_CAP("Port Mirroring Configuration 0: collector: [1, 1]"),
+ CISCO_VENDOR_NAME("CISCO"),
+ CISCO_VENDOR_MODEL_NUMBER("4500x"),
+ APCON1_VENDOR_NAME("APCON1"),
+ APCON1_VENDOR_MODEL_NUMBER("Test_APCON1"),
+ APCON2_VENDOR_NAME("APCON2"),
+ APCON2_VENDOR_MODEL_NUMBER("Test_APCON2"),
+ VMME_ZIP("2016-227_vmme_vmme_30_1610_e2e.zip"),
+ VPROBE_ZIP("vProbe_2017-10-22_07-24.zip"),
+ SERVICE_PROXY_TYPE("Service Proxy"),
+ SERVICE_TYPE("transport"),
+ TYPE("Resource"),
+ RESOURCE_TYPE("Configuration"),
+ CATEGORY("Configuration"),
+ SUB_CATEGORY("Configuration"),
+ NETWORK_ROLE_XPATH("//input[@name='network_role']"),
+ NFC_TYPE_XPATH("//input[@name='nfc_type']"),
+ PPS_CAPACITY_XPATH("//input[@name='pps_capacity']"),
+ NF_TYPE_XPATH("//input[@name='nf_type']"),
+ NETWORK_ROLE_VALUE("NETWORK ROLE TEXT"),
+ NFC_TYPE_VALUE("NFC TYPE TEXT"),
+ PPS_CAPACITY_VALUE("PPS CAPACITY TEXT"),
+ NF_TYPE_VALUE("NF TYPE TEXT"),
+ PMCP_NEWNAME("NewPMCP_Name");
+
+
+ private String value;
+
+ public String getValue() {
+ return value;
+ }
+
+ private PortMirroringEnum(String value) {
+ this.value = value;
+ }
+
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/UserManagementTab.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/UserManagementTab.java
index 799649b1b6..f51e69af01 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/UserManagementTab.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/UserManagementTab.java
@@ -61,6 +61,7 @@ public class UserManagementTab {
public void clickCreateButton(){
ExtentTestActions.log(Status.INFO, "Clicking on 'Create' button.");
+ GeneralUIUtils.ultimateWait();
GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.UserManagementEnum.CREATE_BUTTON.getValue());
}
@@ -99,7 +100,9 @@ public class UserManagementTab {
public void deleteUser(int index){
ExtentTestActions.log(Status.INFO, "Deleting the user in row " + (index + 1));
+ GeneralUIUtils.ultimateWait();
GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.UserManagementEnum.DELETE_USER.getValue() + index);
+ GeneralUIUtils.ultimateWait();
GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.OK.getValue());
}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java
index 8b40210c0d..a6aba7f13c 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java
@@ -16,8 +16,8 @@ public class VendorSoftwareProductObject extends VendorSoftwareProductObjectReqD
this.version = version;
}
- public VendorSoftwareProductObject(String name, String description, String category, String subCategory, String vendorId, String vendorName, LicensingVersion licensingVersion, LicensingData licensingData, String onboardingMethod, String networkPackageName, String onboardingOrigin, String vspId, String componentId, String attContact, String version) {
- super(name, description, category, subCategory, vendorId, vendorName, licensingVersion, licensingData, onboardingMethod, networkPackageName, onboardingOrigin);
+ public VendorSoftwareProductObject(String name, String description, String category, String subCategory, String vendorId, String vendorName, String licensingVersion, LicensingData licensingData, String onboardingMethod, String networkPackageName, String onboardingOrigin, String icon, String vspId, String componentId, String attContact, String version) {
+ super(name, description, category, subCategory, vendorId, vendorName, licensingVersion, licensingData, onboardingMethod, networkPackageName, onboardingOrigin, icon);
this.vspId = vspId;
this.componentId = componentId;
this.attContact = attContact;
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/CreatePath.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/CreatePath.java
new file mode 100644
index 0000000000..66bb693778
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/CreatePath.java
@@ -0,0 +1,997 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.AmdocsComplexService;
+
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.awt.AWTException;
+import java.io.Console;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.Random;
+import com.mongodb.util.JSON;
+import org.apache.commons.lang.RandomStringUtils;
+import org.json.JSONObject;
+import org.openecomp.sdc.ci.tests.dataProvider.OnbordingDataProviders;
+import org.openecomp.sdc.ci.tests.datatypes.*;
+import org.openecomp.sdc.ci.tests.datatypes.enums.CircleSize;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.execute.sanity.Service;
+import org.openecomp.sdc.ci.tests.execute.setup.ArtifactsCorrelationManager;
+import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
+import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
+import org.openecomp.sdc.ci.tests.pages.CompositionPage;
+import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
+import org.openecomp.sdc.ci.tests.pages.GovernorOperationPage;
+import org.openecomp.sdc.ci.tests.pages.HomePage;
+import org.openecomp.sdc.ci.tests.pages.OpsOperationPage;
+import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
+import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
+import org.openecomp.sdc.ci.tests.pages.TesterOperationPage;
+import org.openecomp.sdc.ci.tests.utilities.FileHandling;
+import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
+import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
+import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.verificator.ServiceVerificator;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+import org.stringtemplate.v4.ST;
+import org.testng.Assert;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Optional;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+import com.aventstack.extentreports.Status;
+import com.clearspring.analytics.util.Pair;
+
+public class CreatePath extends SetupCDTest {
+
+ protected static String filepath = FileHandling.getVnfRepositoryPath();
+ protected String makeDistributionValue;
+
+ @Parameters({"makeDistribution"})
+ @BeforeMethod
+ public void beforeTestReadParams(@Optional("true") String makeDistributionReadValue) {
+ makeDistributionValue = makeDistributionReadValue;
+ }
+
+ //------------------------------------------Tests-----------------------------------------------------
+
+
+ // Jira issue 5610
+ @Test
+ public void AssertPathButtons() throws Exception, Throwable {
+ filepath = "C:\\Users\\ShiraShe\\Desktop";
+ String vnfFile = "fullComposition.zip";
+ String vspName = getToPathFlow(filepath, vnfFile);
+ reloginWithNewRole(UserRoleEnum.DESIGNER);
+ ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
+ ServiceUIUtils.createService(serviceMetadata, getUser());
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ openCreatePath();
+ AssertCreatePath();
+ AssertExtendPath();
+ //SetupCDTest.getExtendTest().log(Status.INFO, String.format("disables buttons are OK"));
+ }
+
+ // Jira issue 5441
+ @Test
+ public void CreatePathTestSanity() throws Exception, Throwable {
+ filepath = "C:\\Users\\ShiraShe\\Desktop";
+ // List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList();
+ //String vnfFile = fileNamesFromFolder.get(0).toString();
+ String vnfFile = "fullComposition.zip";
+ String vspName = getToPathFlow(filepath, vnfFile);
+ createPath(vspName);
+ }
+
+ // Jira issue 5611
+ @Test
+ public void CreatePathCheckIO() throws Exception, Throwable {
+ filepath = "C:\\Users\\ShiraShe\\Desktop";
+ // List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList();
+ //String vnfFile = fileNamesFromFolder.get(0).toString();
+ String vnfFile = "fullComposition.zip";
+
+ // getToPathFlow
+ String vspName = onboardAndCertify(filepath, vnfFile);
+ reloginWithNewRole(UserRoleEnum.DESIGNER);
+
+ // create service
+ ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
+ ServiceUIUtils.createService(serviceMetadata, getUser());
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+
+ // create path
+ String pathName = createPath(vspName);
+
+ // @@ check in @@
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.LifeCyleChangeButtons.CHECK_IN.getValue());
+ GeneralUIUtils.getWebElementByTestID("checkindialog").sendKeys("check in automated confirmation message");
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.OK.getValue());
+ GeneralUIUtils.ultimateWait();
+
+ // go to service composition
+ GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtons.SEARCH_BOX.getValue()).sendKeys(serviceMetadata.getName());
+ getDriver().findElements(By.xpath("//*[@data-tests-id='dashboard-Elements']//*[@data-tests-id='" + serviceMetadata.getName() + "']")).get(0).click();
+ GeneralUIUtils.ultimateWait();
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+
+ AssertCreatedPathExistInCompositionPage(pathName);
+
+ // @@ check out @@
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.LifeCyleChangeButtons.CHECKOUT.getValue());
+ GeneralUIUtils.ultimateWait();
+
+ AssertCreatedPathExistInCompositionPage(pathName);
+
+ }
+
+ // Jira issue 5441
+ @Test
+ public void CreateMultiplePaths() throws Exception, Throwable {
+ filepath = "C:\\Users\\ShiraShe\\Desktop";
+ // List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList();
+ //String vnfFile = fileNamesFromFolder.get(0).toString();
+ String vnfFile = "fullComposition.zip";
+ String vspName = getToPathFlow(filepath, vnfFile);
+ createPath(vspName);
+ createPath(vspName);
+ createPathNumOfRows(7);
+ createPathNumOfRows(6);
+ createPathNumOfRows(4);
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("multiple paths have been created"));
+ }
+
+ // Jira issue 5506
+ @Test
+ public void CreatePathWithComplex() throws Exception, Throwable {
+ List<String> vnfFiles = new ArrayList<>();
+ vnfFiles.add("fullComposition.zip");
+ vnfFiles.add("fullCompositionNew.zip");
+ filepath = "C:\\Users\\ShiraShe\\Desktop";
+ CreatePathComplexServiceFlow(filepath, vnfFiles);
+ //String vnfFile = "fullComposition.zip";
+ // String vnfFile2 = "fullCompositionNew.zip";
+ // runCreatePathComplexServiceFlow(filepath, vnfFile, vnfFile2);
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("path with complex service has been created"));
+ }
+
+ // Jira issue 5506
+ @Test
+ public void RealScenarioComplex() throws Exception, Throwable {
+ filepath = "C:\\Users\\ShiraShe\\Desktop\\Srini";
+ List<String> vnfFiles = new ArrayList<>();
+ vnfFiles.add("HSS.zip");
+ vnfFiles.add("VMME.zip");
+ CreatePathComplexServiceFlow(filepath, vnfFiles);
+ ExtentTestActions.addScreenshot(Status.INFO, "Complex service_" + vnfFiles.get(0) ,"Complex service created " + vnfFiles.get(1) + " is as follows : ");
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("path with complex service has been created"));
+ }
+
+ // Jira issue 5506
+ @Test
+ public void CreateExtendedPathWithComplex() throws Exception, Throwable {
+ filepath = "C:\\Users\\ShiraShe\\Desktop";
+ List<String> vnfFiles = new ArrayList<>();
+ vnfFiles.add("fullComposition.zip");
+ vnfFiles.add("fullCompositionNew.zip");
+ //String vnfFile = "fullComposition.zip";
+ //String vnfFile2 = "fullCompositionNew.zip";
+ String[] services = ToComplexService(filepath, vnfFiles);
+ createComplexExtendedPath(services[0], services[1]);
+ ExtentTestActions.addScreenshot(Status.INFO, "Complex service_" + services[0] ,"Complex service created " + services[1] + " is as follows : ");
+
+ }
+
+ // Jira issue 5441
+ @Test
+ public void CreatePathExtendedTest() throws Exception, Throwable {
+ filepath = "C:\\Users\\ShiraShe\\Desktop";
+ // List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList();
+ //String vnfFile = fileNamesFromFolder.get(0).toString();
+ String vnfFile = "fullComposition.zip";
+ runCreateExtendedPathFlow(filepath, vnfFile);
+ }
+
+ //create service
+ public ServiceReqDetails createService() throws Exception, AWTException {
+ ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
+ ServiceUIUtils.createService(serviceMetadata, getUser());
+ return serviceMetadata;
+ }
+
+ // workflow leading to path
+ public String onboardAndCertify(String filepath, String vnfFile) throws Exception, IOException {
+
+ ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
+ Pair<String, VendorSoftwareProductObject> onboardAndValidate = OnboardingUiUtils.onboardAndValidate(resourceReqDetails,filepath, vnfFile, getUser());
+ String vspName = onboardAndValidate.left;
+
+ DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
+ ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFile ,"The topology template for " + vnfFile + " is as follows : ");
+
+ DeploymentArtifactPage.clickSubmitForTestingButton(vspName);
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("relogin as TESTER"));
+ reloginWithNewRole(UserRoleEnum.TESTER);
+ GeneralUIUtils.findComponentAndClick(vspName);
+ TesterOperationPage.certifyComponent(vspName);
+ return vspName;
+ }
+
+ public List<String> onboardAndCertifyMultipleVFs(String filepath, List<String> vnfFiles) throws Exception, IOException {
+
+ List<String> VFNames = new ArrayList<>();
+ for(int i = 0; i<vnfFiles.size(); i++)
+ {
+ ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
+ Pair<String, VendorSoftwareProductObject> onboardAndValidate = OnboardingUiUtils.onboardAndValidate(resourceReqDetails,filepath, vnfFiles.get(i), getUser());
+ VFNames.add(i, onboardAndValidate.left);
+ DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
+ ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFiles.get(i) ,"The topology template for " + vnfFiles.get(i) + " is as follows : ");
+ DeploymentArtifactPage.clickSubmitForTestingButton(VFNames.get(i));
+ }
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("relogin as TESTER"));
+ reloginWithNewRole(UserRoleEnum.TESTER);
+ for (int j = 0; j< VFNames.size(); j++)
+ {
+ GeneralUIUtils.findComponentAndClick(VFNames.get(j));
+ TesterOperationPage.certifyComponent(VFNames.get(j));
+ }
+
+ return VFNames;
+ }
+
+ // path components
+
+ public void AssertCreatePath() throws Exception, IOException {
+ String check = getDriver().findElements(By.xpath("//*[@data-tests-id='Create']")).get(0).getAttribute("disabled");
+ if (check.intern() != "true")
+ {
+ throw new Exception("Button create path should be disabled. open bug to UI team");
+ }
+ }
+
+ public void AssertCreatedPathExistInCompositionPage(String pathName) throws Exception, IOException {
+ // check path in the list filter
+ checkPathFilter(pathName, true);
+
+ openPathList();
+
+ // assert path is in the list
+ String PathListName1 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_CLOSE.getValue());
+ }
+
+ public void AssertExtendPath() throws Exception, IOException {
+ String check = getDriver().findElements(By.xpath("//*[@data-tests-id='extendPathlnk']")).get(0).getAttribute("class");
+ if (check.intern() != "disabled")
+ {
+ throw new Exception("Button extend path should be disabled. open bug to UI team");
+ }
+ }
+
+ public void createPathNumOfRows(int numOfPathRows)throws Exception, AWTException{
+ openCreatePath();
+ insertValues("extended" + RandomStringUtils.randomAlphanumeric(8),"pathProtocol1", "pathPortNumbers1");
+ selectFirstLineParam();
+ extendPath(numOfPathRows);
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
+ }
+
+ public void linkVFs(String vspName, int linksNum)throws Exception, AWTException {
+
+ CompositionPage.searchForElement(vspName);
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+ List <CanvasElement> VFs = new ArrayList<CanvasElement>();
+
+ VFs.add(canvasManager.createElementOnCanvas(vspName));
+
+ for (int i = 1; i<linksNum; i++)
+ {
+ VFs.add(canvasManager.createElementOnCanvas(vspName));
+ GeneralUIUtils.ultimateWait();
+ canvasManager.linkElements(VFs.get(i), CircleSize.VF, VFs.get(i-1), CircleSize.VF);
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("link VFs"));
+ GeneralUIUtils.ultimateWait();
+ }
+ }
+
+ public void linkServices(String Service1, String Service2, int linksNum)throws Exception, AWTException {
+
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+ List <CanvasElement> VFs = new ArrayList<CanvasElement>();
+
+ // get first service
+ CompositionPage.searchForElement(Service1);
+ VFs.add(canvasManager.createElementOnCanvas(Service1));
+
+ String service = Service2;
+ for (int i = 1; i<linksNum; i++)
+ {
+ CompositionPage.searchForElement(service);
+ VFs.add(canvasManager.createElementOnCanvas(service));
+ GeneralUIUtils.ultimateWait();
+ canvasManager.linkElements(VFs.get(i), CircleSize.SERVICE, VFs.get(i-1), CircleSize.SERVICE);
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("link services"));
+ GeneralUIUtils.ultimateWait();
+
+ // change service to link
+ if (service.equals(Service2)) {
+ service = Service1;
+ }
+ else {
+ service = Service2;
+ }
+ }
+ }
+
+ public void openCreatePath() throws Exception, AWTException{
+
+ getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
+ GeneralUIUtils.ultimateWait();
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_PATH_MENU_BUTTON.getValue());
+ }
+
+ public void openPathList() throws Exception, AWTException {
+ getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
+ GeneralUIUtils.ultimateWait();
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
+ }
+
+ public void sendValue(String DataTestId, String value) throws Exception, AWTException {
+
+ GeneralUIUtils.getWebElementByTestID(DataTestId).sendKeys(value);
+ GeneralUIUtils.ultimateWait();
+ }
+
+ public void insertValues(String pathName, String pathProtocol, String pathPortNumbers) throws Exception, AWTException {
+
+ sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_NAME.getValue(),pathName);
+ sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_PROTOCOL.getValue(),pathProtocol);
+ sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_PORT_NUMBER.getValue(),pathPortNumbers);
+ }
+
+ public void selectFirstLineParam() throws Exception, AWTException{
+ getDriver().findElements(By.xpath("//*[@data-tests-id='linkSrc']//option")).get(0).click();
+ GeneralUIUtils.ultimateWait();
+ getDriver().findElements(By.xpath("//*[@data-tests-id='linkSrcCP']//option")).get(0).click();
+ GeneralUIUtils.ultimateWait();
+ getDriver().findElements(By.xpath("//*[@data-tests-id='linkTarget']//option")).get(0).click();
+ GeneralUIUtils.ultimateWait();
+ getDriver().findElements(By.xpath("//*[@data-tests-id='linkTargetCP']//option")).get(0).click();
+ GeneralUIUtils.ultimateWait();
+ }
+
+ public void checkPathFilter(String pathName, boolean isFound) throws Exception, AWTException{
+ GeneralUIUtils.ultimateWait();
+ List<WebElement> pathFilterList = getDriver().findElements(By.xpath("//*[@data-tests-id='service-path-selector']//option"));
+ if (isFound) {
+ for (int i = 0; i < pathFilterList.size(); i++) {
+ String element_text = pathFilterList.get(i).getText();
+ if (element_text.equals(pathName))
+ {
+ break;
+ }
+ if (i == pathFilterList.size() -1 )
+ {
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("path list filter check failed"));
+ throw new Exception("path filter list is missing a path");
+ }
+ }
+ }
+ else {
+ for (int i = 0; i < pathFilterList.size(); i++) {
+ String element_text = pathFilterList.get(i).getText();
+ if (element_text.equals(pathName))
+ {
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("path list filter check failed"));
+ throw new Exception("path filter list is has a path that should be deleted");
+ }
+ }
+ }
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("path list filter check passed"));
+ }
+
+ public void extendPath(int numOfLines) throws Exception, AWTException {
+
+ int i;
+ for (i = 0; i < numOfLines; i++) {
+ String check;
+ String index = Integer.toString(i + 2);
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.EXTEND_BUTTON.getValue());
+ List<WebElement> linkSrcs = getDriver().findElements(By.xpath("//*[@data-tests-id='linkSrc']//select"));
+ List<WebElement> linkSrcCPs = getDriver().findElements(By.xpath("//*[@data-tests-id='linkSrcCP']//select"));
+ List<WebElement> linkTargets = getDriver().findElements(By.xpath("//*[@data-tests-id='linkTarget']//select"));
+ List<WebElement> linkTargetCPs = getDriver().findElements(By.xpath("//*[@data-tests-id='linkTargetCP']//select"));
+
+ for (int j = 0; j < i + 2; j++) {
+ check = linkSrcs.get(j).getAttribute("class");
+ if (!check.intern().contains("disabled")) {
+ throw new Exception("Source should be disabled. open bug to UI team");
+ }
+ check = linkSrcCPs.get(j).getAttribute("class");
+ if (!check.intern().contains("disabled")) {
+ throw new Exception("Source connection point of last lines should be disabled. open bug to UI team");
+ }
+ }
+ for (int j = 0; j < i + 1; j++) {
+
+ check = linkTargets.get(j).getAttribute("class");
+ if (!check.intern().contains("disabled")) {
+ throw new Exception("Target of last lines should be disabled. open bug to UI team");
+ }
+ check = linkTargetCPs.get(j).getAttribute("class");
+ if (!check.intern().contains("disabled")) {
+ throw new Exception("Target connection point of last lines should be disabled. open bug to UI team");
+ }
+ }
+
+ List <WebElement> choices = getDriver().findElements(By.xpath("//*[" + index + "]/*[@data-tests-id='linkTarget']//option"));
+ choices.get((new Random()).nextInt(choices.size())).click();
+ choices = getDriver().findElements(By.xpath("//*[" + index + "]/*[@data-tests-id='linkTargetCP']//option"));
+ choices.get((new Random()).nextInt(choices.size())).click();
+ }
+ }
+
+ public String editPath(String pathName) throws Exception, AWTException{
+ getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).get(0).click();
+ pathName = "name2";
+ GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ComplexServiceAmdocs.PATH_NAME.getValue()).clear();
+ sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_NAME.getValue(), pathName);
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.SAVE.getValue());
+ return pathName;
+ }
+
+ public int deleteLines(int numOfLinesToDelete,int numOfLines)throws Exception, AWTException{
+
+ for (int i=0; i<numOfLinesToDelete; i++){
+ getDriver().findElements(By.xpath("//*[@data-tests-id='removeLnk']//span")).get(0).click();
+ numOfLines--;
+ }
+ if (getDriver().findElements(By.xpath("//*[@data-tests-id='linkTargetCP']//option")).size()>(numOfLines+1))
+ {
+ throw new Exception("Path element was not deleted");
+ }
+ GeneralUIUtils.ultimateWait();
+ return numOfLines;
+ }
+
+ public String getToPathFlow(String filepath, String vnfFile) throws Exception, AWTException {
+
+ String vspName = onboardAndCertify(filepath, vnfFile);
+ reloginWithNewRole(UserRoleEnum.DESIGNER);
+ // create service
+ ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
+ ServiceUIUtils.createService(serviceMetadata, getUser());
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ return vspName;
+ }
+
+ // path scenarios
+
+ public String createPath(String vspName) throws Exception, AWTException {
+
+ linkVFs(vspName, 3);
+ openCreatePath();
+ String pathName = "name1";
+ insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
+ //select path elements
+ selectFirstLineParam();
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("path has been created"));
+ return pathName;
+ }
+
+ // flows
+
+ public void createExtendedPath(String vspName) throws Exception, AWTException {
+ //drag and drop VFs and link them
+ linkVFs(vspName, 5);
+
+ //open create path box
+ openCreatePath();
+ String pathName = "name1";
+ insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
+ selectFirstLineParam();
+ //extend path
+ int numOfLines = 3;
+ extendPath(numOfLines);
+ //delete line
+ int numOfLinesToDelete = 1;
+ numOfLines = deleteLines(numOfLinesToDelete, numOfLines);
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
+ ExtentTestActions.log(Status.INFO, "path has been created");
+
+ // check that path exist in the path filter list
+ checkPathFilter(pathName, true);
+
+ // check that path exist in the path list
+ getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
+ String PathListName1 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();
+
+ // edit path
+ pathName = editPath(pathName);
+
+ // go back to path's list
+ getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
+
+ // get name
+ String PathListName2 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();
+
+ // assert names changed
+ if (PathListName1.equals(PathListName2))
+ {
+ throw new Exception("path name expected to change after edit but did not");
+ }
+
+ // delete path
+ int paths_before_deletion = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).size();
+ getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).get(1).click();
+ GeneralUIUtils.ultimateWait();
+ int paths_after_deletion = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).size();
+ if (paths_after_deletion == paths_before_deletion)
+ {
+ throw new Exception("path expected to be deleted but did not");
+ }
+
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_CLOSE.getValue());
+ //ArtifactsCorrelationManager.addVNFtoServiceArtifactCorrelation(serviceMetadata.getName(), vspName);
+ //ServiceVerificator.verifyNumOfComponentInstances(serviceMetadata, "0.1", 1, getUser());
+ //ExtentTestActions.addScreenshot(Status.INFO, "ServiceComposition_" + vnfFile, "The service topology is as follows: ");
+ //ServiceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Path has been created"));
+
+ // check that path got deleted in the path filter list
+ checkPathFilter(pathName, false);
+ }
+
+ public void createComplexExtendedPath(String Service1, String Service2) throws Exception, AWTException {
+ //drag and drop Services and link them
+ linkServices(Service1, Service2, 5);
+
+ //-----------------------------------------create path-------------------------------------------------
+
+ //open create path box
+ openCreatePath();
+
+ String pathName = "name1";
+ String pathProtocol = "pathProtocol1";
+ String pathPortNumbers = "pathPortNumbers1";
+
+ insertValues(pathName, pathProtocol, pathPortNumbers);
+
+ //select path parameters
+ selectFirstLineParam();
+ //extend path
+ int numOfLines = 3;
+ extendPath(numOfLines);
+
+ //delete line
+ int numOfLinesToDelete = 1;
+ numOfLines = deleteLines(numOfLinesToDelete, numOfLines);
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
+ ExtentTestActions.log(Status.INFO, "path has been created");
+
+ //---------------------------------------check path's list-----------------------------
+
+ // go to path's list
+ openPathList();
+
+ // get name
+ String PathListName1 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();
+
+ // edit path
+ pathName = editPath(pathName);
+
+ // go back to path's list
+ getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
+
+ // get name
+ String PathListName2 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();
+
+ // assert names changed
+ if (PathListName1.equals(PathListName2))
+ {
+ throw new Exception("path name expected to change after edit but did not");
+ }
+
+ // delete path
+ int paths_before_deletion = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).size();
+ getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).get(1).click();
+ Thread.sleep(1000);
+ int paths_after_deletion = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).size();
+ if (paths_after_deletion == paths_before_deletion)
+ {
+ throw new Exception("path expected to be deleted but did not");
+ }
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_CLOSE.getValue());
+ //ArtifactsCorrelationManager.addVNFtoServiceArtifactCorrelation(serviceMetadata.getName(), vspName);
+
+ //assertNotNull(vfElement);
+ //ServiceVerificator.verifyNumOfComponentInstances(serviceMetadata, "0.1", 1, getUser());
+ //ExtentTestActions.addScreenshot(Status.INFO, "ServiceComposition_" + vnfFile, "The service topology is as follows: ");
+
+ //ServiceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Path has been created"));
+ }
+
+ public String[] getToComplexService(String filepath, String vnfFile, String vnfFile2) throws Exception, AWTException{
+ // create & certify 2 VF
+ String vspName1 = onboardAndCertify(filepath, vnfFile);
+ reloginWithNewRole(UserRoleEnum.DESIGNER);
+ String vspName2 = onboardAndCertify(filepath, vnfFile2);
+
+ // create service 1
+ reloginWithNewRole(UserRoleEnum.DESIGNER);
+ ServiceReqDetails serviceMetadata1 = createService();
+ // go to composition
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ // create path
+ createPath(vspName1);
+ getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
+ getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
+ getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();
+
+ // create service 2
+ ServiceReqDetails serviceMetadata2 = createService();
+ // go to composition
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ // create path
+ createPath(vspName2);
+ getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
+ getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
+ getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();
+
+ //tester
+ reloginWithNewRole(UserRoleEnum.TESTER);
+ GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
+ TesterOperationPage.certifyComponent(serviceMetadata1.getName());
+ GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
+ TesterOperationPage.certifyComponent(serviceMetadata2.getName());
+
+ //governor
+ reloginWithNewRole(UserRoleEnum.GOVERNOR);
+ GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
+ GovernorOperationPage.approveSerivce(serviceMetadata1.getName());
+ GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
+ GovernorOperationPage.approveSerivce(serviceMetadata2.getName());
+
+ //create service for complex service
+ reloginWithNewRole(UserRoleEnum.DESIGNER);
+ // create service
+ ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
+ ServiceUIUtils.createService(serviceMetadata, getUser());
+ // go to composition
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+
+ return new String[]{serviceMetadata1.getName(), serviceMetadata2.getName()};
+ }
+
+ public String[] ToComplexService(String filepath, List<String> vnfFiles) throws Exception, AWTException{
+ // create & certify 2 VF
+ List<String> VFNames = onboardAndCertifyMultipleVFs(filepath, vnfFiles);
+
+ // create service 1
+ reloginWithNewRole(UserRoleEnum.DESIGNER);
+ ServiceReqDetails serviceMetadata1 = createService();
+ // go to composition
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ // create path
+ createPath(VFNames.get(0));
+ getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
+ getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
+ getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();
+ GeneralUIUtils.ultimateWait();;
+
+ // create service 2
+ ServiceReqDetails serviceMetadata2 = createService();
+ GeneralUIUtils.ultimateWait();;
+ // go to composition
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ // create path
+ createPath(VFNames.get(1));
+ getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
+ getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
+ getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();
+
+ //tester
+ reloginWithNewRole(UserRoleEnum.TESTER);
+ GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
+ TesterOperationPage.certifyComponent(serviceMetadata1.getName());
+ GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
+ TesterOperationPage.certifyComponent(serviceMetadata2.getName());
+
+ //governor
+ reloginWithNewRole(UserRoleEnum.GOVERNOR);
+ GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
+ GovernorOperationPage.approveSerivce(serviceMetadata1.getName());
+ GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
+ GovernorOperationPage.approveSerivce(serviceMetadata2.getName());
+
+ //create service for complex service
+ reloginWithNewRole(UserRoleEnum.DESIGNER);
+ // create service
+ ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
+ ServiceUIUtils.createService(serviceMetadata, getUser());
+ // go to composition
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+
+ return new String[]{serviceMetadata1.getName(), serviceMetadata2.getName()};
+ }
+
+ public void runCreatePathComplexServiceFlow(String filepath, String vnfFile, String vnfFile2) throws Exception, AWTException {
+ // create & certify 2 VF
+ String vspName1 = onboardAndCertify(filepath, vnfFile);
+ reloginWithNewRole(UserRoleEnum.DESIGNER);
+ String vspName2 = onboardAndCertify(filepath, vnfFile2);
+
+ // create service 1
+ reloginWithNewRole(UserRoleEnum.DESIGNER);
+ ServiceReqDetails serviceMetadata1 = createService();
+ // go to composition
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ // create path
+ createPath(vspName1);
+ getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
+ getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
+ getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();
+
+ // create service 2
+ ServiceReqDetails serviceMetadata2 = createService();
+ // go to composition
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ // create path
+ createPath(vspName2);
+ getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
+ getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
+ getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();
+
+ //tester
+ reloginWithNewRole(UserRoleEnum.TESTER);
+ GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
+ TesterOperationPage.certifyComponent(serviceMetadata1.getName());
+ GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
+ TesterOperationPage.certifyComponent(serviceMetadata2.getName());
+
+ //governor
+ reloginWithNewRole(UserRoleEnum.GOVERNOR);
+ GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
+ GovernorOperationPage.approveSerivce(serviceMetadata1.getName());
+ GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
+ GovernorOperationPage.approveSerivce(serviceMetadata2.getName());
+
+ //create service for complex service
+ reloginWithNewRole(UserRoleEnum.DESIGNER);
+ // create service
+ ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
+ ServiceUIUtils.createService(serviceMetadata, getUser());
+ // go to composition
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ // link services
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+ CompositionPage.searchForElement(serviceMetadata1.getName());
+ CanvasElement service1 = canvasManager.createElementOnCanvas(serviceMetadata1.getName());
+ CompositionPage.searchForElement(serviceMetadata2.getName());
+ CanvasElement service2 = canvasManager.createElementOnCanvas(serviceMetadata2.getName());
+ canvasManager.linkElements(service1,CircleSize.SERVICE, service2, CircleSize.SERVICE);
+
+ // create path
+ openCreatePath();
+ insertValues("name1", "pathProtocol1", "pathPortNumbers1");
+ selectFirstLineParam();
+ GeneralUIUtils.getWebElementByTestID("Create").click();
+ }
+
+ public void CreatePathComplexServiceFlow(String filepath, List<String> vnfFiles) throws Exception, AWTException {
+ // create & certify 2 VF
+ List<String> vfNames = onboardAndCertifyMultipleVFs(filepath, vnfFiles);
+
+ // create service 1
+ reloginWithNewRole(UserRoleEnum.DESIGNER);
+ ServiceReqDetails serviceMetadata1 = createService();
+ // go to composition
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ // create path
+ createPath(vfNames.get(0));
+ getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
+ getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
+ getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();
+
+ // create service 2
+ ServiceReqDetails serviceMetadata2 = createService();
+ // go to composition
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ // create path
+ createPath(vfNames.get(0));
+ getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
+ getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
+ getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();
+
+ //tester
+ reloginWithNewRole(UserRoleEnum.TESTER);
+ GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
+ TesterOperationPage.certifyComponent(serviceMetadata1.getName());
+ GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
+ TesterOperationPage.certifyComponent(serviceMetadata2.getName());
+
+ //governor
+ reloginWithNewRole(UserRoleEnum.GOVERNOR);
+ GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
+ GovernorOperationPage.approveSerivce(serviceMetadata1.getName());
+ GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
+ GovernorOperationPage.approveSerivce(serviceMetadata2.getName());
+
+ //create service for complex service
+ reloginWithNewRole(UserRoleEnum.DESIGNER);
+ // create service
+ ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
+ ServiceUIUtils.createService(serviceMetadata, getUser());
+ // go to composition
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ // link services
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+ CompositionPage.searchForElement(serviceMetadata1.getName());
+ CanvasElement service1 = canvasManager.createElementOnCanvas(serviceMetadata1.getName());
+ CompositionPage.searchForElement(serviceMetadata2.getName());
+ CanvasElement service2 = canvasManager.createElementOnCanvas(serviceMetadata2.getName());
+ canvasManager.linkElements(service1,CircleSize.SERVICE, service2, CircleSize.SERVICE);
+
+ // create path
+ openCreatePath();
+ insertValues("name1", "pathProtocol1", "pathPortNumbers1");
+ selectFirstLineParam();
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
+ }
+
+ public void runCreateExtendedPathFlow(String filepath, String vnfFile) throws Exception, AWTException {
+
+ String vspName = getToPathFlow(filepath, vnfFile);
+
+ //drag and drop VFs and link them
+ linkVFs(vspName, 5);
+
+ //-----------------------------------------create path-------------------------------------------------
+
+ //open create path box
+ openCreatePath();
+ String pathName = "name1";
+ insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
+
+ //select path parameters
+ selectFirstLineParam();
+ //extend path
+ int numOfLines = 3;
+ extendPath(numOfLines);
+
+ //delete line
+ int numOfLinesToDelete = 1;
+ numOfLines = deleteLines(numOfLinesToDelete, numOfLines);
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
+ ExtentTestActions.log(Status.INFO, "path has been created");
+
+ // check path is on the list
+ openPathList();
+ String PathListName1 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();
+
+ // edit path
+ pathName = editPath(pathName);
+
+ // go back to path's list
+ getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
+
+ // get name
+ String PathListName2 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();
+
+ // assert names changes
+ if (PathListName1.equals(PathListName2))
+ {
+ throw new Exception("path name expected to change after edit but did not");
+ }
+
+ // delete path
+ int paths_before_deletion = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).size();
+ getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).get(1).click();
+ GeneralUIUtils.ultimateWait();
+ int paths_after_deletion = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).size();
+ if (paths_after_deletion == paths_before_deletion)
+ {
+ throw new Exception("path expected to be deleted but did not");
+ }
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_CLOSE.getValue());
+ //ArtifactsCorrelationManager.addVNFtoServiceArtifactCorrelation(serviceMetadata.getName(), vspName);
+ //ServiceVerificator.verifyNumOfComponentInstances(serviceMetadata, "0.1", 1, getUser());
+ //ExtentTestActions.addScreenshot(Status.INFO, "ServiceComposition_" + vnfFile, "The service topology is as follows: ");
+ //ServiceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Path has been created"));
+ }
+
+ public void runCreatePathFlow(String filepath, String vnfFile) throws Exception, AWTException {
+ String vspName = onboardAndCertify(filepath, vnfFile);
+
+ reloginWithNewRole(UserRoleEnum.DESIGNER);
+ // create service
+ ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
+ ServiceUIUtils.createService(serviceMetadata, getUser());
+
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+
+ CompositionPage.searchForElement(vspName);
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+ CanvasElement vfElement1 = canvasManager.createElementOnCanvas(vspName);
+ CanvasElement vfElement2 = canvasManager.createElementOnCanvas(vspName);
+ CanvasElement vfElement3 = canvasManager.createElementOnCanvas(vspName);
+ CanvasElement vfElement4 = canvasManager.createElementOnCanvas(vspName);
+ CanvasElement vfElement5 = canvasManager.createElementOnCanvas(vspName);
+ canvasManager.linkElements(vfElement1, CircleSize.VF, vfElement2, CircleSize.VF);
+ canvasManager.linkElements(vfElement3,CircleSize.VF, vfElement2, CircleSize.VF);
+ canvasManager.linkElements(vfElement3, CircleSize.VF, vfElement4, CircleSize.VF);
+ canvasManager.linkElements(vfElement5, CircleSize.VF, vfElement4, CircleSize.VF);
+ canvasManager.linkElements(vfElement5, CircleSize.VF, vfElement1, CircleSize.VF);
+
+ //create path
+
+ getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
+// GeneralUIUtils.getWebElementByTestID("pathsMenuBtn").click();
+ GeneralUIUtils.getWebElementByTestID("createPathMenuItem").click();
+ //insert values
+ GeneralUIUtils.getWebElementByTestID("pathName").sendKeys("name");
+ GeneralUIUtils.getWebElementByTestID("pathProtocol").sendKeys("pathProtocol");
+ GeneralUIUtils.getWebElementByTestID("pathPortNumbers").sendKeys("pathPortNumbers");
+ //select path parameters
+
+ getDriver().findElements(By.xpath("//*[@data-tests-id='linkSrc']//option")).get(0).click();
+ getDriver().findElements(By.xpath("//*[@data-tests-id='linkSrcCP']//option")).get(0).click();
+ getDriver().findElements(By.xpath("//*[@data-tests-id='linkTarget']//option")).get(0).click();
+ getDriver().findElements(By.xpath("//*[@data-tests-id='linkTargetCP']//option")).get(0).click();
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
+
+ //ArtifactsCorrelationManager.addVNFtoServiceArtifactCorrelation(serviceMetadata.getName(), vspName);
+
+ //assertNotNull(vfElement);
+ //ServiceVerificator.verifyNumOfComponentInstances(serviceMetadata, "0.1", 1, getUser());
+ //ExtentTestActions.addScreenshot(Status.INFO, "ServiceComposition_" + vnfFile, "The service topology is as follows: ");
+
+ //ServiceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
+ }
+
+ @Override
+ protected UserRoleEnum getRole() {
+ return UserRoleEnum.DESIGNER;
+ }
+
+} \ No newline at end of file
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathValidations.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathValidations.java
new file mode 100644
index 0000000000..42c45699f3
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathValidations.java
@@ -0,0 +1,23 @@
+package org.openecomp.sdc.ci.tests.execute.AmdocsComplexService;
+
+/**
+ * validation tests for future validations
+ */
+
+import java.util.ArrayList;
+
+public class PathValidations {
+
+ String name;
+ String destinationPortNumber;
+ String protocol;
+
+ ArrayList<String> elements;
+
+ public void Ph(String parameter1 )
+ {
+ elements = new ArrayList<String>();
+ elements.add(parameter1);
+ elements.get(1);
+ }
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/AdminUserManagment.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/AdminUserManagment.java
index e4423dd7d0..4df09a660d 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/AdminUserManagment.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/AdminUserManagment.java
@@ -48,6 +48,7 @@ import org.openecomp.sdc.ci.tests.verificator.UserManagementVerificator;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
+import org.testng.SkipException;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
@@ -72,21 +73,23 @@ public class AdminUserManagment extends SetupCDTest {
//TC915100
@Test
- public void creatNewUserTest() throws Exception {
+ public void createNewUserTest() throws Exception {
String userId = generateValidUserId();
UserRoleEnum userRole = UserRoleEnum.DESIGNER;
AdminWorkspaceUIUtilies.createNewUser(userId, userRole);
+ GeneralUIUtils.ultimateWait();
UserManagementVerificator.validateUserCreated(userId, userRole);
}
//TC922253
@Test
- public void creatNewUser_MacIdTest() throws Exception {
+ public void createNewUser_MacIdTest() throws Exception {
String macId = generateValidMacId();
UserRoleEnum userRole = UserRoleEnum.DESIGNER;
AdminWorkspaceUIUtilies.createNewUser(macId, userRole);
+ GeneralUIUtils.ultimateWait();
UserManagementVerificator.validateUserCreated(macId, userRole);
}
@@ -106,9 +109,9 @@ public class AdminUserManagment extends SetupCDTest {
@Test
public void createInvalidMacIdTest(){
-// if(true){
-// throw new SkipException("Open bug 324032");
-// }
+ if(true){
+ throw new SkipException("Open bug 324032");
+ }
String macId = generateValidMacId();
StringBuilder invalidMacId = new StringBuilder(macId);
@@ -116,6 +119,7 @@ public class AdminUserManagment extends SetupCDTest {
UserRoleEnum userRole = UserRoleEnum.DESIGNER;
ExtentTestActions.log(Status.INFO, "Trying to create an invalid macId.");
AdminWorkspaceUIUtilies.createNewUser(invalidMacId.toString(), userRole);
+ GeneralUIUtils.ultimateWait();
ErrorMessageUIVerificator.validateErrorMessage(ActionStatus.INVALID_USER_ID);
}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTest.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTest.java
index 5533eb38f5..cd73dfba4f 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTest.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTest.java
@@ -20,28 +20,14 @@
package org.openecomp.sdc.ci.tests.execute.sanity;
-import static org.testng.AssertJUnit.assertTrue;
-
-import java.util.Arrays;
-import java.util.List;
-
+import com.aventstack.extentreports.Status;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.CheckBoxStatusEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
+import org.openecomp.sdc.ci.tests.datatypes.*;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.CatalogPageLeftPanelSubCategoryCheckbox;
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.TypesEnum;
import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.CatalogUIUtilitis;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
+import org.openecomp.sdc.ci.tests.utilities.*;
import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
import org.openecomp.sdc.ci.tests.verificator.CatalogVerificator;
import org.openqa.selenium.WebElement;
@@ -49,7 +35,10 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
-import com.aventstack.extentreports.Status;
+import java.util.Arrays;
+import java.util.List;
+
+import static org.testng.AssertJUnit.assertTrue;
@Test(singleThreaded = true)
public class CatalogLeftPanelTest extends SetupCDTest{
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportDCAE.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportDCAE.java
index cf510578ef..ad8347fbbe 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportDCAE.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportDCAE.java
@@ -71,6 +71,7 @@ import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
+import org.testng.SkipException;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -197,6 +198,11 @@ public class ImportDCAE extends SetupCDTest {
@Test
public void addPropertiesToVfcInstanceInDCAEAssetTest() throws Exception {
+
+ if(true){
+ throw new SkipException("Open bug 373762, can't update properties on CP or VFC instance on Composition screen");
+ }
+
String fileName = "importVFC_VFC15.yml";
ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportVFCAsset.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportVFCAsset.java
index 273a502895..9ed8ba5029 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportVFCAsset.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportVFCAsset.java
@@ -57,6 +57,7 @@ import org.openecomp.sdc.ci.tests.verificator.PropertyVerificator;
import org.openecomp.sdc.ci.tests.verificator.VFCverificator;
import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
import org.testng.Assert;
+import org.testng.SkipException;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
@@ -360,9 +361,11 @@ public class ImportVFCAsset extends SetupCDTest {
ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
ResourceUIUtils.fillMaxValueResourceGeneralInformationPage(atomicResourceMetaData);
- GeneralPageElements.clickUpdateButton();
- VFCverificator.verifyVFCUpdatedInUI(atomicResourceMetaData);
- GeneralPageElements.clickDeleteVersionButton();
+// GeneralPageElements.clickUpdateButton();
+// VFCverificator.verifyVFCUpdatedInUI(atomicResourceMetaData);
+// GeneralPageElements.clickDeleteVersionButton();
+ // Validate that button disabled
+ assertTrue(GeneralUIUtils.checkForDisabledAttribute(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue()));
}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardViaApis.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardViaApis.java
index 6cea8d6c6f..bf2bda906c 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardViaApis.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardViaApis.java
@@ -20,13 +20,10 @@
package org.openecomp.sdc.ci.tests.execute.sanity;
-import static org.testng.AssertJUnit.assertTrue;
-
-import java.awt.AWTException;
-import java.sql.Timestamp;
-import java.util.List;
-import java.util.Map;
-
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.LoggerContext;
+import com.clearspring.analytics.util.Pair;
+import fj.data.Either;
import org.openecomp.sdc.be.model.ComponentInstance;
import org.openecomp.sdc.be.model.Resource;
import org.openecomp.sdc.be.model.Service;
@@ -40,19 +37,16 @@ import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtillViaApis;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
+import org.openecomp.sdc.ci.tests.utils.general.*;
import org.slf4j.LoggerFactory;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-import com.clearspring.analytics.util.Pair;
+import java.awt.*;
+import java.sql.Timestamp;
+import java.util.List;
-import ch.qos.logback.classic.Level;
-import ch.qos.logback.classic.LoggerContext;
-import fj.data.Either;
+import static org.testng.AssertJUnit.assertTrue;
public class OnboardViaApis{
@@ -100,10 +94,11 @@ public class OnboardViaApis{
{
//CREATE DATA REQUIRED FOR TEST
boolean skipReport = true;
- AmdocsLicenseMembers amdocsLicenseMembers = OnboardingUtils.createVendorLicense(sdncDesignerDetails1);
+ AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Pair<String, Map<String, String>> createVendorSoftwareProduct = OnboardingUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filepath, sdncDesignerDetails1, amdocsLicenseMembers);
- VendorSoftwareProductObject vendorSoftwareProductObject = fillVendorSoftwareProductObjectWithMetaData(vnfFile, createVendorSoftwareProduct);
+ Pair<String, VendorSoftwareProductObject> createVendorSoftwareProduct = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filepath, sdncDesignerDetails1, amdocsLicenseMembers);
+// VendorSoftwareProductObject vendorSoftwareProductObject = fillVendorSoftwareProductObjectWithMetaData(vnfFile, createVendorSoftwareProduct);
+ VendorSoftwareProductObject vendorSoftwareProductObject = createVendorSoftwareProduct.right;
resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
@@ -115,40 +110,17 @@ public class OnboardViaApis{
service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
// TEST START
- // Update exist VLM Version (From 1.0 to 2.0)
- OnboardingUtils.updateVendorLicense(amdocsLicenseMembers, sdncDesignerDetails1, "1.0");
- // Set VLM version to 2.0 in VLM Meta data object
- amdocsLicenseMembers.setLicenseVersionId("2.0");
- amdocsLicenseMembers.setLicenseVersionLabel("2.0");
- OnboardingUtils.validateVlmExist(amdocsLicenseMembers.getVendorId(), amdocsLicenseMembers.getLicenseVersionId(), sdncDesignerDetails1);
+ VendorLicenseModelRestUtils.updateVendorLicense(amdocsLicenseMembers, sdncDesignerDetails1, false);
+ VendorLicenseModelRestUtils.validateVlmExist(amdocsLicenseMembers.getVendorId(), amdocsLicenseMembers.getVersion(), sdncDesignerDetails1);
// Update the VSP With the VLM new version and submit the VSP
- vendorSoftwareProductObject = OnboardingUtils.updateVSPWithNewVLMParameters(vendorSoftwareProductObject, amdocsLicenseMembers, sdncDesignerDetails1, "1.1", "2.0");
- OnboardingUtils.validateVspExist(vendorSoftwareProductObject.getVspId(),vendorSoftwareProductObject.getVersion(), sdncDesignerDetails1);
+ vendorSoftwareProductObject = VendorSoftwareProductRestUtils.updateVSPWithNewVLMParameters(vendorSoftwareProductObject, amdocsLicenseMembers, sdncDesignerDetails1);
+ VendorSoftwareProductRestUtils.validateVspExist(vendorSoftwareProductObject, sdncDesignerDetails1);
Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
System.out.println(distributeAndValidateService);
}
- public static VendorSoftwareProductObject fillVendorSoftwareProductObjectWithMetaData(String vnfFile, Pair<String, Map<String, String>> createVendorSoftwareProduct) {
- VendorSoftwareProductObject vendorSoftwareProductObject = new VendorSoftwareProductObject();
- Map<String, String> map = createVendorSoftwareProduct.right;
- vendorSoftwareProductObject.setAttContact(map.get("attContact"));
- vendorSoftwareProductObject.setCategory(map.get("category"));
- vendorSoftwareProductObject.setComponentId(map.get("componentId"));
- vendorSoftwareProductObject.setDescription(map.get("description"));
- vendorSoftwareProductObject.setSubCategory(map.get("subCategory"));
- vendorSoftwareProductObject.setVendorName(map.get("vendorName"));
- vendorSoftwareProductObject.setVspId(map.get("vspId"));
- vendorSoftwareProductObject.setName(createVendorSoftwareProduct.left);
- String[] arrFileNameAndExtension = vnfFile.split("\\.");
- vendorSoftwareProductObject.setOnboardingMethod("NetworkPackage");
- vendorSoftwareProductObject.setNetworkPackageName(arrFileNameAndExtension[0]);
- vendorSoftwareProductObject.setOnboardingOrigin(arrFileNameAndExtension[1]);
-
- return vendorSoftwareProductObject;
- }
-
public Service runOnboardViaApisOnly(ServiceReqDetails serviceReqDetails, ResourceReqDetails resourceReqDetails, String filepath, String vnfFile) throws Exception, AWTException {
Pair<String, VendorSoftwareProductObject> createVendorSoftwareProduct = OnboardingUtillViaApis.createVspViaApis(resourceReqDetails, filepath, vnfFile, sdncDesignerDetails1);
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlows.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsThroughAPI.java
index da43435cdf..837f834ffa 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlows.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsThroughAPI.java
@@ -1,18 +1,10 @@
package org.openecomp.sdc.ci.tests.execute.sanity;
-import static org.testng.AssertJUnit.assertTrue;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.openecomp.sdc.be.model.ArtifactDefinition;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.Resource;
+import com.aventstack.extentreports.Status;
+import com.clearspring.analytics.util.Pair;
+import fj.data.Either;
+import org.openecomp.sdc.be.model.*;
import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.ci.tests.dataProviders.OnbordingDataProviders;
import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
@@ -23,21 +15,19 @@ import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.general.FileHandling;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtillViaApis;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
+import org.openecomp.sdc.ci.tests.utils.general.*;
import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
import org.testng.annotations.Test;
-import com.aventstack.extentreports.Status;
-import com.clearspring.analytics.util.Pair;
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
-import fj.data.Either;
+import static org.testng.AssertJUnit.assertTrue;
-public class OnboardingFlows extends SetupCDTest{
+public class OnboardingFlowsThroughAPI extends SetupCDTest{
protected boolean skipReport = false;
protected User sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
@@ -57,9 +47,9 @@ public class OnboardingFlows extends SetupCDTest{
cvfcArtifacts.put(CvfcTypeEnum.VES_EVENTS, vesArtifactFileLocation);
getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- AmdocsLicenseMembers amdocsLicenseMembers = OnboardingUiUtils.createVendorLicense(getUser());
+ AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, cvfcArtifacts);
+ VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, cvfcArtifacts);
resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
List<ComponentInstance> componentInstances = resource.getComponentInstances();
@@ -98,41 +88,56 @@ public class OnboardingFlows extends SetupCDTest{
String vnfFile = newRandomFileNamesFromFolder.get(0);
getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
// setLog(vnfFile);
- AmdocsLicenseMembers amdocsLicenseMembers = OnboardingUiUtils.createVendorLicense(getUser());
+ getExtendTest().log(Status.INFO, "Create Vendor License");
+ AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+ getExtendTest().log(Status.INFO, "Create Vendor Software Product: " + resourceReqDetails.getName());
+ VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
+ getExtendTest().log(Status.INFO, "Create Resource: " + resourceReqDetails.getName());
Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
+ getExtendTest().log(Status.INFO, "Certify the Resource: " + resourceReqDetails.getName());
resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
+ getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
-
+
+ getExtendTest().log(Status.INFO, "Add VF to service");
Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
addComponentInstanceToComponentContainer.left().value();
+ getExtendTest().log(Status.INFO, "Certify the service");
service = (org.openecomp.sdc.be.model.Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+ getExtendTest().log(Status.INFO, "Start distributing the service");
Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
+ getExtendTest().log(Status.INFO, "Service distributed");
assertTrue("Distribution of service " + service.getName() + " failed", distributeAndValidateService);
// update
vnfFile = newRandomFileNamesFromFolder.get(1);
- getExtendTest().log(Status.INFO, "Going to update VNF with file " + vnfFile);
- OnboardingUtils.updateVendorLicense(amdocsLicenseMembers, sdncDesignerDetails, "1.0");
- vendorSoftwareProductObject = OnboardingUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+ getExtendTest().log(Status.INFO, "Going to update VLM with new file " + vnfFile);
+ VendorLicenseModelRestUtils.updateVendorLicense(amdocsLicenseMembers, sdncDesignerDetails, false);
+ vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+ getExtendTest().log(Status.INFO, "Create new VSP: " + vendorSoftwareProductObject.getName());
resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
+ getExtendTest().log(Status.INFO, "Create new resource: " + resourceReqDetails.getName());
resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
+ getExtendTest().log(Status.INFO, "Certify the resource");
resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
+ getExtendTest().log(Status.INFO, "Create new service: " + serviceReqDetails.getName());
service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
-
+
+ getExtendTest().log(Status.INFO, "Add VF to service");
addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
addComponentInstanceToComponentContainer.left().value();
+ getExtendTest().log(Status.INFO, "Certify the service");
service = (org.openecomp.sdc.be.model.Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+ getExtendTest().log(Status.INFO, "Start distributing the service");
distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
+ getExtendTest().log(Status.INFO, "Service distributed");
assertTrue("Distribution of service " + service.getName() + " failed", distributeAndValidateService);
-
-
}
@@ -144,9 +149,9 @@ public class OnboardingFlows extends SetupCDTest{
String filePath = FileHandling.getVnfRepositoryPath();
String vnfFile = newRandomFileNamesFromFolder.get(0);
getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- AmdocsLicenseMembers amdocsLicenseMembers = OnboardingUiUtils.createVendorLicense(getUser());
+ AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
+ VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
@@ -159,11 +164,11 @@ public class OnboardingFlows extends SetupCDTest{
service = (org.openecomp.sdc.be.model.Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
assertTrue("Distribution of service " + service.getName() + " failed", distributeAndValidateService);
-
+
// update resource to v2.0
String updateVnfFile = newRandomFileNamesFromFolder.get(1);
getExtendTest().log(Status.INFO, "Going to update VNF with file " + vnfFile);
- OnboardingUiUtils.updateVendorSoftwareProduct(vendorSoftwareProductObject.getVspId(), updateVnfFile, filePath, sdncDesignerDetails, "2.0");
+ VendorSoftwareProductRestUtils.updateVendorSoftwareProductToNextVersion(vendorSoftwareProductObject, sdncDesignerDetails, filePath, updateVnfFile);
resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
resourceReqDetails.setUniqueId(resource.getUniqueId());
resourceReqDetails.setVersion(resource.getVersion());
@@ -207,12 +212,11 @@ public class OnboardingFlows extends SetupCDTest{
String vnfFile = newRandomFileNamesFromFolder.get(0);
getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- AmdocsLicenseMembers amdocsLicenseMembers = OnboardingUiUtils.createVendorLicense(sdncDesignerDetails1);
+ AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
getExtendTest().log(Status.INFO, "Create Vendor License Model " + amdocsLicenseMembers.getVendorLicenseName());
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
getExtendTest().log(Status.INFO, "Create Vendor Software Product " + resourceReqDetails.getName());
- Pair<String, Map<String, String>> createVendorSoftwareProduct = OnboardingUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails1, amdocsLicenseMembers);
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardViaApis.fillVendorSoftwareProductObjectWithMetaData(vnfFile, createVendorSoftwareProduct);
+ VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
// 2. Create VF, certify - v1.0 is created
resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
getExtendTest().log(Status.INFO, "Create VF " + resourceReqDetails.getName());
@@ -221,8 +225,8 @@ public class OnboardingFlows extends SetupCDTest{
resource_v1 = (Resource) AtomicOperationUtils.changeComponentState(resource_v1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
// 3. Update VSP to v2.0
getExtendTest().log(Status.INFO, "Update VSP to version 2.0");
- OnboardingUtils.updateVendorSoftwareProductToNextVersion(vendorSoftwareProductObject, "2.0", sdncDesignerDetails1, filePath, vnfFile);
- OnboardingUtils.validateVspExist(vendorSoftwareProductObject.getVspId(),vendorSoftwareProductObject.getVersion(),sdncDesignerDetails1);
+ VendorSoftwareProductRestUtils.updateVendorSoftwareProductToNextVersion(vendorSoftwareProductObject, sdncDesignerDetails1, filePath, vnfFile);
+ VendorSoftwareProductRestUtils.validateVspExist(vendorSoftwareProductObject, sdncDesignerDetails1);
// 4. Update the VF with v2.0 of the VSP
getExtendTest().log(Status.INFO, "Checkout VF v1.1");
resource_v1 = (Resource) AtomicOperationUtils.changeComponentState(resource_v1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
@@ -235,8 +239,8 @@ public class OnboardingFlows extends SetupCDTest{
Resource resource_v2 = (Resource) AtomicOperationUtils.changeComponentState(resource_v1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
// 5. Update VSP to v3.0 wih the zip from v1.0
getExtendTest().log(Status.INFO, "Update VSP to version 3.0");
- OnboardingUtils.updateVendorSoftwareProductToNextVersion(vendorSoftwareProductObject, "3.0", sdncDesignerDetails1);
- OnboardingUtils.validateVspExist(vendorSoftwareProductObject.getVspId(),vendorSoftwareProductObject.getVersion(),sdncDesignerDetails1);
+ VendorSoftwareProductRestUtils.updateVendorSoftwareProductToNextVersion(vendorSoftwareProductObject, sdncDesignerDetails1, false);
+ VendorSoftwareProductRestUtils.validateVspExist(vendorSoftwareProductObject, sdncDesignerDetails1);
getExtendTest().log(Status.INFO, "Checkout VF v2.1");
resource_v1 = (Resource) AtomicOperationUtils.changeComponentState(resource_v1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
resourceReqDetails.setUniqueId(resource_v1.getUniqueId());
@@ -262,18 +266,17 @@ public class OnboardingFlows extends SetupCDTest{
}
@Test(dataProviderClass = org.openecomp.sdc.ci.tests.dataProvider.OnbordingDataProviders.class, dataProvider = "updateList")
- public void distributeServiceAndUpgradeWithNewHeatFile(String vnfFile1, String vnfFile2) throws Throwable
+ public void updateVSPFlowFromOnboardToDistribution(String vnfFile1, String vnfFile2) throws Throwable
{
- setLog(String.format("Update VSP Test: Create VF from %s add it to service, distribute than upgrade the VF with file %s and update the service and distribute", vnfFile1, vnfFile2));
+ setLog(String.format("Create VSP from %s , update VSP with %s ", vnfFile1, vnfFile2));
// 1. Import VSP v1.0
String filePath = org.openecomp.sdc.ci.tests.utilities.FileHandling.getUpdateVSPVnfRepositoryPath();
User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- AmdocsLicenseMembers amdocsLicenseMembers = OnboardingUtils.createVendorLicense(sdncDesignerDetails1);
+ AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", amdocsLicenseMembers.getVendorLicenseName()));
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile1));
- Pair<String, Map<String, String>> createVendorSoftwareProduct = OnboardingUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, sdncDesignerDetails1, amdocsLicenseMembers);
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardViaApis.fillVendorSoftwareProductObjectWithMetaData(vnfFile1, createVendorSoftwareProduct);
+ VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
// 2. Create VF, certify - v1.0 is created
resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
@@ -289,16 +292,16 @@ public class OnboardingFlows extends SetupCDTest{
getExtendTest().log(Status.INFO, String.format("Adding VF instance to Service"));
service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
getExtendTest().log(Status.INFO, String.format("Certify the Service"));
-// 5. Distribute the Service v1.0
+// 4. Distribute the Service v1.0
Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
getExtendTest().log(Status.INFO, String.format("Distribute and validate the Service"));
assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
-// 6. Update VSP to v2.0
+// 5. Update VSP to v2.0
getExtendTest().log(Status.INFO, "Upgrading the VSP with new file: " + vnfFile2);
- OnboardingUtils.updateVendorSoftwareProductToNextVersion(vendorSoftwareProductObject, "2.0", sdncDesignerDetails1, filePath, vnfFile2);
+ VendorSoftwareProductRestUtils.updateVendorSoftwareProductToNextVersion(vendorSoftwareProductObject, sdncDesignerDetails1, filePath, vnfFile2);
getExtendTest().log(Status.INFO, String.format("Validating VSP %s upgrade to version 2.0: " ,vnfFile2));
- OnboardingUtils.validateVspExist(vendorSoftwareProductObject.getVspId(),vendorSoftwareProductObject.getVersion(),sdncDesignerDetails1);
-// 7. Update the VF with v2.0 of the VSP and certify the VF
+ VendorSoftwareProductRestUtils.validateVspExist(vendorSoftwareProductObject, sdncDesignerDetails1);
+// 6. Update the VF with v2.0 of the VSP and certify the VF
getExtendTest().log(Status.INFO, String.format("Checkout the VF %s v1.1 " ,resourceReqDetails.getName()));
resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
resourceReqDetails.setUniqueId(resource.getUniqueId());
@@ -308,34 +311,35 @@ public class OnboardingFlows extends SetupCDTest{
resource = AtomicOperationUtils.updateResource(resourceReqDetails, sdncDesignerDetails, true).left().value();
getExtendTest().log(Status.INFO, String.format("Certify the VF to v2.0"));
Resource resource_v2 = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-// 8. Update the Service with the VFi version 2.0
+// 7. Update the Service with the VFi version 2.0
getExtendTest().log(Status.INFO, String.format("Checkout the Service v1.1"));
service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
getExtendTest().log(Status.INFO, String.format("Change the instance of the VF in the service to VFi v2.0"));
AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);
getExtendTest().log(Status.INFO, String.format("Certify the Service to v2.0"));
service = (org.openecomp.sdc.be.model.Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-// 9. Distribute the service v2.0
+// 8. Distribute the service v2.0
distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
getExtendTest().log(Status.INFO, String.format("Distribute and validate the Service"));
assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
}
@Test(dataProviderClass = org.openecomp.sdc.ci.tests.dataProvider.OnbordingDataProviders.class, dataProvider = "VNF_List")
- public void distributeServiceFromHeatFile(String filePath, String vnfFile) throws Throwable
+ public void fromOnboardToDistribution(String filePath, String vnfFile) throws Throwable
{
// String vnfFile1 = "1-2016-20-visbc3vf-(VOIP)_v2.1.zip";
// String vnfFile2 = "2-2016-20-visbc3vf-(VOIP)_v2.0.zip";
- setLog(String.format("Distribute Service Test: Create VF from %s add it to service than distribute", vnfFile));
+ setLog(String.format("%s", vnfFile));
// 1. Import VSP v1.0
//String filePath = FileHandling.getVnfRepositoryPath();
User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- AmdocsLicenseMembers amdocsLicenseMembers = OnboardingUtils.createVendorLicense(sdncDesignerDetails1);
+ AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", amdocsLicenseMembers.getVendorLicenseName()));
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile));
- Pair<String, Map<String, String>> createVendorSoftwareProduct = OnboardingUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails1, amdocsLicenseMembers);
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardViaApis.fillVendorSoftwareProductObjectWithMetaData(vnfFile, createVendorSoftwareProduct);
+ Pair<String, VendorSoftwareProductObject> createVendorSoftwareProduct = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails1, amdocsLicenseMembers);
+// VendorSoftwareProductObject vendorSoftwareProductObject = OnboardViaApis.fillVendorSoftwareProductObjectWithMetaData(vnfFile, createVendorSoftwareProduct);
+ VendorSoftwareProductObject vendorSoftwareProductObject = createVendorSoftwareProduct.right;
// 2. Create VF, certify - v1.0 is created
resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
@@ -351,7 +355,7 @@ public class OnboardingFlows extends SetupCDTest{
getExtendTest().log(Status.INFO, String.format("Adding VF instance to Service"));
service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
getExtendTest().log(Status.INFO, String.format("Certify the Service"));
-// 5. Distribute the Service v1.0
+// 4. Distribute the Service v1.0
Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
getExtendTest().log(Status.INFO, String.format("Distribute and validate the Service"));
assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
@@ -362,14 +366,15 @@ public class OnboardingFlows extends SetupCDTest{
{
// 1. Import VSP v1.0
String filePath = FileHandling.getVnfRepositoryPath();
- String vnfFile1 = "HeatCandidate_2017-09-20_13-37_70Name_2017-491-4vshaken-HTTP-CM-vf-v1.0-(VOIP)_10202017.zip";
+ String vnfFile1 = "1-VF-vCSCF-StateDB-new-update_v3.0.zip";
User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- AmdocsLicenseMembers amdocsLicenseMembers = OnboardingUtils.createVendorLicense(sdncDesignerDetails1);
+ AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", amdocsLicenseMembers.getVendorLicenseName()));
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile1));
- Pair<String, Map<String, String>> createVendorSoftwareProduct = OnboardingUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, sdncDesignerDetails1, amdocsLicenseMembers);
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardViaApis.fillVendorSoftwareProductObjectWithMetaData(vnfFile1, createVendorSoftwareProduct);
+ Pair<String, VendorSoftwareProductObject> createVendorSoftwareProduct = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, sdncDesignerDetails1, amdocsLicenseMembers);
+// VendorSoftwareProductObject vendorSoftwareProductObject = OnboardViaApis.fillVendorSoftwareProductObjectWithMetaData(vnfFile1, createVendorSoftwareProduct);
+ VendorSoftwareProductObject vendorSoftwareProductObject = createVendorSoftwareProduct.right;
// 2. Create VF, certify - v1.0 is created
resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
@@ -385,7 +390,7 @@ public class OnboardingFlows extends SetupCDTest{
getExtendTest().log(Status.INFO, String.format("Adding VF instance to Service"));
service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
getExtendTest().log(Status.INFO, String.format("Certify the Service"));
-// 5. Distribute the Service v1.0
+// 4. Distribute the Service v1.0
Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
getExtendTest().log(Status.INFO, String.format("Distribute and validate the Service"));
assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
@@ -395,6 +400,5 @@ public class OnboardingFlows extends SetupCDTest{
protected UserRoleEnum getRole() {
return UserRoleEnum.DESIGNER;
}
-
-
+
}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Onboard.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsUI.java
index 7681af63c3..b2314af267 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Onboard.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsUI.java
@@ -20,43 +20,24 @@
package org.openecomp.sdc.ci.tests.execute.sanity;
-import static org.testng.AssertJUnit.assertNotNull;
-import static org.testng.AssertJUnit.assertTrue;
-
-import java.awt.AWTException;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
+import com.aventstack.extentreports.Status;
+import com.clearspring.analytics.util.Pair;
import org.openecomp.sdc.ci.tests.dataProvider.OnbordingDataProviders;
-import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.*;
import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
import org.openecomp.sdc.ci.tests.execute.setup.ArtifactsCorrelationManager;
import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.GovernorOperationPage;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.pages.OpsOperationPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.TesterOperationPage;
+import org.openecomp.sdc.ci.tests.pages.*;
import org.openecomp.sdc.ci.tests.utilities.FileHandling;
import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
+import org.openecomp.sdc.ci.tests.utils.general.VendorLicenseModelRestUtils;
+import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
import org.openecomp.sdc.ci.tests.verificator.ServiceVerificator;
import org.openqa.selenium.WebElement;
import org.testng.AssertJUnit;
@@ -65,10 +46,17 @@ import org.testng.annotations.Optional;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-import com.aventstack.extentreports.Status;
-import com.clearspring.analytics.util.Pair;
+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.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
-public class Onboard extends SetupCDTest {
+public class OnboardingFlowsUI extends SetupCDTest {
protected static String filePath = FileHandling.getVnfRepositoryPath();
protected String makeDistributionValue;
@@ -80,18 +68,30 @@ public class Onboard extends SetupCDTest {
}
@Test
- public void onboardVNFTestSanityOneFile() throws Exception, Throwable {
-// List<String> fileNamesFromFolder = OnboardingUiUtils.getVnfNamesFileList();
-// String vnfFile = fileNamesFromFolder.get(0).toString();
- String vnfFile = "2017-302_vNSO.zip";
-// String vnfFile = "1-Fn-vprobe-be-11-2-5-1-vf-(MOBILITY)_v5.0.zip";
+ public void onboardVNFTestSanityOneFile() throws Throwable {
+ String vnfFile = "1-VF-vUSP-vCCF-DB_v11.1.zip";
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();//getServiceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
runOnboardToDistributionFlow(resourceReqDetails, serviceReqDetails, filePath, vnfFile);
}
-
+
+ @Test
+ public void performanceTest() throws Throwable {
+ System.out.println("Start test");
+ Long actualTestRunTime = Utils.getActionDuration(() -> {
+ try {
+ onboardVNFTestSanityOneFile();
+ } catch (Throwable throwable) {
+ throwable.printStackTrace();
+ }
+ });
+ Long regularTestRunTime = 400L;
+ double factor = 1.5;
+ assertTrue("Expected test run time should be less from " + regularTestRunTime*factor + ", actual time is " + actualTestRunTime , regularTestRunTime*factor>actualTestRunTime);
+ }
+
@Test
- public void onboardVNFTestSanity() throws Exception, Throwable {
+ public void onboardVNFTestSanity() throws Throwable {
List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList();
String vnfFile = fileNamesFromFolder.get(0).toString();
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
@@ -100,7 +100,7 @@ public class Onboard extends SetupCDTest {
}
- public void runOnboardToDistributionFlow(ResourceReqDetails resourceReqDetails, ServiceReqDetails serviceMetadata, String filePath, String vnfFile) throws Exception, AWTException {
+ public void runOnboardToDistributionFlow(ResourceReqDetails resourceReqDetails, ServiceReqDetails serviceMetadata, String filePath, String vnfFile) throws Exception {
getExtendTest().log(Status.INFO, "Going to create resource with category: " + resourceReqDetails.getCategories().get(0).getName()
+ " subCategory: " + resourceReqDetails.getCategories().get(0).getSubcategories().get(0).getName()
+ " and service category: " + serviceMetadata.getCategory());
@@ -151,8 +151,8 @@ public class Onboard extends SetupCDTest {
getExtendTest().log(Status.INFO, String.format("The onboarding %s test is passed ! ", vnfFile));
}
- public String onboardAndCertify(ResourceReqDetails resourceReqDetails, String filePath, String vnfFile) throws Exception, IOException {
- Pair<String,Map<String,String>> onboardAndValidate = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFile, getUser());
+ public String onboardAndCertify(ResourceReqDetails resourceReqDetails, String filePath, String vnfFile) throws Exception {
+ Pair<String, VendorSoftwareProductObject> onboardAndValidate = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFile, getUser());
String vspName = onboardAndValidate.left;
DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
@@ -168,7 +168,7 @@ public class Onboard extends SetupCDTest {
@Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "VNF_List")
- public void onboardVNFTest(String filePath, String vnfFile) throws Exception, Throwable {
+ public void onboardVNFTest(String filePath, String vnfFile) throws Throwable {
setLog(vnfFile);
System.out.println("printttttttttttttt - >" + makeDistributionValue);
ResourceReqDetails resourceReqDetails = ElementFactory.getRandomCategoryResource();
@@ -177,7 +177,7 @@ public class Onboard extends SetupCDTest {
}
@Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "VNF_List")
- public void onboardVNFShotFlow(String filePath, String vnfFile) throws Exception, Throwable {
+ public void onboardVNFShotFlow(String filePath, String vnfFile) throws Throwable {
setLog(vnfFile);
System.out.println("printttttttttttttt - >" + makeDistributionValue);
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
@@ -185,7 +185,7 @@ public class Onboard extends SetupCDTest {
}
@Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "randomVNF_List")
- public void onboardRandomVNFsTest(String filePath, String vnfFile) throws Exception, Throwable {
+ public void onboardRandomVNFsTest(String filePath, String vnfFile) throws Throwable {
setLog(vnfFile);
System.out.println("printttttttttttttt - >" + makeDistributionValue);
System.out.println("Vnf File name is: " + vnfFile);
@@ -196,13 +196,13 @@ public class Onboard extends SetupCDTest {
@Test
- public void onboardUpdateVNFTest() throws Exception, Throwable {
+ public void onboardUpdateVNFTest() throws Throwable {
// Object[] fileNamesFromFolder = FileHandling.getZipFileNamesFromFolder(filePath);
List<String> fileNamesFromFolder = FileHandling.getZipFileNamesFromFolder(filePath);
// String vnfFile = fileNamesFromFolder[0].toString();
String vnfFile = fileNamesFromFolder.get(0);
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Pair<String,Map<String,String>> vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFile, getUser());
+ Pair<String, VendorSoftwareProductObject> vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFile, getUser());
String vspName = vsp.left;
ResourceGeneralPage.clickSubmitForTestingButton(vspName);
@@ -280,18 +280,17 @@ public class Onboard extends SetupCDTest {
public void threeVMMSCsInServiceTest() throws Exception{
String pathFile = FileHandling.getFilePath("VmmscArtifacts");
- List<String> vmmscList = new ArrayList<String>();
- vmmscList = Arrays.asList(new File(pathFile).list()).stream().filter(e -> e.contains("vmmsc") && e.endsWith(".zip")).collect(Collectors.toList());
+ List<String> vmmscList = Arrays.asList(new File(pathFile).list()).stream().filter(e -> e.contains("vmmsc") && e.endsWith(".zip")).collect(Collectors.toList());
assertTrue("Did not find vMMSCs", vmmscList.size() > 0);
- Map<String, String> vspNames = new HashMap<String, String>();
+ Map<String, String> vspNames = new HashMap<>();
for (String vnfFile : vmmscList){
getExtendTest().log(Status.INFO, String.format("Going to onboard the VNF %s......", vnfFile));
System.out.println(String.format("Going to onboard the VNF %s......", vnfFile));
- AmdocsLicenseMembers amdocsLicenseMembers = OnboardingUiUtils.createVendorLicense(getUser());
+ AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Pair<String,Map<String,String>> createVendorSoftwareProduct = OnboardingUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, pathFile, getUser(), amdocsLicenseMembers);
+ Pair<String, VendorSoftwareProductObject> createVendorSoftwareProduct = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, pathFile, getUser(), amdocsLicenseMembers);
getExtendTest().log(Status.INFO, String.format("Searching for onboarded %s", vnfFile));
HomePage.showVspRepository();
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java
index d24000806e..fa55a1e66d 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java
@@ -1,43 +1,14 @@
package org.openecomp.sdc.ci.tests.execute.sanity;
-import static org.testng.Assert.assertTrue;
-
-import java.util.List;
-
+import com.aventstack.extentreports.Status;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.TypesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.CircleSize;
-import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.*;
+import org.openecomp.sdc.ci.tests.datatypes.enums.*;
import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.GovernorOperationPage;
-import org.openecomp.sdc.ci.tests.pages.InformationalArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.OpsOperationPage;
-import org.openecomp.sdc.ci.tests.pages.PropertiesPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.TesterOperationPage;
-import org.openecomp.sdc.ci.tests.pages.ToscaArtifactsPage;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.CatalogUIUtilitis;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
+import org.openecomp.sdc.ci.tests.pages.*;
+import org.openecomp.sdc.ci.tests.utilities.*;
import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
@@ -45,11 +16,14 @@ import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.AssertJUnit;
+import org.testng.SkipException;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-import com.aventstack.extentreports.Status;
+import java.util.List;
+
+import static org.testng.Assert.assertTrue;
public class PNF extends SetupCDTest {
@@ -117,6 +91,10 @@ public class PNF extends SetupCDTest {
@Test
public void addPropertiesToVfcInstanceInPNFTest() throws Exception {
+ if(true){
+ throw new SkipException("Open bug 373762, can't update properties on CP or VFC instance on Composition screen");
+ }
+
String fileName = "CP02.yml";
ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.CP, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PortMirroring.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PortMirroring.java
index b4bd55c6ca..ef957c6e32 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PortMirroring.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PortMirroring.java
@@ -1,124 +1,610 @@
package org.openecomp.sdc.ci.tests.execute.sanity;
-import java.util.Map;
-
-import org.openecomp.sdc.be.model.ComponentInstance;
+import com.aventstack.extentreports.Status;
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
import org.openecomp.sdc.be.model.Resource;
import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.ConnectionWizardPopUpObject;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceContainer;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
+import org.openecomp.sdc.ci.tests.datatypes.*;
import org.openecomp.sdc.ci.tests.datatypes.enums.CircleSize;
import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
import org.openecomp.sdc.ci.tests.pages.CompositionPage;
+import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
+import org.openecomp.sdc.ci.tests.utilities.CatalogUIUtilitis;
+import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
+import org.openecomp.sdc.ci.tests.utilities.HomeUtils;
+import org.openecomp.sdc.ci.tests.utilities.PortMirroringUtils;
import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
import org.openecomp.sdc.ci.tests.utils.general.FileHandling;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtillViaApis;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
+import org.openecomp.sdc.ci.tests.verificator.PortMirroringVerificator;
import org.openecomp.sdc.ci.tests.verificator.ServiceVerificator;
+import org.testng.AssertJUnit;
+import org.testng.SkipException;
import org.testng.annotations.Test;
-import com.aventstack.extentreports.Status;
-import com.clearspring.analytics.util.Pair;
+import java.io.File;
-import fj.data.Either;
+import static org.testng.Assert.assertTrue;
-public class PortMirroring extends SetupCDTest
-{
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER3;
+public class PortMirroring extends SetupCDTest {
+
+ @Test
+ public void createPortMirroringConfigurationServiceProxy() throws Throwable {
+ PortMirrioringConfigurationObject portMirrioringConfigurationObject = PortMirroringUtils.createPortMirriongConfigurationStructure();
+ ServiceReqDetails serviceReqDetails = portMirrioringConfigurationObject.getServiceReqDetails();
+ CanvasManager canvasManager = portMirrioringConfigurationObject.getCanvasManager();
+ CanvasElement serviceElementVmmeSourceName = portMirrioringConfigurationObject.getServiceElementVmmeSourceName();
+ String vmmeSourceName = portMirrioringConfigurationObject.getVmmeSourceName();
+ CanvasElement serviceElementVprobeCollector = portMirrioringConfigurationObject.getServiceElementVprobeCollector();
+ String vprobeSourceName = portMirrioringConfigurationObject.getVprobeSourceName();
+
+ serviceReqDetails.setVersion("0.1");
+ getExtendTest().log(Status.INFO, "Validating links between elements were created");
+ ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 2);
+
+ canvasManager.clickOnCanvaElement(serviceElementVmmeSourceName);
+ PortMirroringVerificator.validatingProxyServiceNameAndType(vmmeSourceName, "0");
+
+ canvasManager.clickOnCanvaElement(serviceElementVprobeCollector);
+ PortMirroringVerificator.validatingProxyServiceNameAndType(vprobeSourceName, "0");
}
- String portMirroringElementNameInPallete = "Port Mirroring Configuration";
- String portMirroringCapReqType = "org.openecomp.capabilities.PortMirroring";
- String portMirroringSourceCapability = "Port Mirroring Configuration 0: source: [1, UNBOUNDED]";
- String portMirroringCollectorCapability = "Port Mirroring Configuration 0: collector: [1, 1]";
+ @Test
+ public void distributePortMirroringConfigurationServiceProxy() throws Throwable {
+ PortMirrioringConfigurationObject portMirrioringConfigurationObject = PortMirroringUtils.createPortMirriongConfigurationStructure();
+ ServiceReqDetails serviceReqDetails = portMirrioringConfigurationObject.getServiceReqDetails();
+ Service service = portMirrioringConfigurationObject.getService();
+
+ serviceReqDetails.setVersion("0.1");
+ getExtendTest().log(Status.INFO, "Validating links between elements were created");
+ ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 2);
+
+ getExtendTest().log(Status.INFO, String.format("Going to certify the Service"));
+ service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+ getExtendTest().log(Status.INFO, String.format("Service is certified"));
+ Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
+ getExtendTest().log(Status.INFO, String.format("Distribute and validate the Service"));
+ AssertJUnit.assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
+ }
@Test
- public void createPortMirroringServiceProxy() throws Throwable {
+ public void createPortMirroringByPolicyServiceProxy() throws Throwable {
//Using API onboard and certify 2 zip files Source: vmmme and Collector: Vprobe
String filePath = FileHandling.getPortMirroringRepositoryPath();
- ServiceContainer serviceContainerVmme_Source = createServiceFromHeatFile(filePath,"2016-227_vmme_vmme_30_1610_e2e.zip");
- ServiceContainer serviceContainerVprobe_Collector = createServiceFromHeatFile(filePath,"vProbe_2017-10-22_07-24.zip");
+ ServiceContainer serviceContainerVmme_Source = PortMirroringUtils.createServiceFromHeatFile(filePath, "2016-227_vmme_vmme_30_1610_e2e.zip");
+
+ // create service with required pnf's and certify it
+ Resource resourceCisco = PortMirroringUtils.GeneratePNFAndUpdateInput(PortMirroringEnum.CISCO_VENDOR_NAME.getValue(), PortMirroringEnum.CISCO_VENDOR_MODEL_NUMBER.getValue(), getUser());
+ Resource resourceAPCON1 = PortMirroringUtils.GeneratePNFAndUpdateInput(PortMirroringEnum.APCON1_VENDOR_NAME.getValue(), PortMirroringEnum.APCON1_VENDOR_MODEL_NUMBER.getValue(), getUser());
+ Resource resourceAPCON2 = PortMirroringUtils.GeneratePNFAndUpdateInput(PortMirroringEnum.APCON2_VENDOR_NAME.getValue(), PortMirroringEnum.APCON2_VENDOR_MODEL_NUMBER.getValue(), getUser());
+
+ ServiceReqDetails serviceReqDetailsCollector = ElementFactory.getDefaultService();
+ serviceReqDetailsCollector.setServiceType(PortMirroringEnum.SERVICE_TYPE.getValue());
+ getExtendTest().log(Status.INFO, String.format("Creating collector service %s (PNF container)", serviceReqDetailsCollector.getName()));
+ Service serviceCollector = AtomicOperationUtils.createCustomService(serviceReqDetailsCollector, UserRoleEnum.DESIGNER, true).left().value();
+
+ getExtendTest().log(Status.INFO, String.format("Adding pnf's: %s,%s,%s to service %s", resourceCisco.getName(), resourceAPCON1.getName(), resourceAPCON2.getName(), serviceCollector.getName()));
-// String vmmeSourceName = "ciServiceb560327d162f";
-// String vprobeSourceName = "ciService3d9933d31791";
+ AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceCisco, serviceCollector, UserRoleEnum.DESIGNER, true, "80", "80");
+ AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceAPCON1, serviceCollector, UserRoleEnum.DESIGNER, true, "80", "200");
+ AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceAPCON2, serviceCollector, UserRoleEnum.DESIGNER, true, "200", "200");
- // create service
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata, getUser());
+ serviceCollector = (Service) AtomicOperationUtils.changeComponentState(serviceCollector, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+ // create container service
+ ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
+ getExtendTest().log(Status.INFO, String.format("Creating container service %s", serviceReqDetails.getName()));
+ Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
String vmmeSourceName = serviceContainerVmme_Source.getService().getName();
- String vprobeSourceName = serviceContainerVprobe_Collector.getService().getName();
+ String collectorServiceName = serviceCollector.getName();
+
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(service.getName());
ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
CanvasManager canvasManager = CanvasManager.getCanvasManager();
CompositionPage.searchForElement(vmmeSourceName);
- CanvasElement serviceElementVmmeSourceName = canvasManager.createElementOnCanvas(vmmeSourceName);
-
- CompositionPage.searchForElement(vprobeSourceName);
- CanvasElement serviceElementVprobeCollector = canvasManager.createElementOnCanvas(vprobeSourceName);
-
- CompositionPage.searchForElement(portMirroringElementNameInPallete);
- CanvasElement portMirroringConfigurationElement = canvasManager.createElementOnCanvas(portMirroringElementNameInPallete);
-
- ConnectionWizardPopUpObject connectionWizardPopUpObjectVMME = new ConnectionWizardPopUpObject("","", portMirroringCapReqType, portMirroringSourceCapability);
- ConnectionWizardPopUpObject connectionWizardPopUpObjectVProbe = new ConnectionWizardPopUpObject("","", portMirroringCapReqType, portMirroringCollectorCapability);
-
- canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVmmeSourceName, CircleSize.SERVICE,portMirroringConfigurationElement, CircleSize.NORMATIVE, connectionWizardPopUpObjectVMME);
- canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVprobeCollector, CircleSize.SERVICE, portMirroringConfigurationElement, CircleSize.NORMATIVE, connectionWizardPopUpObjectVProbe);
-
- serviceMetadata.setVersion("0.1");
- ServiceVerificator.verifyLinkCreated(serviceMetadata, getUser(), 2);
-
- System.out.println("End");
- }
-
- public ServiceContainer createServiceFromHeatFile(String filePath, String vnfFile) throws Throwable
- {
- setLog(String.format("Distribute Service Test: Create VF from %s add it to service than distribute", vnfFile));
-// 1. Import VSP v1.0
- User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER3);
- AmdocsLicenseMembers amdocsLicenseMembers = OnboardingUtils.createVendorLicense(sdncDesignerDetails1);
- getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", amdocsLicenseMembers.getVendorLicenseName()));
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile));
- Pair<String, Map<String, String>> createVendorSoftwareProduct = OnboardingUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails1, amdocsLicenseMembers);
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardViaApis.fillVendorSoftwareProductObjectWithMetaData(vnfFile, createVendorSoftwareProduct);
-// 2. Create VF, certify - v1.0 is created
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- getExtendTest().log(Status.INFO, String.format("Creating Virtual Function (VF): %s v1.0", resourceReqDetails.getName()));
- getExtendTest().log(Status.INFO, String.format("Certify the VF"));
-// 3. Create Service add to it the certified VF and certify the Service v1.0
+ CanvasElement serviceElementVmmeSource = canvasManager.createElementOnCanvas(vmmeSourceName);
+
+ CompositionPage.searchForElement(collectorServiceName);
+ CanvasElement serviceElementCollectorService = canvasManager.createElementOnCanvas(collectorServiceName);
+
+ CompositionPage.searchForElement(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
+ CanvasElement portMirroringConfigurationByPolicyElement = canvasManager.createElementOnCanvas(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
+
+ ConnectionWizardPopUpObject connectionWizardPopUpObjectVMME = new ConnectionWizardPopUpObject("",
+ "",
+ PortMirroringEnum.PM_REQ_TYPE.getValue(),
+ PortMirroringEnum.PMCP_SOURCE_CAP.getValue());
+
+ canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVmmeSource,
+ CircleSize.SERVICE,
+ portMirroringConfigurationByPolicyElement,
+ CircleSize.NORMATIVE,
+ connectionWizardPopUpObjectVMME);
+
+ serviceReqDetails.setVersion("0.1");
+ getExtendTest().log(Status.INFO, "Validating link between elements was created");
+ ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 1);
+
+ canvasManager.clickOnCanvaElement(serviceElementVmmeSource);
+ PortMirroringVerificator.validatingProxyServiceNameAndType(vmmeSourceName, "0");
+
+ getExtendTest().log(Status.INFO, "Adding properties to PMCP");
+
+ if(true){
+ throw new SkipException("Open bug 373762, can't update properties on CP or VFC instance on Composition screen");
+ }
+
+ canvasManager.clickOnCanvaElement(portMirroringConfigurationByPolicyElement);
+ CompositionPage.showPropertiesAndAttributesTab();
+ CompositionPage.setSingleProperty(DataTestIdEnum.PortMirroring.COLLECTOR_NODE.getValue(), PortMirroringUtils.createProxyInstanceServiceName(collectorServiceName, "1"));
+ CompositionPage.setSingleProperty(DataTestIdEnum.PortMirroring.EQUIP_MODEL.getValue(), PortMirroringEnum.CISCO_VENDOR_MODEL_NUMBER.getValue());
+ CompositionPage.setSingleProperty(DataTestIdEnum.PortMirroring.EQUIP_VENDOR.getValue(), PortMirroringEnum.CISCO_VENDOR_NAME.getValue());
+
+ // Distribute the Port Mirroning Configuration By Policy
+ getExtendTest().log(Status.INFO, String.format("Going to certify the Service"));
+ service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+ getExtendTest().log(Status.INFO, String.format("Service is certified"));
+ Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
+ getExtendTest().log(Status.INFO, String.format("Distribute and validate the Service"));
+ AssertJUnit.assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
+ }
+
+ @Test
+ public void deletePMCPLink() throws Throwable {
+ ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
+ getExtendTest().log(Status.INFO, String.format("Creating container service %s", serviceReqDetails.getName()));
+ Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
+
+ String filePath = FileHandling.getPortMirroringRepositoryPath();
+ ServiceContainer serviceContainerVmme_Source = PortMirroringUtils.createServiceFromHeatFile(filePath, "2016-227_vmme_vmme_30_1610_e2e.zip");
+
+ String vmmeSourceName = serviceContainerVmme_Source.getService().getName();
+
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(service.getName());
+
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+
+ CompositionPage.searchForElement(vmmeSourceName);
+ CanvasElement serviceElementVmmeSource = canvasManager.createElementOnCanvas(vmmeSourceName);
+
+ CompositionPage.searchForElement(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
+ CanvasElement portMirroringConfigurationByPolicyElement = canvasManager.createElementOnCanvas(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
+
+ ImmutablePair<Integer, Integer> linkLocation = canvasManager.calcMidOfLink(serviceElementVmmeSource.getLocation(), portMirroringConfigurationByPolicyElement.getLocation());
+
+ ConnectionWizardPopUpObject connectionWizardPopUpObjectVMME = new ConnectionWizardPopUpObject("",
+ "",
+ PortMirroringEnum.PM_REQ_TYPE.getValue(),
+ PortMirroringEnum.PMCP_SOURCE_CAP.getValue());
+
+ canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVmmeSource,
+ CircleSize.SERVICE,
+ portMirroringConfigurationByPolicyElement,
+ CircleSize.NORMATIVE,
+ connectionWizardPopUpObjectVMME);
+
+ CanvasElement linkBetweenPMCP_VMME = new CanvasElement("Link", linkLocation);
+
+ serviceReqDetails.setVersion("0.1");
+ getExtendTest().log(Status.INFO, "Validating link between elements was created");
+ ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 1);
+
+ canvasManager.openLinkPopupReqsCapsConnection(linkBetweenPMCP_VMME);
+ canvasManager.closeLinkPopupReqsCapsConnection();
+ canvasManager.deleteLinkPopupReqsCapsConnection(linkBetweenPMCP_VMME);
+
+ getExtendTest().log(Status.INFO, "Validating link deleted");
+ ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 0);
+ }
+
+ @Test
+ public void verifyPMCNotExistInVF() throws Exception {
+ Resource resource = PortMirroringUtils.getResourceByType(ResourceTypeEnum.VF, "VF", "VendorModel");
+
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+
+ GeneralUIUtils.findComponentAndClick(resource.getName());
+ ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
+
+ CompositionPage.searchForElement(PortMirroringEnum.PMC_ELEMENT_IN_PALLETE.getValue());
+
+ getExtendTest().log(Status.INFO, "Verify that Port Mirroring Configuration and Configuration by Policy doesn't exist for VF ");
+ boolean isPMCFound = GeneralUIUtils.isElementInvisibleByTestId(DataTestIdEnum.PortMirroring.PMC_NAME_IN_PALLETE.getValue());
+ boolean isPMCPFound = GeneralUIUtils.isElementInvisibleByTestId(DataTestIdEnum.PortMirroring.PMCP_NAME_IN_PALLETE.getValue());
+
+ assertTrue(isPMCFound);
+ assertTrue(isPMCPFound);
+ }
+
+ @Test
+ public void verifyPMCPTabs() throws Exception {
+
+ ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
+ getExtendTest().log(Status.INFO, String.format("Creating container service %s", serviceReqDetails.getName()));
+ Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
+
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(service.getName());
+
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+
+ CompositionPage.searchForElement(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
+ CanvasElement portMirroringConfigurationByPolicyElement = canvasManager.createElementOnCanvas(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
+ canvasManager.clickOnCanvaElement(portMirroringConfigurationByPolicyElement);
+
+ PortMirroringVerificator.validateGeneralInfo();
+ PortMirroringVerificator.validateReqsAndCapsTabExist();
+ }
+
+
+ @Test
+ public void editPMCPName() throws Exception {
+
ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
+ getExtendTest().log(Status.INFO, String.format("Creating container service %s", serviceReqDetails.getName()));
Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- getExtendTest().log(Status.INFO, String.format("Creating Service: %s v1.0", serviceReqDetails.getName()));
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
- getExtendTest().log(Status.INFO, String.format("Adding VF instance to Service"));
+
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(service.getName());
+
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+
+ CompositionPage.searchForElement(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
+ CanvasElement portMirroringConfigurationByPolicyElement = canvasManager.createElementOnCanvas(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
+
+ canvasManager.clickOnCanvaElement(portMirroringConfigurationByPolicyElement);
+
+ getExtendTest().log(Status.INFO, "Edit PMCP Name");
+ GeneralUIUtils.clickOnElementById(DataTestIdEnum.CompositionRightPanel.EDIT_PENCIL.getValue());
+ GeneralUIUtils.setTextInElementByDataTestID(DataTestIdEnum.CompositionRightPanel.INSTANCE_NAME_TEXTBOX.getValue(), PortMirroringEnum.PMCP_NEWNAME.getValue());
+ GeneralUIUtils.clickOnElementByTestId("OK");
+
+ PortMirroringVerificator.validateElementName(PortMirroringEnum.PMCP_NEWNAME.getValue());
+ }
+
+
+ @Test
+ public void deletePMCP() throws Exception {
+
+ ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
+ getExtendTest().log(Status.INFO, String.format("Creating container service %s", serviceReqDetails.getName()));
+ Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
+
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(service.getName());
+
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+
+ CompositionPage.searchForElement(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
+ CanvasElement portMirroringConfigurationByPolicyElement = canvasManager.createElementOnCanvas(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
+
+ canvasManager.clickOnCanvaElement(portMirroringConfigurationByPolicyElement);
+
+ getExtendTest().log(Status.INFO, String.format("Delete element %s", portMirroringConfigurationByPolicyElement.getElementType()));
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.CompositionRightPanel.DELETE_ITEM.getValue());
+ GeneralUIUtils.clickOnElementByTestId("OK");
+
+ PortMirroringVerificator.validateElementName(service.getName());
+ }
+
+ @Test
+ public void createPortMirroringConfigurationMulipleInstances() throws Throwable {
+ PortMirrioringConfigurationObject portMirrioringConfigurationObject = PortMirroringUtils.createPortMirriongConfigurationStructure();
+ ServiceReqDetails serviceReqDetails = portMirrioringConfigurationObject.getServiceReqDetails();
+ CanvasElement serviceElementVmmeSourceName = portMirrioringConfigurationObject.getServiceElementVmmeSourceName();
+
+ serviceReqDetails.setVersion("0.1");
+ getExtendTest().log(Status.INFO, "Validating 2 links between elements were created");
+ ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 2);
+
+ GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
+ GeneralUIUtils.ultimateWait();
+ GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
+
+ getExtendTest().log(Status.INFO, "Adding second PMC to composition");
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+ CompositionPage.searchForElement(PortMirroringEnum.PMC_ELEMENT_IN_PALLETE.getValue());
+ CanvasElement portMirroringConfigurationElement = canvasManager.createElementOnCanvas(PortMirroringEnum.PMC_ELEMENT_IN_PALLETE.getValue());
+
+ ConnectionWizardPopUpObject connectionWizardPopUpObjectVMME = new ConnectionWizardPopUpObject("", "",
+ PortMirroringEnum.PM_REQ_TYPE.getValue(), PortMirroringEnum.PMC1_SOURCE_CAP.getValue());
+
+ getExtendTest().log(Status.INFO, "Connect VMME to PMC again");
+ canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVmmeSourceName, CircleSize.SERVICE, portMirroringConfigurationElement,
+ CircleSize.NORMATIVE, connectionWizardPopUpObjectVMME);
+
+ getExtendTest().log(Status.INFO, "Connect VMME to PMC again");
+ canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVmmeSourceName, CircleSize.SERVICE, portMirroringConfigurationElement,
+ CircleSize.NORMATIVE, connectionWizardPopUpObjectVMME);
+
+ getExtendTest().log(Status.INFO, "Validating 4 links between elements exist");
+ ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 4);
+
+ getExtendTest().log(Status.INFO, "Adding second PMCP to composition");
+ CompositionPage.searchForElement(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
+ CanvasElement portMirroringConfigurationByPolicyElement = canvasManager.createElementOnCanvas(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
+
+ ConnectionWizardPopUpObject connectionWizardPopUpObjectVMME_PMCP = new ConnectionWizardPopUpObject("",
+ "",
+ PortMirroringEnum.PM_REQ_TYPE.getValue(),
+ PortMirroringEnum.PMCP_SOURCE_CAP.getValue());
+
+ getExtendTest().log(Status.INFO, "Connect VMME to PMCP again");
+ canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVmmeSourceName, CircleSize.SERVICE, portMirroringConfigurationByPolicyElement,
+ CircleSize.NORMATIVE, connectionWizardPopUpObjectVMME_PMCP);
+
+ getExtendTest().log(Status.INFO, "Connect VMME to PMCP again");
+ canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVmmeSourceName, CircleSize.SERVICE, portMirroringConfigurationByPolicyElement,
+ CircleSize.NORMATIVE, connectionWizardPopUpObjectVMME_PMCP);
+
+ serviceReqDetails.setVersion("0.1");
+ getExtendTest().log(Status.INFO, "Validating 6 links between elements exist");
+ ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 6);
+ }
+
+ @Test
+ public void downloadArtifactFromPMCService() throws Throwable {
+ //Scenario of bug 362271
+ PortMirrioringConfigurationObject portMirrioringConfigurationObject = PortMirroringUtils.createPortMirriongConfigurationStructure();
+ ServiceReqDetails serviceReqDetails = portMirrioringConfigurationObject.getServiceReqDetails();
+
+ GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
+ GeneralUIUtils.ultimateWait();
+ GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
+
+ ServiceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen();
+
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ToscaArtifactsScreenEnum.TOSCA_MODEL.getValue());
+ File latestFilefromDir = org.openecomp.sdc.ci.tests.utilities.FileHandling.getLastModifiedFileNameFromDir();
+ String actualToscaModelFilename = latestFilefromDir.getName();
+
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ToscaArtifactsScreenEnum.TOSCA_TEMPLATE.getValue());
+ latestFilefromDir = org.openecomp.sdc.ci.tests.utilities.FileHandling.getLastModifiedFileNameFromDir();
+ String actualToscaTemplateFilename = latestFilefromDir.getName();
+
+ String expectedToscaModelFilename = String.format("service-%s-csar.csar", serviceReqDetails.getName());
+ String expectedToscaTemplateFilename = String.format("service-%s-template.yml", serviceReqDetails.getName());
+
+ getExtendTest().log(Status.INFO, "Validating tosca artifact downloaded successfully");
+ AssertJUnit.assertTrue(actualToscaModelFilename.equalsIgnoreCase(expectedToscaModelFilename));
+ AssertJUnit.assertTrue(actualToscaTemplateFilename.equalsIgnoreCase(expectedToscaTemplateFilename));
+ }
+
+ @Test
+ public void checkoutMirroringConfigurationServiceProxyAndDeletePMC() throws Throwable {
+ PortMirrioringConfigurationObject portMirrioringConfigurationObject = PortMirroringUtils.createPortMirriongConfigurationStructure();
+ ServiceReqDetails serviceReqDetails = portMirrioringConfigurationObject.getServiceReqDetails();
+ Service service = portMirrioringConfigurationObject.getService();
+ CanvasElement portMirroringConfigurationElement = portMirrioringConfigurationObject.getPortMirroringConfigurationElement();
+
+ serviceReqDetails.setVersion("0.1");
+ getExtendTest().log(Status.INFO, "Validating links between elements were created");
+ ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 2);
+
+ getExtendTest().log(Status.INFO, String.format("Going to certify the Service"));
+ service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+ getExtendTest().log(Status.INFO, String.format("Checkout Port Mirroring Service"));
+ service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+
+ GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
+ GeneralUIUtils.ultimateWait();
+ HomeUtils.findComponentAndClickByVersion(service.getName(), "1.1");
+
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+ GeneralUIUtils.ultimateWait();
+ canvasManager.clickOnCanvasPosition(portMirroringConfigurationElement.getLocation().getLeft(), portMirroringConfigurationElement.getLocation().getRight());
+ getExtendTest().log(Status.INFO, String.format("Delete element %s", portMirroringConfigurationElement.getElementType()));
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.CompositionRightPanel.DELETE_ITEM.getValue());
+ GeneralUIUtils.clickOnElementByTestId("OK");
+
+ PortMirroringVerificator.validateElementName(service.getName());
+ getExtendTest().log(Status.INFO, "Validating 0 links after delete the port mirroring element");
+ serviceReqDetails.setVersion("1.1");
+ ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 0);
+
+ getExtendTest().log(Status.INFO, String.format("Going to certify the Service"));
+ service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+ getExtendTest().log(Status.INFO, String.format("Service is certified"));
+ Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
+ getExtendTest().log(Status.INFO, String.format("Distribute and validate the Service"));
+ AssertJUnit.assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
+ }
+
+ @Test
+ public void updatePortMirroringServiceInstance() throws Throwable {
+
+ PortMirrioringConfigurationObject portMirrioringConfigurationObject = PortMirroringUtils.createPortMirriongConfigurationStructure();
+ Service service = portMirrioringConfigurationObject.getService();
+ CanvasElement vmmeCanvasElement = portMirrioringConfigurationObject.getServiceElementVmmeSourceName();
+
+ getExtendTest().log(Status.INFO, String.format("Going to certify the Service"));
+ service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+ Service serviceContainerVmme_Source = portMirrioringConfigurationObject.getServiceContainerVmme_Source();
+ getExtendTest().log(Status.INFO, String.format("Checkout the vmme Service"));
+ serviceContainerVmme_Source = (Service) AtomicOperationUtils.changeComponentState(serviceContainerVmme_Source, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+ getExtendTest().log(Status.INFO, String.format("Going to certify the vmme Service"));
+ serviceContainerVmme_Source = (Service) AtomicOperationUtils.changeComponentState(serviceContainerVmme_Source, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+ getExtendTest().log(Status.INFO, String.format("Checkout Port Mirroring Service"));
+ service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+
+ GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
+ GeneralUIUtils.ultimateWait();
+ HomeUtils.findComponentAndClickByVersion(service.getName(), "1.1");
+
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+
+ getExtendTest().log(Status.INFO, String.format("Change vmme source %s instance to version 2.0", serviceContainerVmme_Source.getName()));
+ CompositionPage.changeComponentVersion(canvasManager, vmmeCanvasElement, "2.0",false);
+
+ getExtendTest().log(Status.INFO, String.format("Going to certify the Service"));
service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- getExtendTest().log(Status.INFO, String.format("Certify the Service"));
- return new ServiceContainer(service,resource,vendorSoftwareProductObject,amdocsLicenseMembers);
+ getExtendTest().log(Status.INFO, String.format("Service is certified"));
+ Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
+ getExtendTest().log(Status.INFO, String.format("Distribute and validate the Service"));
+ AssertJUnit.assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
}
+ @Test
+ public void updateLinkPropertiesPortMirroringService() throws Throwable {
+
+ ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
+ getExtendTest().log(Status.INFO, String.format("Creating container service %s", serviceReqDetails.getName()));
+ Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
+
+ String filePath = FileHandling.getPortMirroringRepositoryPath();
+ ServiceContainer serviceContainerVmme_Source = PortMirroringUtils.createServiceFromHeatFile(filePath, "2016-227_vmme_vmme_30_1610_e2e.zip");
+
+ String vmmeSourceName = serviceContainerVmme_Source.getService().getName();
+
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(service.getName());
+
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+
+ CompositionPage.searchForElement(vmmeSourceName);
+ CanvasElement serviceElementVmmeSource = canvasManager.createElementOnCanvas(vmmeSourceName);
+
+ CompositionPage.searchForElement(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
+ CanvasElement portMirroringConfigurationByPolicyElement = canvasManager.createElementOnCanvas(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
+
+ ImmutablePair<Integer, Integer> linkLocation = canvasManager.calcMidOfLink(serviceElementVmmeSource.getLocation(), portMirroringConfigurationByPolicyElement.getLocation());
+
+ ConnectionWizardPopUpObject connectionWizardPopUpObjectVMME = new ConnectionWizardPopUpObject("",
+ "",
+ PortMirroringEnum.PM_REQ_TYPE.getValue(),
+ PortMirroringEnum.PMCP_SOURCE_CAP.getValue());
+
+ canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVmmeSource,
+ CircleSize.SERVICE,
+ portMirroringConfigurationByPolicyElement,
+ CircleSize.NORMATIVE,
+ connectionWizardPopUpObjectVMME);
+
+ CanvasElement linkBetweenPMCP_VMME = new CanvasElement("Link", linkLocation);
+
+ serviceReqDetails.setVersion("0.1");
+ getExtendTest().log(Status.INFO, "Validating link between elements was created");
+ ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 1);
+
+ canvasManager.openLinkPopupReqsCapsConnection(linkBetweenPMCP_VMME);
+
+ getExtendTest().log(Status.INFO, "Fill link properties with data");
+ GeneralUIUtils.setTextInElementByXpath(PortMirroringEnum.NETWORK_ROLE_XPATH.getValue(),PortMirroringEnum.NETWORK_ROLE_VALUE.getValue());
+ GeneralUIUtils.setTextInElementByXpath(PortMirroringEnum.NFC_TYPE_XPATH.getValue(),PortMirroringEnum.NFC_TYPE_VALUE.getValue());
+ GeneralUIUtils.setTextInElementByXpath(PortMirroringEnum.PPS_CAPACITY_XPATH.getValue(),PortMirroringEnum.PPS_CAPACITY_VALUE.getValue());
+ GeneralUIUtils.setTextInElementByXpath(PortMirroringEnum.NF_TYPE_XPATH.getValue(),PortMirroringEnum.NF_TYPE_VALUE.getValue());
+ GeneralUIUtils.ultimateWait();
+
+ if(true){
+ throw new SkipException("Open bug 373765, Can't update link property on Port Mirroring connection");
+ }
+
+ canvasManager.clickSaveOnLinkPopup();
+ Thread.sleep(3000); //Temp solution. Don't remove.
+ canvasManager.openLinkPopupReqsCapsConnection(linkBetweenPMCP_VMME);
+
+ PortMirroringVerificator.validateLinkProperties();
+ }
+
+ @Test
+ public void restorePortMirroringServiceLink() throws Throwable {
+ //Scenario is taken from bug 361475 - Second Scenario
+ PortMirrioringConfigurationObject portMirrioringConfigurationObject = PortMirroringUtils.createPortMirriongConfigurationStructure();
+ ServiceReqDetails serviceReqDetails = portMirrioringConfigurationObject.getServiceReqDetails();
+ Service service = portMirrioringConfigurationObject.getService();
+ CanvasElement vmmeCanvasElement = portMirrioringConfigurationObject.getServiceElementVmmeSourceName();
+ Service serviceContainerVmme_Source = portMirrioringConfigurationObject.getServiceContainerVmme_Source();
+
+ getExtendTest().log(Status.INFO, String.format("Checkout the vmme Service"));
+ serviceContainerVmme_Source = (Service) AtomicOperationUtils.changeComponentState(serviceContainerVmme_Source, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+ getExtendTest().log(Status.INFO, String.format("Going to certify the vmme Service"));
+ serviceContainerVmme_Source = (Service) AtomicOperationUtils.changeComponentState(serviceContainerVmme_Source, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+ GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
+ GeneralUIUtils.ultimateWait();
+ HomeUtils.findComponentAndClick(service.getName());
+
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+
+ getExtendTest().log(Status.INFO, String.format("Changing vmme source %s instance to version 2.0", serviceContainerVmme_Source.getName()));
+ CompositionPage.changeComponentVersion(canvasManager, vmmeCanvasElement, "2.0",false);
+
+ getExtendTest().log(Status.INFO, "Validating 1 link exist after change version to the vmme service (Newer version)");
+ ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 2);
+
+ getExtendTest().log(Status.INFO, String.format("Changing vmme source %s instance to version 1.0", serviceContainerVmme_Source.getName()));
+ CompositionPage.changeComponentVersion(canvasManager, vmmeCanvasElement, "1.0",false);
+
+ ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 2);
+ }
+
+ @Test
+ public void restoreServiceVersionOnContainerService() throws Throwable {
+ //Scenario is taken from bug 361475 - First Scenario
+ PortMirrioringConfigurationObject portMirrioringConfigurationObject = PortMirroringUtils.createPortMirriongConfigurationStructure();
+ ServiceReqDetails serviceReqDetails = portMirrioringConfigurationObject.getServiceReqDetails();
+ Service service = portMirrioringConfigurationObject.getService();
+ CanvasElement vmmeCanvasElement = portMirrioringConfigurationObject.getServiceElementVmmeSourceName();
+ Service serviceContainerVmme_Source = portMirrioringConfigurationObject.getServiceContainerVmme_Source();
+ Service serviceContainerVprobe_Vprobe_Collector = portMirrioringConfigurationObject.getServiceContainerVprobe_Collector();
+ CanvasElement vprobeCanvasElement = portMirrioringConfigurationObject.getServiceElementVprobeCollector();
+
+
+ getExtendTest().log(Status.INFO, String.format("Checkout the vmme Service"));
+ serviceContainerVmme_Source = (Service) AtomicOperationUtils.changeComponentState(serviceContainerVmme_Source, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+ getExtendTest().log(Status.INFO, String.format("Going to certify the vmme Service"));
+ serviceContainerVmme_Source = (Service) AtomicOperationUtils.changeComponentState(serviceContainerVmme_Source, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+ GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
+ GeneralUIUtils.ultimateWait();
+ HomeUtils.findComponentAndClick(service.getName());
+
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+
+ canvasManager.linkElements(vmmeCanvasElement, CircleSize.SERVICE, vprobeCanvasElement, CircleSize.SERVICE);
+
+ getExtendTest().log(Status.INFO, String.format("Changing vmme source %s instance to version 2.0", serviceContainerVmme_Source.getName()));
+ CompositionPage.changeComponentVersion(canvasManager, vmmeCanvasElement, "2.0",false);
+
+ getExtendTest().log(Status.INFO, "Validating 1 link exist after change version to the vmme service (Newer version)");
+ ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 3);
+
+ getExtendTest().log(Status.INFO, String.format("Changing vmme source %s instance to version 1.0", serviceContainerVmme_Source.getName()));
+ CompositionPage.changeComponentVersion(canvasManager, vmmeCanvasElement, "1.0",false);
+
+ ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 3);
+ }
+
+ @Override
+ protected UserRoleEnum getRole() {
+ return UserRoleEnum.DESIGNER;
+ }
}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignment.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignment.java
index 4ccc7b024b..ae7d4770ba 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignment.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignment.java
@@ -20,7 +20,10 @@
package org.openecomp.sdc.ci.tests.execute.sanity;
+import static org.testng.Assert.assertTrue;
+
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
@@ -29,8 +32,10 @@ import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
import org.openecomp.sdc.ci.tests.pages.PropertiesAssignmentPage;
import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
import org.openecomp.sdc.ci.tests.utilities.FileHandling;
+import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.verificator.PropertiesAssignmentVerificator;
import org.testng.AssertJUnit;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
@@ -41,7 +46,9 @@ import com.aventstack.extentreports.Status;
public class PropertiesAssignment extends SetupCDTest {
- private String filePath;
+ private static String filePath;
+ private static String csarFile = "PCRF_OS_FIXED.csar";
+
@BeforeClass
public void beforeClass(){
filePath = FileHandling.getFilePath("");
@@ -60,13 +67,13 @@ public class PropertiesAssignment extends SetupCDTest {
// ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
// ResourceUIUtils.createResource(vfMetaData, getUser());
- String csarFile = "PCRF_OS_FIXED.csar";
+ String csarTestFile = csarFile;
String componentName = "abstract_pcm";
String propertyName = "min_instances";
ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarFile, getUser());
+ ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarTestFile, getUser());
ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
@@ -85,6 +92,36 @@ public class PropertiesAssignment extends SetupCDTest {
}
+
+
+ @Test
+ public void filterAllVfTest() throws Exception {
+// ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
+// ResourceUIUtils.createResource(vfMetaData, getUser());
+
+ String csarTestFile = csarFile;
+ String propertyName = "name";
+ String propertyLocation = DataTestIdEnum.PropertiesAssignmentScreen.PROPERTY_NAME_COLUMN.getValue();
+ int propertiesCountFilter = 22;
+ int propertiesCountWithoutFilter = 0;
+
+ ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
+ resourceMetaData.setVersion("0.1");
+ ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarTestFile, getUser());
+
+
+ ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
+ //Count current properties number before filter is applied
+ propertiesCountWithoutFilter = GeneralUIUtils.getWebElementsListByContainsClassName(propertyLocation).size();
+ PropertiesAssignmentPage.clickOnFilterButton();
+ PropertiesAssignmentPage.clickOnFilterAllCheckbox();
+ PropertiesAssignmentPage.findFilterBoxAndClick(propertyName);
+ PropertiesAssignmentPage.clickOnFilterApplyButton();
+ PropertiesAssignmentVerificator.validateFilteredPropertiesCount(propertiesCountFilter, propertyLocation);
+
+ PropertiesAssignmentPage.clickOnFilterClearAllButton();
+ PropertiesAssignmentVerificator.validateFilteredPropertiesCount(propertiesCountWithoutFilter, propertyLocation);
+ }
@Override
protected UserRoleEnum getRole() {
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Service.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Service.java
index d6370c10dc..71466f3211 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Service.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Service.java
@@ -20,45 +20,22 @@
package org.openecomp.sdc.ci.tests.execute.sanity;
-import static org.testng.AssertJUnit.assertTrue;
-
-import java.awt.AWTException;
-import java.util.Arrays;
-import java.util.List;
-
+import com.aventstack.extentreports.Status;
import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.GroupDefinition;
import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.datatypes.*;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.CompositionScreenEnum;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ServiceMetadataEnum;
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.*;
import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentPage;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.InputsPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.TesterOperationPage;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.CatalogUIUtilitis;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
+import org.openecomp.sdc.ci.tests.pages.*;
+import org.openecomp.sdc.ci.tests.utilities.*;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
@@ -68,11 +45,17 @@ import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.AssertJUnit;
+import org.testng.SkipException;
import org.testng.TestException;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-import com.aventstack.extentreports.Status;
+import java.awt.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import static org.testng.AssertJUnit.assertTrue;
public class Service extends SetupCDTest {
@@ -579,21 +562,35 @@ public class Service extends SetupCDTest {
}
@Test
- public void deploymentViewServiceTest() throws Exception{
- String fileName2 = "vSeGWNew.csar";
+ public void deploymentViewServiceTest() throws Exception{
+ User user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+ String fileName2 = "vSeGWNew.csar";
+
ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName2, getUser());
+ Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), "0.1");
+ List<GroupDefinition> groups = resource.getGroups();
+ for (GroupDefinition group : groups) {
+ if(group.getType().equals("org.openecomp.groups.VfModule")) {
+ for(PropertyDataDefinition property : group.getProperties()){
+ if(property.getName().equals("max_vf_module_instances")) {
+ property.setValue("100");
+ List<PropertyDataDefinition> propertyList = new ArrayList<>();
+ propertyList.add(property);
+ AtomicOperationUtils.updateGroupPropertyOnResource(propertyList, resource, group.getUniqueId(), user, true);
+ break;
+ }
+ }
+ }
+ }
+
ResourceGeneralPage.clickCheckinButton(resourceMetaData.getName());
-
ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
ServiceUIUtils.createService(serviceMetadata, getUser());
-
addResourceToServiceInCanvas(resourceMetaData);
-
GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
DeploymentArtifactPage.getLeftMenu().moveToDeploymentViewScreen();
-
serviceMetadata.setVersion("0.1");
List<WebElement> instanceRowsFromTable = GeneralUIUtils.getElementsByCSS("div[data-tests-id^='hierarchy-instance'] span[class^='expand-collapse-title-text']");
for(WebElement instanceRow: instanceRowsFromTable){
@@ -602,14 +599,14 @@ public class Service extends SetupCDTest {
for (WebElement instanceModule: instanceModulesList){
String instanceModuleText = instanceModule.getText();
ResourceUIUtils.clickOnElementByText(instanceModuleText, "instance");
-
ServiceVerificator.verifyDeploymentPageSubElements(instanceModuleText.split("\\.\\.")[2], new DeploymentViewVerificator(filePath + fileName2));
-
ServiceVerificator.verifyDisabledServiceProperties();
- String isBaseValue = ServiceVerificator.getVFModulePropertieValue(serviceMetadata, "isBase", instanceModuleText);
+ if(true){
+ throw new SkipException("Sent email to Edith Ronen, waiting for answer");
+ }
+ String isBaseValue = ServiceVerificator.getVFModulePropertyValue(serviceMetadata, "isBase", instanceModuleText);
if (isBaseValue.equals("false"))
ServiceVerificator.verifyEnabledServiceProperties();
-
ResourceUIUtils.clickOnElementByText(instanceModuleText, "instance");
}
}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ToscaValidationTest.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ToscaValidationTest.java
index d42df64a5a..14583607c7 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ToscaValidationTest.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ToscaValidationTest.java
@@ -1,34 +1,24 @@
package org.openecomp.sdc.ci.tests.execute.sanity;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-
+import com.aventstack.extentreports.Status;
+import com.clearspring.analytics.util.Pair;
+import fj.data.Either;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.ComponentInstanceInput;
-import org.openecomp.sdc.be.model.PropertyDefinition;
-import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.*;
import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
+import org.openecomp.sdc.ci.tests.dataProvider.OnbordingDataProviders;
+import org.openecomp.sdc.ci.tests.datatypes.*;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaInputsTopologyTemplateDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaTopologyTemplateDefinition;
+import org.openecomp.sdc.ci.tests.tosca.datatypes.*;
import org.openecomp.sdc.ci.tests.tosca.model.ToscaMetadataFieldsPresentationEnum;
import org.openecomp.sdc.ci.tests.utilities.DownloadManager;
import org.openecomp.sdc.ci.tests.utilities.FileHandling;
+import org.openecomp.sdc.ci.tests.utils.CsarParserUtils;
import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils;
import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
@@ -37,15 +27,14 @@ import org.openecomp.sdc.ci.tests.utils.rest.PropertyRestUtils;
import org.openecomp.sdc.ci.tests.verificator.ToscaValidation;
import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory;
+import org.openecomp.sdc.toscaparser.api.Group;
import org.openecomp.sdc.toscaparser.api.NodeTemplate;
import org.openecomp.sdc.toscaparser.api.elements.Metadata;
import org.testng.Assert;
import org.testng.annotations.Test;
-import com.aventstack.extentreports.Status;
-import com.clearspring.analytics.util.Pair;
-
-import fj.data.Either;
+import java.io.File;
+import java.util.*;
public class ToscaValidationTest extends SetupCDTest{
@@ -53,50 +42,11 @@ public class ToscaValidationTest extends SetupCDTest{
private static final String GENERIC_VF = "Generic_VF";
private static final String GENERIC_PNF = "Generic_PNF";
-// private ToscaDefinition toscaMainAmdocsDefinition, toscaMainVfDefinition, toscaMainServiceDefinition, toscaExpectedMainServiceDefinition;
- protected String vnfFile;
- protected String filepath;
-// protected File filesFolder = new File(SetupCDTest.getWindowTest().getDownloadDirectory());
protected SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance();
-// protected ISdcCsarHelper fdntCsarHelper;
-// protected ResourceReqDetails resourceReqDetails;
-// protected Resource resource;
-// protected ServiceReqDetails serviceReqDetails;
-// protected Service service;
-// protected ComponentInstance componentInstanceDefinition;
User user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-// File importToscaFilesFolder = new File("C:/Git_work/sdc/catalog-be/src/main/resources/import/tosca/");
-
-// File dataTypesLocation = new File(importToscaFilesFolder.getPath() + "/data-types/dataTypes.yml");
-// List<Boolean> status = new ArrayList<>();
-
-// File genericVfFileLocation = new File(importToscaFilesFolder.getPath() + "/heat-types/Generic_VF/Generic_VF.yml");
-// File genericVfcFileLocation = new File (importToscaFilesFolder.getPath() + "/heat-types/Generic_VFC/Generic_VFC.yml");
-// File genericPnfFileLocation = new File (importToscaFilesFolder.getPath() + "/heat-types/Generic_PNF/Generic_PNF.yml");
-// File genericServiceFileLocation = new File (importToscaFilesFolder.getPath() + "/heat-types/Generic_Service/Generic_Service.yml");
-
-// Map<String, DataTypeDefinition> parseDataTypesYaml = FileHandling.parseDataTypesYaml(dataTypesLocation.getAbsoluteFile().toString());
-
-// toscaMainAmdocsDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + amdocsCsarFileName));
-// toscaMainVfDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + VfCsarFileName));
-// toscaMainServiceDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + serviceCsarFileName));
-// ToscaTopologyTemplateDefinition topologyTemplate = toscaMainAmdocsDefinition.getTopology_template();
-// ToscaDefinition objectHelper = ToscaParserUtils.parseToscaYamlToJavaObject(genericVfFileLocation);
-
- public ToscaValidationTest(String filepath, String vnfFile) {
- this.filepath = filepath;
- this.vnfFile = vnfFile;
- }
-
- public ToscaValidationTest() {
- }
-
-
-
-// @BeforeClass
- @Test()
- public void toscaFileValidator() throws Exception{
+ @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "VNF_List")
+ public void toscaFileValidator(String filePath, String vnfFile) throws Exception, Throwable{
//--------------------------GENERAL--------------------------------
/*// for debugging only
setLog("Test");
@@ -104,40 +54,35 @@ public class ToscaValidationTest extends SetupCDTest{
toscaMainAmdocsDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(amdocsCsarFileName);
toscaMainVfDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File("C:\\Users\\al714h\\Downloads\\resource-Civfonboarded2016073VmxBv301072E2eE60f5c15-csar.csar"));
*/
+// vnfFile = "BE-HEAT.zip";
setLog(vnfFile);
List<Boolean> status = new ArrayList<>();
ISdcCsarHelper fdntCsarHelper;
File filesFolder = new File(SetupCDTest.getWindowTest().getDownloadDirectory());
-// filesFolder = new File(SetupCDTest.getWindowTest().getDownloadDirectory());
-//--------------------------AMDOCS--------------------------------
-// vnfFile = "HeatCandidate_2017-09-22_01-32_60Name_Vdbe-vsp-15.1x49-d50.3-v1.0-(VOIP).zip";
+//--------------------------AMDOCS--------------------------------
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, user);//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- resourceReqDetails = createCustomizedVsp(resourceReqDetails, filepath, vnfFile);
-
+ resourceReqDetails = createCustomizedVsp(resourceReqDetails, filePath, vnfFile);
ToscaDefinition toscaMainAmdocsDefinition = downloadAndGetToscaMainYamlObjectUI(resourceReqDetails, filesFolder);
//------adding generic inputs to expected object
toscaMainAmdocsDefinition = addGenericPropertiesToToscaDefinitionObject(toscaMainAmdocsDefinition, GENERIC_VF);
// copy object
ToscaDefinition toscaExpectedMainServiceDefinition = new ToscaDefinition(toscaMainAmdocsDefinition);
+// create list of modules from HEAT.meta file
+ File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir();
+ List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition = CsarParserUtils.getListTypeHeatMetaDefinition(latestFilefromDir);
+//TODO VfModuleVerificator.verifyGroupMetadata();
//TODO--------------------------AMDOCS DOWNLOAD VIA APIS--------------------------------
-
//--------------------------VF--------------------------------
// create VF base on VNF imported from previous step - have, resourceReqDetails object include part of resource metadata
Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
ToscaDefinition toscaMainVfDefinition = downloadAndGetToscaMainYamlObjectApi(resource, filesFolder);
-
-//--------------------------SERVICE--------------------------------
+//--------------------------SERVICE--------------------------------
ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();//getServiceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
-// serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(serviceReqDetails, user);
Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
-
Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
ComponentInstance componentInstanceDefinition = addComponentInstanceToComponentContainer.left().value();
-
//--------------------------getProperties set values and declare--------------------
-
Component componentObject = AtomicOperationUtils.getComponentObject(service, UserRoleEnum.DESIGNER);
Map<String, List<ComponentInstanceInput>> componentInstancesInputs = componentObject.getComponentInstancesInputs();
setValuesToPropertiesList(componentInstancesInputs, toscaExpectedMainServiceDefinition);
@@ -147,11 +92,70 @@ public class ToscaValidationTest extends SetupCDTest{
File ServiceCsarFileName = new File(File.separator + "ServiceCsar_" + ElementFactory.generateUUIDforSufix() + ".csar");
OnboardingUtillViaApis.downloadToscaCsarToDirectory(service, new File(filesFolder.getPath() + ServiceCsarFileName));
ToscaDefinition toscaMainServiceDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + ServiceCsarFileName));
+//--------------------------initialization of Tosca Parser--------------------------------
+ fdntCsarHelper = initSdcCsarHelper(ServiceCsarFileName, filesFolder);
+////---------------------------TESTS--------------------------------------------------
+ status = validateVfMetadata(toscaMainAmdocsDefinition, toscaMainVfDefinition, resourceReqDetails, resource, vnfFile, status);
+ status = validateResourceNodeTemplateMetadata(toscaMainVfDefinition, resource, vnfFile, status);
+ status = validateServiceMetadata(toscaMainServiceDefinition, serviceReqDetails, service, vnfFile, status);
+ status = validateServiceNodeTemplateMetadata(toscaMainServiceDefinition, componentInstanceDefinition, resourceReqDetails, resource, vnfFile, status);
+ status = validateServiceMetadataUsingParser(fdntCsarHelper, serviceReqDetails, service, vnfFile, status);
+ status = validateServiceNodeTemplateMetadataUsingParser(fdntCsarHelper, resourceReqDetails, resource, componentInstanceDefinition, vnfFile, status);
+ status = validateResourceInputs(toscaMainAmdocsDefinition, toscaMainVfDefinition, vnfFile, status);
+ status = validateServiceInputs(toscaExpectedMainServiceDefinition, toscaMainServiceDefinition, vnfFile, status);
+ status = validateServiceInputsUsingParser(fdntCsarHelper, toscaExpectedMainServiceDefinition, vnfFile, status);
+ Map<String, ToscaGroupsTopologyTemplateDefinition> expectedToscaServiceGroupsDefinitionObject = createExpectedToscaServiceGroupsDefinitionObject(resource, service, listTypeHeatMetaDefinition);
+ status = validateServiceModuleMetadata(expectedToscaServiceGroupsDefinitionObject, toscaMainServiceDefinition, vnfFile, status);
+ status = validateServiceModuleProperty(expectedToscaServiceGroupsDefinitionObject, toscaMainServiceDefinition, vnfFile, status);
+ status = validateServiceModuleMetadataUsingParser(fdntCsarHelper, expectedToscaServiceGroupsDefinitionObject, vnfFile, status);
+ status = validateServiceModulePropertyUsingParser(fdntCsarHelper, expectedToscaServiceGroupsDefinitionObject, vnfFile, status);
+ if(status.contains(false)){
+ SetupCDTest.getExtendTest().log(Status.FAIL, "Summary: tosca validation test failed with zip file " + vnfFile);
+ Assert.assertFalse(true);
+ }
+ }
+ @Test()
+ public void NetworkModel() throws Exception{
+//--------------------------GENERAL--------------------------------
+ String vnfFile = "networkModel";
+ setLog(vnfFile);
+ List<Boolean> status = new ArrayList<>();
+ ISdcCsarHelper fdntCsarHelper;
+ ToscaDefinition toscaMainAmdocsDefinition = new ToscaDefinition();
+ File filesFolder = new File(SetupCDTest.getWindowTest().getDownloadDirectory());
+// filesFolder = new File(SetupCDTest.getWindowTest().getDownloadDirectory());
+
+ ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.PNF, user);
+ toscaMainAmdocsDefinition = addGenericPropertiesToToscaDefinitionObject(toscaMainAmdocsDefinition, GENERIC_PNF);
+ ToscaDefinition toscaExpectedMainServiceDefinition = new ToscaDefinition(toscaMainAmdocsDefinition);
+//--------------------------VF--------------------------------
+ Resource resource = AtomicOperationUtils.createResourceByResourceDetails(resourceReqDetails,UserRoleEnum.DESIGNER,true).left().value();
+ resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+ ToscaDefinition toscaMainVfDefinition = downloadAndGetToscaMainYamlObjectApi(resource, filesFolder);
+
+//--------------------------SERVICE--------------------------------
+ ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
+ Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
+
+ Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
+ ComponentInstance componentInstanceDefinition = addComponentInstanceToComponentContainer.left().value();
+
+//--------------------------getProperties set values and declare--------------------
+
+ Component componentObject = AtomicOperationUtils.getComponentObject(service, UserRoleEnum.DESIGNER);
+ Map<String, List<ComponentInstanceInput>> componentInstancesInputs = componentObject.getComponentInstancesInputs();
+ setValuesToPropertiesList(componentInstancesInputs, toscaExpectedMainServiceDefinition);
+ PropertyRestUtils.declareProporties(componentObject, componentInstancesInputs, user);
+
+ service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+ File ServiceCsarFileName = new File(File.separator + "ServiceCsar_" + ElementFactory.generateUUIDforSufix() + ".csar");
+ OnboardingUtillViaApis.downloadToscaCsarToDirectory(service, new File(filesFolder.getPath() + ServiceCsarFileName));
+ ToscaDefinition toscaMainServiceDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + ServiceCsarFileName));
-
//--------------------------initialization of Tosca Parser--------------------------------
fdntCsarHelper = initSdcCsarHelper(ServiceCsarFileName, filesFolder);
@@ -167,20 +171,14 @@ public class ToscaValidationTest extends SetupCDTest{
status = validateResourceInputs(toscaMainAmdocsDefinition, toscaMainVfDefinition, vnfFile, status);
status = validateServiceInputs(toscaExpectedMainServiceDefinition, toscaMainServiceDefinition, vnfFile, status);
status = validateServiceInputsUsingParser(fdntCsarHelper, toscaExpectedMainServiceDefinition, vnfFile, status);
-
+
if(status.contains(false)){
SetupCDTest.getExtendTest().log(Status.FAIL, "Summary: tosca validation test failed with zip file " + vnfFile);
Assert.assertFalse(true);
}
}
-
-
-
-
-
-
- /**The method set values to toscaDefinition object service level only, to resource level should put instead of setDefault --> setValue
+ /**The method set values to toscaDefinition object service level only, to resource level should put instead of setDefault --> setValue
* inputs.get(componentInstanceInput.getName()).setValue(randomString);
* @param componentInstancesInputs
* @param toscaDefinition
@@ -225,7 +223,17 @@ public class ToscaValidationTest extends SetupCDTest{
componentInstanceInput.setValue(myListofStrings);
inputs.get(componentInstanceInput.getName()).setDefault(myListofStrings);
}
-
+ else if (type.equals("json") ){
+ String myJson = "{\"firstParam\":\"my First Param Value\",\"secondParam\":\"my Second Param Value\",\"numberParam\":666}";
+ componentInstanceInput.setValue(myJson);
+ inputs.get(componentInstanceInput.getName()).setDefault(myJson);
+ }
+ else if (type.equals("comma_delimited_list") ){
+ String commaDelimitedList = "[\"one\", \"two\"]";
+ componentInstanceInput.setValue(commaDelimitedList);
+ inputs.get(componentInstanceInput.getName()).setDefault(commaDelimitedList);
+ }
+
String expectedServiceInputName = expectedServiceInputPrefix + componentInstanceInput.getName();
ToscaInputsTopologyTemplateDefinition oldInput = inputs.get(componentInstanceInput.getName());
inputs.put(expectedServiceInputName, oldInput);
@@ -258,7 +266,6 @@ public class ToscaValidationTest extends SetupCDTest{
}
-
//--------------------------Metadata verification--------------------------------
//--------------------------Resource--------------------------------
@@ -331,8 +338,6 @@ public class ToscaValidationTest extends SetupCDTest{
return status;
}
-
-
//--------------------------Input verification--------------------------------
//--------------------------Resource--------------------------------
@@ -357,11 +362,29 @@ public class ToscaValidationTest extends SetupCDTest{
status.add(false);
return status;
}
-
+
+ public List<Boolean> validateServiceModuleMetadata(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedToscaServiceGroupsDefinitionObject, ToscaDefinition toscaMainServiceDefinition, String vnfFile, List<Boolean> status) {
+ reportStartTestPrint("validateServiceModuleMetadata", vnfFile);
+
+ Either<Boolean,Map<String, Object>> toscaServiceModuleMetadataValidator = ToscaValidation.serviceToscaGroupMetadataValidator(expectedToscaServiceGroupsDefinitionObject, toscaMainServiceDefinition);
+ if(toscaServiceModuleMetadataValidator.isRight())
+ status.add(false);
+ return status;
+ }
+
+ public List<Boolean> validateServiceModuleProperty(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedToscaServiceGroupsDefinitionObject, ToscaDefinition toscaMainServiceDefinition, String vnfFile, List<Boolean> status) {
+ reportStartTestPrint("validateServiceModuleProperty", vnfFile);
+
+ Either<Boolean,Map<String, Object>> toscaServiceModulePropertyValidator = ToscaValidation.serviceToscaGroupPropertyValidator(expectedToscaServiceGroupsDefinitionObject, toscaMainServiceDefinition);
+ if(toscaServiceModulePropertyValidator.isRight())
+ status.add(false);
+ return status;
+ }
+
//--------------------------Service verification against Pavel Parser--------------------------------
public List<Boolean> validateServiceInputsUsingParser(ISdcCsarHelper fdntCsarHelper, ToscaDefinition toscaExpectedMainServiceDefinition, String vnfFile, List<Boolean> status) throws Exception{
if(fdntCsarHelper == null){
- reportSkipTestPrint("validateServiceInputsUsingParser", status);
+ reportSkipTestPrint("validateServiceInputsUsingParser", status);
}else{
reportStartTestPrint("validateServiceInputsUsingParser", vnfFile);
Map<String, ToscaInputsTopologyTemplateDefinition> expectedInputsMap = toscaExpectedMainServiceDefinition.getTopology_template().getInputs();
@@ -371,24 +394,143 @@ public class ToscaValidationTest extends SetupCDTest{
}
return status;
}
-
- //--------------------------XXX verification--------------------------------
-
- //--------------------------Resource--------------------------------
-
-
- //--------------------------Service--------------------------------
-
-
- //--------------------------Service verification against Pavel Parser--------------------------------
-
-
-
-
-
-
-
-
+
+ public List<Boolean> validateServiceModuleMetadataUsingParser(ISdcCsarHelper fdntCsarHelper, Map<String, ToscaGroupsTopologyTemplateDefinition> expectedToscaServiceGroupsDefinitionObject, String vnfFile, List<Boolean> status) {
+ reportStartTestPrint("validateServiceModuleMetadataUsingParser", vnfFile);
+ String customizationUUID = fdntCsarHelper.getServiceNodeTemplates().get(0).getMetaData().getValue("customizationUUID");
+ List<Group> actualGroups = fdntCsarHelper.getVfModulesByVf(customizationUUID);
+ Either<Boolean,Map<String, Object>> toscaServiceModuleMetadataValidator = ToscaValidation.serviceToscaGroupMetadataValidatorUsingParser(expectedToscaServiceGroupsDefinitionObject, actualGroups);
+ if(toscaServiceModuleMetadataValidator.isRight())
+ status.add(false);
+ return status;
+ }
+
+ public List<Boolean> validateServiceModulePropertyUsingParser(ISdcCsarHelper fdntCsarHelper, Map<String, ToscaGroupsTopologyTemplateDefinition> expectedToscaServiceGroupsDefinitionObject, String vnfFile, List<Boolean> status) {
+ reportStartTestPrint("validateServiceModuleMetadataUsingParser", vnfFile);
+ String customizationUUID = fdntCsarHelper.getServiceNodeTemplates().get(0).getMetaData().getValue("customizationUUID");
+ List<Group> actualGroups = fdntCsarHelper.getVfModulesByVf(customizationUUID);
+ Either<Boolean,Map<String, Object>> toscaServiceModuleMetadataValidator = ToscaValidation.serviceToscaGroupPropertyValidatorUsingParser(expectedToscaServiceGroupsDefinitionObject, actualGroups);
+ if(toscaServiceModuleMetadataValidator.isRight())
+ status.add(false);
+ return status;
+ }
+
+ private Map<String, ToscaGroupsTopologyTemplateDefinition> createExpectedToscaServiceGroupsDefinitionObject(Resource resource, Service service, List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition) {
+ Map<String, ToscaGroupsTopologyTemplateDefinition> toscaGroupsTopologyTemplateDefinitionMap = new HashMap<>();
+
+ for (TypeHeatMetaDefinition moduleType : listTypeHeatMetaDefinition) {
+ if (!moduleType.getTypeName().equals("artifacts")) {
+ for(GroupHeatMetaDefinition module : moduleType.getGroupHeatMetaDefinition()){
+ ToscaGroupsTopologyTemplateDefinition toscaGroupsTopologyTemplateDefinition = new ToscaGroupsTopologyTemplateDefinition();
+ String resourceModuleName = buildResourceModuleName(resource, module.getGroupName());
+ ToscaServiceGroupsMetadataDefinition toscaServiceGroupsMetadataDefinition = setGroupMetadataFromResourceObject(resourceModuleName, resource);
+ if(!toscaServiceGroupsMetadataDefinition.equals("")){
+ String serviceModuleName = buildServiceModuleName(service.getComponentInstances().get(0).getNormalizedName(), toscaServiceGroupsMetadataDefinition.getVfModuleModelName());
+ toscaServiceGroupsMetadataDefinition = setGroupMetadataFromServiceObject(toscaServiceGroupsMetadataDefinition, serviceModuleName, service);
+ toscaGroupsTopologyTemplateDefinition.setMetadata(toscaServiceGroupsMetadataDefinition);
+ ToscaGroupPropertyDefinition toscaGroupPropertyDefinition = setGroupProperty(module);
+ toscaGroupsTopologyTemplateDefinition.setProperties(toscaGroupPropertyDefinition);
+ toscaGroupsTopologyTemplateDefinitionMap.put(serviceModuleName,toscaGroupsTopologyTemplateDefinition);
+
+ }else{
+ getExtendTest().log(Status.FAIL, "module name [" + module.getGroupName() + "] didn't represent in resource");
+ }
+ }
+ }
+ }
+ return toscaGroupsTopologyTemplateDefinitionMap;
+
+ }
+
+ private ToscaGroupPropertyDefinition setGroupProperty(GroupHeatMetaDefinition module) {
+ ToscaGroupPropertyDefinition toscaGroupPropertyDefinition = new ToscaGroupPropertyDefinition();
+ toscaGroupPropertyDefinition.setVf_module_label(module.getGroupName());
+ Boolean isBase = module.getPropertyHeatMetaDefinition().getValue();
+ if(isBase){
+ toscaGroupPropertyDefinition.setInitial_count("1");
+ toscaGroupPropertyDefinition.setMin_vf_module_instances("1");
+ toscaGroupPropertyDefinition.setMax_vf_module_instances("1");
+ toscaGroupPropertyDefinition.setVf_module_type("Base");
+ }else{
+ toscaGroupPropertyDefinition.setInitial_count("0");
+ toscaGroupPropertyDefinition.setMin_vf_module_instances("0");
+ toscaGroupPropertyDefinition.setMax_vf_module_instances(null);
+ toscaGroupPropertyDefinition.setVf_module_type("Expansion");
+ }
+ toscaGroupPropertyDefinition.setAvailability_zone_count(null);
+ toscaGroupPropertyDefinition.setVfc_list(null);
+ toscaGroupPropertyDefinition.setVf_module_description(null);
+ toscaGroupPropertyDefinition.setVolume_group(isVolumeGroup(module));
+
+ return toscaGroupPropertyDefinition;
+ }
+
+ private String isVolumeGroup(GroupHeatMetaDefinition module) {
+ String isVolumeGroup = "false";
+ for( HeatMetaFirstLevelDefinition artifactList : module.getArtifactList()){
+ if(artifactList.getType().equals(ArtifactTypeEnum.HEAT_VOL.getType())){
+ isVolumeGroup = "true";
+ return isVolumeGroup;
+ }
+ }
+ return isVolumeGroup;
+ }
+
+ private Map<String,ToscaServiceGroupsMetadataDefinition> createExpectedToscaServiceGroupsPropertyDefinitionObject(Resource resource, Service service, List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition) {
+
+ Map<String,ToscaServiceGroupsMetadataDefinition> toscaServiceGroupsMetadataDefinitionMap = new HashMap<>();
+ for (TypeHeatMetaDefinition moduleType : listTypeHeatMetaDefinition) {
+ Map<String, String> groupProperty = new HashMap<>();
+
+ ToscaServiceGroupsMetadataDefinition toscaServiceGroupsMetadataDefinition = new ToscaServiceGroupsMetadataDefinition();
+ for(GroupHeatMetaDefinition module : moduleType.getGroupHeatMetaDefinition()){
+ String resourceModuleName = buildResourceModuleName(resource, module.getGroupName());
+ toscaServiceGroupsMetadataDefinition = setGroupMetadataFromResourceObject(resourceModuleName, resource);
+ if(!toscaServiceGroupsMetadataDefinition.equals("")){
+ String serviceModuleName = buildServiceModuleName(service.getComponentInstances().get(0).getNormalizedName(), toscaServiceGroupsMetadataDefinition.getVfModuleModelName());
+ toscaServiceGroupsMetadataDefinition = setGroupMetadataFromServiceObject(toscaServiceGroupsMetadataDefinition, serviceModuleName, service);
+ toscaServiceGroupsMetadataDefinitionMap.put(serviceModuleName, toscaServiceGroupsMetadataDefinition);
+ }else{
+ getExtendTest().log(Status.FAIL, "module name [" + module.getGroupName() + "] didn't represent in resource");
+ }
+ }
+ }
+ return toscaServiceGroupsMetadataDefinitionMap;
+
+ }
+
+ private ToscaServiceGroupsMetadataDefinition setGroupMetadataFromServiceObject(ToscaServiceGroupsMetadataDefinition toscaServiceGroupsMetadataDefinition, String serviceModuleName, Service service) {
+ for (GroupInstance groupInstance : service.getComponentInstances().get(0).getGroupInstances()) {
+ if (groupInstance.getName().equals(serviceModuleName)) {
+ toscaServiceGroupsMetadataDefinition.setVfModuleModelCustomizationUUID(groupInstance.getCustomizationUUID());
+ return toscaServiceGroupsMetadataDefinition;
+ }
+ }
+ return toscaServiceGroupsMetadataDefinition;
+ }
+
+ private ToscaServiceGroupsMetadataDefinition setGroupMetadataFromResourceObject(String resourceModuleName, Resource resource) {
+ ToscaServiceGroupsMetadataDefinition toscaServiceGroupsMetadataDefinition = new ToscaServiceGroupsMetadataDefinition();
+ for (GroupDefinition group : resource.getGroups()) {
+ if (group.getName().contains(resourceModuleName)) {
+ toscaServiceGroupsMetadataDefinition.setVfModuleModelName(group.getName());
+ toscaServiceGroupsMetadataDefinition.setVfModuleModelInvariantUUID(group.getInvariantUUID());
+ toscaServiceGroupsMetadataDefinition.setVfModuleModelUUID(group.getGroupUUID());
+ toscaServiceGroupsMetadataDefinition.setVfModuleModelVersion(group.getVersion());
+ return toscaServiceGroupsMetadataDefinition;
+ }
+ }
+ return toscaServiceGroupsMetadataDefinition;
+ }
+
+ public static String buildResourceModuleName(Resource resource, String groupName ){
+ return resource.getSystemName()+".."+groupName+".."+"module-";
+ }
+ public static String buildServiceModuleName(String resourceInstanceNormalizedName, String resourceGroupName ){
+ return resourceInstanceNormalizedName+".."+resourceGroupName;
+ }
+
+
@Override
protected UserRoleEnum getRole() {
return UserRoleEnum.DESIGNER;
@@ -427,8 +569,6 @@ public class ToscaValidationTest extends SetupCDTest{
return toscaDefinition;
}
-
-
public static ToscaDefinition addAndGenerateResourceMetadataToExpectedObject(ToscaDefinition toscaDefinition, ResourceReqDetails resourceReqDetails, Component component) {
Map<String, String> metadata = convertResourceMetadataToMap(resourceReqDetails, component);
@@ -436,7 +576,6 @@ public class ToscaValidationTest extends SetupCDTest{
return toscaDefinition;
}
-
public static Map<String, String> convertResourceMetadataToMap(ResourceReqDetails resourceReqDetails, Component component) {
Map<String, String> metadata = new HashMap<>();
@@ -474,8 +613,8 @@ public class ToscaValidationTest extends SetupCDTest{
metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.VERSION.value, componentInstance.getComponentVersion());
return metadata;
-
}
+
public static Map<String, String> generateServiceNodeTemplateMetadataToExpectedObject(ResourceReqDetails resourceReqDetails, Component component, ComponentInstance componentInstanceDefinition) {
Map<String, String> metadata = convertResourceMetadataToMap(resourceReqDetails, component);
@@ -580,71 +719,11 @@ public class ToscaValidationTest extends SetupCDTest{
SetupCDTest.getExtendTest().log(Status.FAIL, "Summary: allottedResourceModelTest tosca validation test failed with zip file " + vnfFile);
Assert.assertFalse(true);
}
- }
-
-
-
- @Test()
- public void NetworkModel() throws Exception{
-//--------------------------GENERAL--------------------------------
- String vnfFile = "networkModel";
- setLog(vnfFile);
- List<Boolean> status = new ArrayList<>();
- ISdcCsarHelper fdntCsarHelper;
- ToscaDefinition toscaMainAmdocsDefinition = new ToscaDefinition();
- File filesFolder = new File(SetupCDTest.getWindowTest().getDownloadDirectory());
-// filesFolder = new File(SetupCDTest.getWindowTest().getDownloadDirectory());
-
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.PNF, user);
- toscaMainAmdocsDefinition = addGenericPropertiesToToscaDefinitionObject(toscaMainAmdocsDefinition, GENERIC_PNF);
- ToscaDefinition toscaExpectedMainServiceDefinition = new ToscaDefinition(toscaMainAmdocsDefinition);
-//--------------------------VF--------------------------------
- Resource resource = AtomicOperationUtils.createResourceByResourceDetails(resourceReqDetails,UserRoleEnum.DESIGNER,true).left().value();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- ToscaDefinition toscaMainVfDefinition = downloadAndGetToscaMainYamlObjectApi(resource, filesFolder);
-
-//--------------------------SERVICE--------------------------------
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
-
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstanceDefinition = addComponentInstanceToComponentContainer.left().value();
-
-//--------------------------getProperties set values and declare--------------------
-
- Component componentObject = AtomicOperationUtils.getComponentObject(service, UserRoleEnum.DESIGNER);
- Map<String, List<ComponentInstanceInput>> componentInstancesInputs = componentObject.getComponentInstancesInputs();
- setValuesToPropertiesList(componentInstancesInputs, toscaExpectedMainServiceDefinition);
- PropertyRestUtils.declareProporties(componentObject, componentInstancesInputs, user);
-
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- File ServiceCsarFileName = new File(File.separator + "ServiceCsar_" + ElementFactory.generateUUIDforSufix() + ".csar");
- OnboardingUtillViaApis.downloadToscaCsarToDirectory(service, new File(filesFolder.getPath() + ServiceCsarFileName));
- ToscaDefinition toscaMainServiceDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + ServiceCsarFileName));
+ }*/
-//--------------------------initialization of Tosca Parser--------------------------------
- fdntCsarHelper = initSdcCsarHelper(ServiceCsarFileName, filesFolder);
-//---------------------------TESTS--------------------------------------------------
- status = validateVfMetadata(toscaMainAmdocsDefinition, toscaMainVfDefinition, resourceReqDetails, resource, vnfFile, status);
- status = validateResourceNodeTemplateMetadata(toscaMainVfDefinition, resource, vnfFile, status);
- status = validateServiceMetadata(toscaMainServiceDefinition, serviceReqDetails, service, vnfFile, status);
- status = validateServiceNodeTemplateMetadata(toscaMainServiceDefinition, componentInstanceDefinition, resourceReqDetails, resource, vnfFile, status);
- status = validateServiceMetadataUsingParser(fdntCsarHelper, serviceReqDetails, service, vnfFile, status);
- status = validateServiceNodeTemplateMetadataUsingParser(fdntCsarHelper, resourceReqDetails, resource, componentInstanceDefinition, vnfFile, status);
- status = validateResourceInputs(toscaMainAmdocsDefinition, toscaMainVfDefinition, vnfFile, status);
- status = validateServiceInputs(toscaExpectedMainServiceDefinition, toscaMainServiceDefinition, vnfFile, status);
- status = validateServiceInputsUsingParser(fdntCsarHelper, toscaExpectedMainServiceDefinition, vnfFile, status);
-
- if(status.contains(false)){
- SetupCDTest.getExtendTest().log(Status.FAIL, "Summary: tosca validation test failed with zip file " + vnfFile);
- Assert.assertFalse(true);
- }
- }*/
-
// help method to toscaValidation tests
private ISdcCsarHelper initSdcCsarHelper(File serviceCsarFileName, File filesFolder) {
@@ -704,11 +783,6 @@ public class ToscaValidationTest extends SetupCDTest{
return ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + VfCsarFileName));
}
- /*public static void main(String[] args) {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- List<CategoryDefinition> categories = resourceReqDetails.getCategories();
- System.out.println(categories);
- }*/
}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VFCArtifacts.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VFCArtifacts.java
index b79393a0c9..20cd8886fd 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VFCArtifacts.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VFCArtifacts.java
@@ -20,18 +20,13 @@
package org.openecomp.sdc.ci.tests.execute.sanity;
-import static org.testng.Assert.assertTrue;
-
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
+import com.aventstack.extentreports.Status;
+import com.clearspring.analytics.util.Pair;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
@@ -43,20 +38,21 @@ import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
import org.openecomp.sdc.ci.tests.pages.HomePage;
import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
import org.openecomp.sdc.ci.tests.pages.TesterOperationPage;
-import org.openecomp.sdc.ci.tests.utilities.DownloadManager;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.RestCDUtils;
+import org.openecomp.sdc.ci.tests.utilities.*;
import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
import org.openecomp.sdc.ci.tests.verificator.VFCArtifactVerificator;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-import com.aventstack.extentreports.Status;
-import com.clearspring.analytics.util.Pair;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import static org.testng.Assert.assertTrue;
+import org.openecomp.sdc.ci.tests.utils.general.VendorLicenseModelRestUtils;
+import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
public class VFCArtifacts extends SetupCDTest {
@@ -215,17 +211,17 @@ public class VFCArtifacts extends SetupCDTest {
ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- String vnfFile = "vProbes_FE.zip";
+ String vnfFile = "2016-043_vsaegw_fdnt_30_1607_e2e.zip";
String snmpFile = "Fault-alarms-ASDC-vprobes-vLB.zip";
- AmdocsLicenseMembers amdocsLicenseMembers = OnboardingUiUtils.createVendorLicense(getUser());
- Pair<String, Map<String, String>> createVSP = OnboardingUtils.createVSP(resourceMetaData, vnfFile, filePath, getUser(), amdocsLicenseMembers);
+ AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+ Pair<String, VendorSoftwareProductObject> createVSP = VendorSoftwareProductRestUtils.createVSP(resourceMetaData, vnfFile, filePath, getUser(), amdocsLicenseMembers);
String vspName = createVSP.left;
resourceMetaData.setName(vspName);
- Map<String, String> resourceMeta = createVSP.right;
- String vspid = resourceMeta.get("vspId");
- OnboardingUtils.addVFCArtifacts(filePath, snmpFile, null, vspid, getUser());
- OnboardingUtils.prepareVspForUse(getUser(), vspid, "0.1");
+ VendorSoftwareProductObject resourceMeta = createVSP.right;
+ String vspid = resourceMeta.getVspId();
+ VendorSoftwareProductRestUtils.addVFCArtifacts(filePath, snmpFile, null, resourceMeta, getUser());
+ VendorSoftwareProductRestUtils.prepareVspForUse(getUser(), resourceMeta, true);
String downloadDirectory = getWindowTest().getDownloadDirectory();
String csarFile = vspid + ".csar";
@@ -248,18 +244,18 @@ public class VFCArtifacts extends SetupCDTest {
//check of version is 1
ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- String vnfFile = "vProbes_FE.zip";
+ String vnfFile = "2016-043_vsaegw_fdnt_30_1607_e2e.zip";
String snmpPollFile = "vprobes-vLB.zip";
String updatedSnmpPollFile = "vprobes-vLBAgent.zip";
- AmdocsLicenseMembers amdocsLicenseMembers = OnboardingUiUtils.createVendorLicense(getUser());
- Pair<String, Map<String, String>> createVSP = OnboardingUtils.createVSP(resourceMetaData, vnfFile, filePath, getUser(), amdocsLicenseMembers);
+ AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+ Pair<String, VendorSoftwareProductObject> createVSP = VendorSoftwareProductRestUtils.createVSP(resourceMetaData, vnfFile, filePath, getUser(), amdocsLicenseMembers);
String vspName = createVSP.left;
resourceMetaData.setName(vspName);
- Map<String, String> resourceMeta = createVSP.right;
- String vspid = resourceMeta.get("vspId");
- String montoringComponentId = OnboardingUtils.addVFCArtifacts(filePath, snmpPollFile, null, vspid, getUser());
- OnboardingUiUtils.prepareVspForUse(getUser(), vspid, "0.1");
+ VendorSoftwareProductObject resourceMeta = createVSP.right;
+ String vspid = resourceMeta.getVspId();
+ String montoringComponentId = VendorSoftwareProductRestUtils.addVFCArtifacts(filePath, snmpPollFile, null, resourceMeta, getUser());
+ VendorSoftwareProductRestUtils.prepareVspForUse(getUser(), resourceMeta, true);
String downloadDirectory = getWindowTest().getDownloadDirectory();
String csarFile = vspid + ".csar";
@@ -275,7 +271,7 @@ public class VFCArtifacts extends SetupCDTest {
TesterOperationPage.certifyComponent(vspName);
reloginWithNewRole(UserRoleEnum.DESIGNER);
- OnboardingUtils.updateVspWithVfcArtifacts(filePath, vspid, updatedSnmpPollFile, null, montoringComponentId, getUser(), "0.1");
+ VendorSoftwareProductRestUtils.updateVspWithVfcArtifacts(filePath, updatedSnmpPollFile, null, montoringComponentId, getUser(), resourceMeta);
DownloadManager.downloadCsarByNameFromVSPRepository(vspName, vspid);
HomePage.showVspRepository();
OnboardingUiUtils.updateVSP(createVSP);
@@ -294,18 +290,18 @@ public class VFCArtifacts extends SetupCDTest {
//check of version is 2
ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- String vnfFile = "vProbes_FE.zip";
+ String vnfFile = "2016-043_vsaegw_fdnt_30_1607_e2e.zip";
String snmpFile = "vprobes-vLB.zip";
String updatedSnmpFile = "vprobes-vLB-Modified.zip";
- AmdocsLicenseMembers amdocsLicenseMembers = OnboardingUiUtils.createVendorLicense(getUser());
- Pair<String, Map<String, String>> createVSP = OnboardingUtils.createVSP(resourceMetaData, vnfFile, filePath, getUser(), amdocsLicenseMembers);
+ AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
+ Pair<String, VendorSoftwareProductObject> createVSP = VendorSoftwareProductRestUtils.createVSP(resourceMetaData, vnfFile, filePath, getUser(), amdocsLicenseMembers);
String vspName = createVSP.left;
resourceMetaData.setName(vspName);
- Map<String, String> resourceMeta = createVSP.right;
- String vspid = resourceMeta.get("vspId");
- String monitoringId = OnboardingUtils.addVFCArtifacts(filePath, snmpFile, null, vspid, getUser());
- OnboardingUiUtils.prepareVspForUse(getUser(), vspid, "0.1");
+ VendorSoftwareProductObject resourceMeta = createVSP.right;
+ String vspid = resourceMeta.getVspId();
+ String monitoringId = VendorSoftwareProductRestUtils.addVFCArtifacts(filePath, snmpFile, null, resourceMeta, getUser());
+ VendorSoftwareProductRestUtils.prepareVspForUse(getUser(), resourceMeta, true);
String downloadDirectory = getWindowTest().getDownloadDirectory();
String csarFile = vspid + ".csar";
@@ -328,7 +324,7 @@ public class VFCArtifacts extends SetupCDTest {
TesterOperationPage.certifyComponent(vspName);
reloginWithNewRole(UserRoleEnum.DESIGNER);
- OnboardingUtils.updateVspWithVfcArtifacts(filePath, vspid, updatedSnmpFile, null, monitoringId, getUser(), "0.1");
+ VendorSoftwareProductRestUtils.updateVspWithVfcArtifacts(filePath, updatedSnmpFile, null, monitoringId, getUser(), resourceMeta);
DownloadManager.downloadCsarByNameFromVSPRepository(vspName, vspid);
HomePage.showVspRepository();
OnboardingUiUtils.updateVSP(createVSP);
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java
index fe2187f338..dbe0a971c6 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java
@@ -32,16 +32,11 @@ import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
import org.openecomp.sdc.be.model.LifecycleStateEnum;
import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
+import org.openecomp.sdc.ci.tests.datatypes.*;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.InformationalArtifactsPlaceholders;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.LeftPanelCanvasItems;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ResourceMetadataEnum;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ToscaArtifactsScreenEnum;
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
import org.openecomp.sdc.ci.tests.datatypes.enums.PropertyTypeEnum;
@@ -60,13 +55,8 @@ import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
import org.openecomp.sdc.ci.tests.pages.TesterOperationPage;
import org.openecomp.sdc.ci.tests.pages.ToscaArtifactsPage;
import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
+import org.openecomp.sdc.ci.tests.utilities.*;
import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openecomp.sdc.ci.tests.utilities.PropertiesUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.RestCDUtils;
import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils;
import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
@@ -79,6 +69,7 @@ import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.AssertJUnit;
+import org.testng.SkipException;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -225,6 +216,10 @@ public class Vf extends SetupCDTest {
@Test
public void addPropertiesToVfcInstanceInVfTest() throws Exception {
+ if(true){
+ throw new SkipException("Open bug 373762, can't update properties on CP or VFC instance on Composition screen");
+ }
+
String fileName = "vFW_VFC.yml";
ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
@@ -648,7 +643,7 @@ public class Vf extends SetupCDTest {
public void exportToscaWithModulePropertiesVFTest() throws AWTException, Exception {
String vnfFile = "1-Vf-zrdm5bpxmc02-092017-(MOBILITY)_v2.0.zip";
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Pair<String, Map<String, String>> vsp= OnboardingUiUtils.onboardAndValidate(resourceReqDetails, FileHandling.getVnfRepositoryPath(), vnfFile, getUser());
+ Pair<String, VendorSoftwareProductObject> vsp= OnboardingUiUtils.onboardAndValidate(resourceReqDetails, FileHandling.getVnfRepositoryPath(), vnfFile, getUser());
String vspName = vsp.left;
ResourceGeneralPage.clickSubmitForTestingButton(vsp.left);
Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, vspName, "0.1");
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfAPI.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfAPI.java
new file mode 100644
index 0000000000..e0eaf74de6
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfAPI.java
@@ -0,0 +1,738 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.sanity;
+
+import java.awt.AWTException;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.ci.tests.datatypes.*;
+import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.InformationalArtifactsPlaceholders;
+import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.LeftPanelCanvasItems;
+import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ResourceMetadataEnum;
+import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ToscaArtifactsScreenEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.PropertyTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.execute.setup.AttFtpClient;
+import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
+import org.openecomp.sdc.ci.tests.pages.CompositionPage;
+import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
+import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
+import org.openecomp.sdc.ci.tests.pages.InformationalArtifactPage;
+import org.openecomp.sdc.ci.tests.pages.InputsPage;
+import org.openecomp.sdc.ci.tests.pages.PropertiesPage;
+import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
+import org.openecomp.sdc.ci.tests.pages.TesterOperationPage;
+import org.openecomp.sdc.ci.tests.pages.ToscaArtifactsPage;
+import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
+import org.openecomp.sdc.ci.tests.utilities.*;
+import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.ci.tests.verificator.ServiceVerificator;
+import org.openecomp.sdc.ci.tests.verificator.VfModuleVerificator;
+import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.aventstack.extentreports.Status;
+import com.clearspring.analytics.util.Pair;
+
+
+public class VfAPI extends SetupCDTest {
+
+ private String filePath;
+ @BeforeClass
+ public void beforeClass(){
+ filePath = FileHandling.getFilePath("");
+ }
+
+ @BeforeMethod
+ public void beforeTest(){
+ System.out.println("File repository is : " + filePath);
+ getExtendTest().log(Status.INFO, "File repository is : " + filePath);
+ }
+
+ private ResourceReqDetails createVFviaAPI() {
+ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating VF %s", vfMetaData.getName()));
+ AtomicOperationUtils.createResourceByResourceDetails(vfMetaData, UserRoleEnum.DESIGNER, true).left().value();
+ return vfMetaData;
+ }
+
+
+ @Test
+ public void updateVF() throws Exception {
+
+ // create Resource
+ ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
+ ResourceUIUtils.createVF(resourceMetaData, getUser());
+
+ // update Resource
+ ResourceReqDetails updatedResource = new ResourceReqDetails();
+ updatedResource.setName(ElementFactory.getResourcePrefix() + "UpdatedName" + resourceMetaData.getName());
+ updatedResource.setDescription("kuku");
+ updatedResource.setVendorName("updatedVendor");
+ updatedResource.setVendorRelease("updatedRelease");
+ updatedResource.setContactId("ab0001");
+ updatedResource.setCategories(resourceMetaData.getCategories());
+ updatedResource.setVersion("0.1");
+ updatedResource.setResourceType(ResourceTypeEnum.VF.getValue());
+ List<String> newTags = resourceMetaData.getTags();
+ newTags.remove(resourceMetaData.getName());
+ newTags.add(updatedResource.getName());
+ updatedResource.setTags(newTags);
+ ResourceUIUtils.updateResource(updatedResource, getUser());
+
+ VfVerificator.verifyVFMetadataInUI(updatedResource);
+ VfVerificator.verifyVFUpdated(updatedResource, getUser());
+ }
+
+
+
+ @Test
+ public void vfcLinkedToComputeInVfFlowApi() throws Exception {
+ String fileName = "vFW_VFC2.yml";
+ ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
+
+ try{
+ //Create VFC via API
+ Resource vfc = AtomicOperationUtils.importResource(filePath, fileName).left().value();
+ atomicResourceMetaData.setName(vfc.getName());
+
+ //Certify VFC via API
+ vfc = (Resource) AtomicOperationUtils.changeComponentState(vfc, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+ //Create VF via API
+ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
+ AtomicOperationUtils.createResourceByResourceDetails(vfMetaData, UserRoleEnum.DESIGNER, true).left().value();
+
+ //Go to Catalog and find the created VF
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+
+ //Composition - drag the created VFC and another element, link between them
+ DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+ CompositionPage.searchForElement(String.format("%s %s", LeftPanelCanvasItems.COMPUTE.getValue() , "1.0"));
+ CanvasElement computeElement = canvasManager.createElementOnCanvas(LeftPanelCanvasItems.COMPUTE);
+ CompositionPage.searchForElement(atomicResourceMetaData.getName());
+ CanvasElement cpElement = canvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
+ AssertJUnit.assertNotNull(cpElement);
+ ServiceVerificator.verifyNumOfComponentInstances(vfMetaData, "0.1", 2, getUser());
+ canvasManager.linkElements(cpElement, computeElement);
+
+ vfMetaData.setVersion("0.1");
+ VfVerificator.verifyLinkCreated(vfMetaData, getUser(), 1);
+ }
+ finally{
+ ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "1.0");
+ }
+
+ }
+
+
+ @Test
+ public void addUpdateDeleteDeploymentArtifactToVfTestApi() throws Exception {
+ //Create VF via API
+ ResourceReqDetails vfMetaData = createVFviaAPI();
+
+ //Go to Catalog and find the created VF
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+
+ ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
+
+ List<ArtifactInfo> deploymentArtifactList = new ArrayList<ArtifactInfo>();
+ deploymentArtifactList.add(new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER"));
+ deploymentArtifactList.add(new ArtifactInfo(filePath, "sample-xml-alldata-1-1.xml", "cuku", "artifact2", "YANG_XML"));
+ for (ArtifactInfo deploymentArtifact : deploymentArtifactList) {
+ DeploymentArtifactPage.clickAddNewArtifact();
+ ArtifactUIUtils.fillAndAddNewArtifactParameters(deploymentArtifact);
+ }
+ AssertJUnit.assertTrue("artifact table does not contain artifacts uploaded", DeploymentArtifactPage.checkElementsCountInTable(deploymentArtifactList.size()));
+
+ String newDescription = "new description";
+ DeploymentArtifactPage.clickEditArtifact(deploymentArtifactList.get(0).getArtifactLabel());
+ DeploymentArtifactPage.artifactPopup().insertDescription(newDescription);
+ DeploymentArtifactPage.artifactPopup().clickDoneButton();
+ String actualArtifactDescription = DeploymentArtifactPage.getArtifactDescription(deploymentArtifactList.get(0).getArtifactLabel());
+ AssertJUnit.assertTrue("artifact description is not updated", newDescription.equals(actualArtifactDescription));
+
+ DeploymentArtifactPage.clickDeleteArtifact(deploymentArtifactList.get(0).getArtifactLabel());
+ DeploymentArtifactPage.clickOK();
+ AssertJUnit.assertTrue("artifact "+ deploymentArtifactList.get(0).getArtifactLabel() + "is not deleted", DeploymentArtifactPage.checkElementsCountInTable(deploymentArtifactList.size() - 1));
+
+ AssertJUnit.assertTrue("artifact "+ deploymentArtifactList.get(1).getArtifactLabel() + "is not displayed", DeploymentArtifactPage.clickOnArtifactDescription(deploymentArtifactList.get(1).getArtifactLabel()).isDisplayed());
+ }
+
+
+ @Test
+ public void addUpdateDeleteInformationalArtifactApi() throws Exception {
+ //Create VF via API
+ ResourceReqDetails vfMetaData = createVFviaAPI();
+
+ //Go to Catalog and find the created VF
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+
+ ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
+
+ ArtifactInfo informationalArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER");
+ InformationalArtifactPage.clickAddNewArtifact();
+ ArtifactUIUtils.fillAndAddNewArtifactParameters(informationalArtifact);
+
+ AssertJUnit.assertTrue("artifact table does not contain artifacts uploaded", InformationalArtifactPage.checkElementsCountInTable(1));
+
+ String newDescription = "new description";
+ InformationalArtifactPage.clickEditArtifact(informationalArtifact.getArtifactLabel());
+ InformationalArtifactPage.artifactPopup().insertDescription(newDescription);
+ InformationalArtifactPage.artifactPopup().clickDoneButton();
+ String actualArtifactDescription = InformationalArtifactPage.getArtifactDescription(informationalArtifact.getArtifactLabel());
+ AssertJUnit.assertTrue("artifact description is not updated", newDescription.equals(actualArtifactDescription));
+
+ InformationalArtifactPage.clickDeleteArtifact(informationalArtifact.getArtifactLabel());
+ InformationalArtifactPage.clickOK();
+ AssertJUnit.assertTrue("artifact "+ informationalArtifact.getArtifactLabel() + "is not deleted", InformationalArtifactPage.checkElementsCountInTable(0));
+ }
+
+
+ @Test
+ public void addPropertiesToVfcInstanceInVfTestApi() throws Exception {
+
+ String fileName = "vFW_VFC.yml";
+ ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
+
+ try{
+ //Create VFC via API
+ Resource vfc = AtomicOperationUtils.importResource(filePath, fileName).left().value();
+ atomicResourceMetaData.setName(vfc.getName());
+
+ //Certify VFC via API
+ vfc = (Resource) AtomicOperationUtils.changeComponentState(vfc, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+ //Create VF via API
+ ResourceReqDetails vfMetaData = createVFviaAPI();
+
+ //Go to Catalog and find the created VF
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+
+ ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
+ CompositionPage.searchForElement(atomicResourceMetaData.getName());
+ CanvasElement vfcElement = vfCanvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
+
+ vfCanvasManager.clickOnCanvaElement(vfcElement);
+ CompositionPage.showPropertiesAndAttributesTab();
+ List<WebElement> properties = CompositionPage.getProperties();
+ String propertyValue = "abc123";
+ for (int i = 0; i < 2; i++) {
+ WebElement findElement = properties.get(i).findElement(By.className("i-sdc-designer-sidebar-section-content-item-property-and-attribute-label"));
+ findElement.click();
+ PropertiesPage.getPropertyPopup().insertPropertyDefaultValue(propertyValue);
+ PropertiesPage.getPropertyPopup().clickSave();
+
+
+ findElement = properties.get(i).findElement(By.className("i-sdc-designer-sidebar-section-content-item-property-value"));
+ AssertJUnit.assertTrue(findElement.getText().equals(propertyValue));
+ }
+ }
+ finally{
+ ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "0.1");
+ }
+ }
+
+ @Test
+ public void changeInstanceVersionTest() throws Exception{
+
+ ResourceReqDetails atomicResourceMetaData = null;
+ ResourceReqDetails vfMetaData = null;
+ CanvasManager vfCanvasManager;
+ CanvasElement vfcElement = null;
+ String fileName = "vFW_VFC3.yml";
+ try{
+ atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
+ ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
+ ResourceGeneralPage.clickSubmitForTestingButton(atomicResourceMetaData.getName());
+
+ vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
+ ResourceUIUtils.createVF(vfMetaData, getUser());
+ ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ vfCanvasManager = CanvasManager.getCanvasManager();
+ CompositionPage.searchForElement(atomicResourceMetaData.getName());
+ vfcElement = vfCanvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
+
+
+ CompositionPage.clickSubmitForTestingButton(vfMetaData.getName());
+ assert(false);
+ }
+ catch(Exception e){
+ String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
+ String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.VALIDATED_RESOURCE_NOT_FOUND.name());
+ AssertJUnit.assertTrue(errorMessage.contains(checkUIResponseOnError));
+
+
+ reloginWithNewRole(UserRoleEnum.TESTER);
+ GeneralUIUtils.findComponentAndClick(atomicResourceMetaData.getName());
+ TesterOperationPage.certifyComponent(atomicResourceMetaData.getName());
+
+ reloginWithNewRole(UserRoleEnum.DESIGNER);
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+ ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ vfCanvasManager = CanvasManager.getCanvasManager();
+ CompositionPage.changeComponentVersion(vfCanvasManager, vfcElement, "1.0");
+
+ //verification
+ VfVerificator.verifyInstanceVersion(vfMetaData, getUser(), atomicResourceMetaData.getName(), "1.0");
+ }
+
+ finally{
+ ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "1.0");
+ }
+
+ }
+
+ // future removed from ui
+ @Test(enabled = false)
+ public void addUpdateDeleteSimplePropertiesToVfTest() throws Exception{
+ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
+ ResourceUIUtils.createVF(vfMetaData, getUser());
+
+ ResourceGeneralPage.getLeftMenu().moveToPropertiesScreen();
+ List<PropertyTypeEnum> propertyList = Arrays.asList(PropertyTypeEnum.STRING, PropertyTypeEnum.INTEGER);
+ int propertiesCount = PropertiesPage.getElemenetsFromTable().size();
+ for (PropertyTypeEnum prop : propertyList){
+ PropertiesUIUtils.addNewProperty(prop);
+ }
+ AssertJUnit.assertTrue(GeneralUIUtils.checkElementsCountInTable(propertiesCount + propertyList.size(), () -> PropertiesPage.getElemenetsFromTable()));
+ VfVerificator.verifyPropertiesInUI(propertyList);
+ PropertiesPage.verifyTotalProperitesField(propertiesCount + propertyList.size());
+
+
+ PropertyTypeEnum prop = propertyList.get(0);
+ prop.setDescription("updatedDescription");
+ prop.setValue("value");
+ PropertiesUIUtils.updateProperty(prop);
+
+ PropertiesPage.clickDeletePropertyArtifact(prop.getName());
+ AssertJUnit.assertTrue(GeneralUIUtils.checkElementsCountInTable(propertiesCount + propertyList.size() - 1, () -> PropertiesPage.getElemenetsFromTable()));
+ }
+
+ // future removed from ui
+ @Test(enabled = false)
+ public void vfcInstancesInputScreenTest() throws Exception{
+ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
+ ResourceUIUtils.createVF(vfMetaData, getUser());
+
+ ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
+
+ Map<String, String> elementsIntancesMap = new HashMap<String, String>();
+ for (LeftPanelCanvasItems element : Arrays.asList(LeftPanelCanvasItems.DATABASE, LeftPanelCanvasItems.BLOCK_STORAGE)){
+ CanvasElement elementOnCanvas = vfCanvasManager.createElementOnCanvas(element);
+ vfCanvasManager.clickOnCanvaElement(elementOnCanvas);
+ String selectedInstanceName = CompositionPage.getSelectedInstanceName();
+ elementsIntancesMap.put(selectedInstanceName, element.getValue());
+ }
+
+ CompositionPage.moveToInputsScreen();
+ int canvasElementsSize = vfCanvasManager.getCanvasElements().size();
+ AssertJUnit.assertTrue("Instances count is not as expected: " + canvasElementsSize, InputsPage.checkElementsCountInTable(canvasElementsSize));
+
+ for (String element : elementsIntancesMap.keySet()){
+ String resourceName = elementsIntancesMap.get(element);
+ ResourceReqDetails resource = new ResourceReqDetails();
+ resource.setName(resourceName);
+ resource.setVersion("1.0");
+ resource.setResourceType(ResourceTypeEnum.VFC.toString());
+ RestResponse restResponse = RestCDUtils.getResource(resource, getUser());
+ Map<String, String> propertiesNameTypeJson = ResponseParser.getPropertiesNameType(restResponse);
+
+ List<WebElement> propertyRowsFromTable = InputsPage.getInstancePropertiesList(element);
+ AssertJUnit.assertTrue("Some properties are missing in table. Instance name is : " + element, propertyRowsFromTable.size() == propertiesNameTypeJson.size());
+ VfVerificator.verifyVfInputs(element, propertiesNameTypeJson, propertyRowsFromTable);
+
+ GeneralUIUtils.clickOnElementByText(element);
+ }
+
+ }
+
+
+ @Test
+ public void addAllInformationalArtifactPlaceholdersInVfTestApi() throws Exception{
+ //Create VF via API
+ ResourceReqDetails vfMetaData = createVFviaAPI();
+
+ //Go to Catalog and find the created VF
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+
+ ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
+
+ for(InformationalArtifactsPlaceholders informArtifact : InformationalArtifactsPlaceholders.values()){
+ ArtifactUIUtils.fillPlaceHolderInformationalArtifact(informArtifact, filePath,"asc_heat 0 2.yaml", informArtifact.getValue());
+ }
+
+ AssertJUnit.assertTrue(InformationalArtifactPage.checkElementsCountInTable(InformationalArtifactsPlaceholders.values().length));
+ }
+
+ @Test
+ public void verifyToscaArtifactsExistApi() throws Exception{
+ //Create VF via API
+ ResourceReqDetails vfMetaData = createVFviaAPI();
+
+ //Go to Catalog and find the created VF
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+
+ final int numOfToscaArtifacts = 2;
+ ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen();
+ AssertJUnit.assertTrue(ToscaArtifactsPage.checkElementsCountInTable(numOfToscaArtifacts));
+
+ for(int i = 0; i < numOfToscaArtifacts; i++){
+ String typeFromScreen = ToscaArtifactsPage.getArtifactType(i);
+ AssertJUnit.assertTrue(typeFromScreen.equals(ArtifactTypeEnum.TOSCA_CSAR.getType()) || typeFromScreen.equals(ArtifactTypeEnum.TOSCA_TEMPLATE.getType()));
+ }
+
+ ToscaArtifactsPage.clickSubmitForTestingButton(vfMetaData.getName());
+ VfVerificator.verifyToscaArtifactsInfo(vfMetaData, getUser());
+ }
+
+ @Test(enabled=false)
+ public void testDownload() throws Exception{
+// ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
+// ResourceUIUtils.createResource(vfMetaData, getUser());
+//
+// final int numOfToscaArtifacts = 2;
+// ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen();
+// assertTrue(ToscaArtifactsPage.checkElementsCountInTable(numOfToscaArtifacts));
+// GeneralUIUtils.clickOnElementByTestId("download-Tosca Model");
+// System.out.println("download me");
+
+ AttFtpClient attFtpClient = AttFtpClient.getInstance();
+
+ File retrieveLastModifiedFileFromFTP = attFtpClient.retrieveLastModifiedFileFromFTP();
+ attFtpClient.deleteFilesFromFTPserver();
+ }
+
+ @Test
+ public void vfCertificationTestApi() throws Exception{
+ //Create VF via API
+ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
+ Resource vf = AtomicOperationUtils.createResourceByResourceDetails(vfMetaData, UserRoleEnum.DESIGNER, true).left().value();
+
+ //Certify VF via API
+ vf = (Resource) AtomicOperationUtils.changeComponentState(vf, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+ //Go to Catalog and find the created VF
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+
+ VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CERTIFIED);
+ }
+
+ @Test
+ public void deleteVfCheckedoutTestApi() throws Exception{
+ //Create VF via API
+ ResourceReqDetails vfMetaData = createVFviaAPI();
+
+ //Go to Catalog and find the created VF
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+
+ GeneralPageElements.clickTrashButtonAndConfirm();
+
+ vfMetaData.setVersion("0.1");
+ VfVerificator.verifyVfDeleted(vfMetaData, getUser());
+ }
+
+ @Test
+ public void revertVfMetadataTestApi() throws Exception{
+ //Create VF via API
+ ResourceReqDetails vfMetaData = createVFviaAPI();
+
+ //Go to Catalog and find the created VF
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+
+ ResourceReqDetails vfRevertDetails = new ResourceReqDetails();
+ vfRevertDetails.setName("ciUpdatedName");
+ vfRevertDetails.setDescription("kuku");
+ vfRevertDetails.setCategories(vfMetaData.getCategories());
+ vfRevertDetails.setVendorName("updatedVendor");
+ vfRevertDetails.setVendorRelease("updatedRelease");
+ ResourceUIUtils.fillResourceGeneralInformationPage(vfRevertDetails, getUser(), false);
+
+ GeneralPageElements.clickRevertButton();
+
+ VfVerificator.verifyVFMetadataInUI(vfMetaData);
+
+ }
+
+ @Test
+ public void addDeploymentArtifactInCompositionScreenTestApi() throws Exception{
+ //Create VF via API
+ ResourceReqDetails vfMetaData = createVFviaAPI();
+
+ //Go to Catalog and find the created VF
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+
+ ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
+
+ ArtifactInfo artifact = new ArtifactInfo(filePath, "Heat-File.yaml", "kuku", "artifact3","OTHER");
+ CompositionPage.showDeploymentArtifactTab();
+ CompositionPage.clickAddArtifactButton();
+ ArtifactUIUtils.fillAndAddNewArtifactParameters(artifact, CompositionPage.artifactPopup());
+
+ List<WebElement> actualArtifactList = GeneralUIUtils.getWebElementsListBy(By.className("i-sdc-designer-sidebar-section-content-item-artifact"));
+ AssertJUnit.assertEquals(1, actualArtifactList.size());
+ }
+
+ // future removed from ui
+ @Test(enabled = false)
+ public void addPropertyInCompositionScreenTest() throws Exception{
+ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
+ ResourceUIUtils.createVF(vfMetaData, getUser());
+
+ ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
+
+ CompositionPage.showPropertiesAndAttributesTab();
+ List<PropertyTypeEnum> propertyList = Arrays.asList(PropertyTypeEnum.STRING, PropertyTypeEnum.INTEGER);
+ int propertiesCount = CompositionPage.getProperties().size();
+ for (PropertyTypeEnum prop : propertyList){
+ PropertiesUIUtils.addNewProperty(prop);
+ }
+ AssertJUnit.assertTrue(GeneralUIUtils.checkElementsCountInTable(propertiesCount + propertyList.size(), () -> CompositionPage.getProperties()));
+ }
+
+ @Test
+ public void addDeploymentArtifactAndVerifyInCompositionScreenApi() throws Exception{
+ //Create VF via API
+ ResourceReqDetails vfMetaData = createVFviaAPI();
+
+ //Go to Catalog and find the created VF
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+
+ ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
+
+ ArtifactInfo deploymentArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER");
+ DeploymentArtifactPage.clickAddNewArtifact();
+ ArtifactUIUtils.fillAndAddNewArtifactParameters(deploymentArtifact);
+ AssertJUnit.assertTrue(DeploymentArtifactPage.checkElementsCountInTable(1));
+
+ ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
+
+ CompositionPage.showDeploymentArtifactTab();
+ List<WebElement> deploymentArtifactsFromScreen = CompositionPage.getDeploymentArtifacts();
+ AssertJUnit.assertTrue(1 == deploymentArtifactsFromScreen.size());
+
+ String actualArtifactFileName = deploymentArtifactsFromScreen.get(0).getText();
+ AssertJUnit.assertTrue("asc_heat-0-2.yaml".equals(actualArtifactFileName));
+ }
+
+ @Test
+ public void checkoutVfTest() throws Exception{
+ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
+ ResourceUIUtils.createVF(vfMetaData, getUser());
+
+ ResourceGeneralPage.clickCheckinButton(vfMetaData.getName());
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+ GeneralPageElements.clickCheckoutButton();
+
+ vfMetaData.setVersion("0.2");
+ VfVerificator.verifyVFLifecycle(vfMetaData, getUser(), LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+ VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CHECKOUT);
+
+ ResourceGeneralPage.clickSubmitForTestingButton(vfMetaData.getName());
+
+ reloginWithNewRole(UserRoleEnum.TESTER);
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+ TesterOperationPage.certifyComponent(vfMetaData.getName());
+
+ reloginWithNewRole(UserRoleEnum.DESIGNER);
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+ ResourceGeneralPage.clickCheckoutButton();
+
+ vfMetaData.setVersion("1.1");
+ vfMetaData.setUniqueId(null);
+ VfVerificator.verifyVFLifecycle(vfMetaData, getUser(), LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+ VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CHECKOUT);
+ }
+
+ @Test
+ public void deleteInstanceFromVfCanvasApi() throws Exception{
+ //Create VF via API
+ ResourceReqDetails vfMetaData = createVFviaAPI();
+
+ //Go to Catalog and find the created VF
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+
+ ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
+ CanvasElement computeElement = vfCanvasManager.createElementOnCanvas(LeftPanelCanvasItems.COMPUTE);
+ vfCanvasManager.createElementOnCanvas(LeftPanelCanvasItems.PORT);
+
+ vfCanvasManager.clickOnCanvaElement(computeElement);
+ vfCanvasManager.deleteElementFromCanvas(computeElement);
+
+ VfVerificator.verifyNumOfComponentInstances(vfMetaData, 1, getUser());
+ }
+
+ @Test
+ public void changeInstanceNameInVfTestApi() throws Exception{
+ //Create VF via API
+ ResourceReqDetails vfMetaData = createVFviaAPI();
+
+ //Go to Catalog and find the created VF
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+
+ ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
+ CanvasElement computeElement = vfCanvasManager.createElementOnCanvas(LeftPanelCanvasItems.COMPUTE);
+
+ String updatedInstanceName = "updatedName";
+ vfCanvasManager.updateElementNameInCanvas(computeElement, updatedInstanceName);
+
+ String actualSelectedInstanceName = CompositionPage.getSelectedInstanceName();
+ AssertJUnit.assertTrue(updatedInstanceName.equals(actualSelectedInstanceName));
+ }
+
+
+ @Test
+ public void submitVfForTestingWithNonCertifiedAssetApi() throws Exception{
+ String fileName = "vFW_VFC4.yml";
+ ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
+
+ //Create VFC via API
+ Resource vfc = AtomicOperationUtils.importResource(filePath, fileName).left().value();
+ atomicResourceMetaData.setName(vfc.getName());
+
+ //Submit VFC for testing via API
+ vfc = (Resource) AtomicOperationUtils.changeComponentState(vfc, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true).getLeft();
+
+ //Create VF via API
+ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
+ AtomicOperationUtils.createResourceByResourceDetails(vfMetaData, UserRoleEnum.DESIGNER, true).left().value();
+
+ //Go to Catalog and find the created VF
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+
+ DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+ CompositionPage.searchForElement(atomicResourceMetaData.getName());
+ canvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
+
+ try{
+ CompositionPage.clickSubmitForTestingButton(vfMetaData.getName());
+ assert(false);
+ }
+ catch(Exception e){
+ String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
+ String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.VALIDATED_RESOURCE_NOT_FOUND.name());
+ AssertJUnit.assertTrue(errorMessage.contains(checkUIResponseOnError));
+ }
+ finally{
+ ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "0.1");
+ }
+ }
+
+ @Test
+ public void isDisabledAndReadOnlyInCheckinApi() throws Exception{
+ //Create VF via API
+ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
+ Resource vf = AtomicOperationUtils.createResourceByResourceDetails(vfMetaData, UserRoleEnum.DESIGNER, true).left().value();
+
+ //Check in VF via API
+ vf = (Resource) AtomicOperationUtils.changeComponentState(vf, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+
+ //Go to Catalog and find the created VF
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
+
+ ResourceMetadataEnum[] fieldsForCheck = {ResourceMetadataEnum.RESOURCE_NAME,
+ ResourceMetadataEnum.DESCRIPTION, ResourceMetadataEnum.VENDOR_NAME, ResourceMetadataEnum.VENDOR_RELEASE,
+ ResourceMetadataEnum.CONTACT_ID};
+
+ for (ResourceMetadataEnum field: fieldsForCheck){
+ AssertJUnit.assertTrue(GeneralUIUtils.isElementReadOnly(field.getValue()));
+ }
+
+ AssertJUnit.assertTrue(GeneralUIUtils.isElementDisabled(ResourceMetadataEnum.CATEGORY.getValue()));
+ AssertJUnit.assertTrue(GeneralUIUtils.isElementDisabled(DataTestIdEnum.LifeCyleChangeButtons.CREATE.getValue()));
+ }
+
+ @Test
+ public void exportToscaWithModulePropertiesVFTest() throws AWTException, Exception {
+ String vnfFile = "1-Vf-zrdm5bpxmc02-092017-(MOBILITY)_v2.0.zip";
+ ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
+ Pair<String, VendorSoftwareProductObject> vsp= OnboardingUiUtils.onboardAndValidate(resourceReqDetails, FileHandling.getVnfRepositoryPath(), vnfFile, getUser());
+ String vspName = vsp.left;
+ ResourceGeneralPage.clickSubmitForTestingButton(vsp.left);
+ Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, vspName, "0.1");
+ VfModuleVerificator.validateSpecificModulePropertiesFromRequest(resource);
+ }
+
+ @Test
+ public void exportToscaWithModulePropertiesTemplateCheckVFTest() throws AWTException, Exception {
+ String vnfFile = "1-Vf-zrdm5bpxmc02-092017-(MOBILITY)_v2.0.zip";
+ ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
+ OnboardingUiUtils.onboardAndValidate(resourceReqDetails, FileHandling.getVnfRepositoryPath(), vnfFile, getUser());
+ ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen();
+ GeneralUIUtils.clickOnElementByTestId(ToscaArtifactsScreenEnum.TOSCA_MODEL.getValue());
+ File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir();
+ ToscaDefinition toscaDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(latestFilefromDir);
+ VfModuleVerificator.validateSpecificModulePropertiesFromFile(toscaDefinition);
+ }
+
+
+
+ @Override
+ protected UserRoleEnum getRole() {
+ return UserRoleEnum.DESIGNER;
+ }
+
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfArtifacts.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfArtifacts.java
index 8055a86d58..9847d341c0 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfArtifacts.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfArtifacts.java
@@ -20,16 +20,8 @@
package org.openecomp.sdc.ci.tests.execute.sanity;
-import static org.testng.AssertJUnit.assertTrue;
-
-import java.awt.AWTException;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
+import com.aventstack.extentreports.Status;
+import com.clearspring.analytics.util.Pair;
import org.openecomp.sdc.be.datatypes.elements.HeatParameterDataDefinition;
import org.openecomp.sdc.be.model.ArtifactDefinition;
import org.openecomp.sdc.be.model.Resource;
@@ -40,6 +32,7 @@ import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.CompositionScreenEnum
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.StepsEnum;
import org.openecomp.sdc.ci.tests.datatypes.HeatWithParametersDefinition;
import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
@@ -47,11 +40,7 @@ import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
import org.openecomp.sdc.ci.tests.pages.CompositionPage;
import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.HomeUtils;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
+import org.openecomp.sdc.ci.tests.utilities.*;
import org.openecomp.sdc.ci.tests.utils.Utils;
import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
@@ -61,8 +50,15 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
-import com.aventstack.extentreports.Status;
-import com.clearspring.analytics.util.Pair;
+import java.awt.*;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import static org.testng.AssertJUnit.assertTrue;
public class VfArtifacts extends SetupCDTest{
@@ -115,10 +111,10 @@ public class VfArtifacts extends SetupCDTest{
@Test
public void uploadUpdatedHeatEnv() throws Exception{
- String vnfFile = VMSP_PXMC_30_1607_E2E_ZIP;
+ String vnfFile = VFW_FNAT_30_1607_E2E_ZIP;
File updateEnvFile = null;
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Pair<String,Map<String,String>> vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
+ Pair<String, VendorSoftwareProductObject> vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
String vspName = vsp.left;
Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, vspName, "0.1");
Map<String, ArtifactDefinition> deploymentArtifacts = resource.getDeploymentArtifacts();
@@ -143,7 +139,7 @@ public class VfArtifacts extends SetupCDTest{
String vnfFile = VFW_FNAT_30_1607_E2E_ZIP;
File updateEnvFile = null;
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Pair<String,Map<String,String>> vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
+ Pair<String, VendorSoftwareProductObject> vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
String vspName = vsp.left;
Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, vspName, "0.1");
Map<String, ArtifactDefinition> deploymentArtifacts = resource.getDeploymentArtifacts();
@@ -167,7 +163,7 @@ public class VfArtifacts extends SetupCDTest{
String vnfFile = VLANDSLIDE_LDST_30_1607_E2E_ZIP;
File updateEnvFile = null;
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Pair<String,Map<String,String>> vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
+ Pair<String, VendorSoftwareProductObject> vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
String vspName = vsp.left;
Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, vspName, "0.1");
Map<String, ArtifactDefinition> deploymentArtifacts = resource.getDeploymentArtifacts();
@@ -196,7 +192,7 @@ public class VfArtifacts extends SetupCDTest{
String updatedVnfFile= VLANDSLIDE_LDSA_30_1607_E2E_ZIP;
String downloadDirPath=SetupCDTest.getConfig().getWindowsDownloadDirectory();
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Pair<String, Map<String, String>> CreatedVsp= OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
+ Pair<String, VendorSoftwareProductObject> CreatedVsp= OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
String vspName = CreatedVsp.left;
GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
OnboardingUiUtils.updateVnfAndValidate(vnfsRepositoryPath, CreatedVsp, updatedVnfFile, getUser());
@@ -222,7 +218,7 @@ public class VfArtifacts extends SetupCDTest{
String vnfFile = VSAEGW_FDNT_30_1607_E2E_ZIP;
String downloadDirPath=SetupCDTest.getConfig().getWindowsDownloadDirectory();
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Pair<String, Map<String, String>> vsp= OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
+ Pair<String,VendorSoftwareProductObject> vsp= OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
Map<String, File> currentZipEnvfiles=ArtifactBusinessLogic.createEnvFilesListFromCsar(vsp.left,downloadDirPath);
GeneralUIUtils.findComponentAndClick(vsp.left);
ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
@@ -246,7 +242,7 @@ public class VfArtifacts extends SetupCDTest{
String downloadDirPath=SetupCDTest.getConfig().getWindowsDownloadDirectory();
String vnfFile = VSAEGW_FDNT_30_1607_E2E_ZIP;
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Pair<String, Map<String, String>> vsp= OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
+ Pair<String, VendorSoftwareProductObject> vsp= OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
Map<String, File> currentZipEnvfiles=ArtifactBusinessLogic.createEnvFilesListFromCsar(vsp.left,downloadDirPath);
GeneralUIUtils.findComponentAndClick(vsp.left);
ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
@@ -271,7 +267,7 @@ public class VfArtifacts extends SetupCDTest{
String vnfFile = VFW_FCGI_30_1607_E2E_ZIP;
String downloadDirPath=SetupCDTest.getConfig().getWindowsDownloadDirectory();
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Pair<String, Map<String, String>> CreatedVsp= OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
+ Pair<String, VendorSoftwareProductObject> CreatedVsp= OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, CreatedVsp.left, "0.1");
Map<String, ArtifactDefinition> deploymentArtifacts = resource.getDeploymentArtifacts();
List<HeatWithParametersDefinition> envFilesList = ArtifactBusinessLogic.extractHeatWithParametersDefinition(deploymentArtifacts);
@@ -315,7 +311,7 @@ public class VfArtifacts extends SetupCDTest{
public void checkDefaultCreatedEnvArtifacts() throws Exception{
String vnfFile = VIXIA_IXLA_30_1607_E2E_ZIP;
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Pair<String,Map<String,String>> vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
+ Pair<String, VendorSoftwareProductObject> vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
String vspName = vsp.left;
Map<String, File> generatedEnvFileList = ArtifactBusinessLogic.createEnvFilesListFromCsar(vspName, filePath);
HomeUtils.findComponentAndClick(vspName);
@@ -337,7 +333,7 @@ public class VfArtifacts extends SetupCDTest{
String stringForLog = String.format("%s:%s:%s:%s", vnfFile, updatedVnfFile, expectedHeatVersion, expectedHeatEnvVersion);
setLog(stringForLog);
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Pair<String,Map<String,String>> vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
+ Pair<String, VendorSoftwareProductObject> vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
String vspName = vsp.left;
GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
OnboardingUiUtils.updateVnfAndValidate(vnfsRepositoryPath, vsp, updatedVnfFile, getUser());
@@ -362,7 +358,7 @@ public class VfArtifacts extends SetupCDTest{
String vnfFile = VFW_FCGI_30_1607_E2E_ZIP;
String updatedVnfFile = VFW_FCGI_30_1607_E2E_ZIP;
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Pair<String,Map<String,String>> vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
+ Pair<String, VendorSoftwareProductObject> vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
String vspName = vsp.left;
GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfDeploymentInformationalArtifacts.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfDeploymentInformationalArtifacts.java
index ef8a337394..bb4d754bbf 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfDeploymentInformationalArtifacts.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfDeploymentInformationalArtifacts.java
@@ -43,6 +43,7 @@ import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
import org.openecomp.sdc.common.api.ArtifactTypeEnum;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
+import org.testng.SkipException;
import org.testng.annotations.Test;
@@ -234,6 +235,11 @@ public class VfDeploymentInformationalArtifacts extends SetupCDTest {
// TC1443736 - Update With One New Deployment Artifact
@Test
public void updateWithOneNewDeploymentArtifact() throws Exception {
+
+ if(true){
+ throw new SkipException("Open bug 310971 and 369139");
+ }
+
String fileName = "ImportTC1443736.csar";
String folder ="US825779";
@@ -257,6 +263,11 @@ public class VfDeploymentInformationalArtifacts extends SetupCDTest {
// TC1443737 - Update With One Removed Deployment Artifact
@Test
public void updateWithOneRemovedDeploymentArtifact() throws Exception {
+
+ if(true){
+ throw new SkipException("Open bug 310971 and 369139");
+ }
+
String fileName = "ImportTC1443737.csar";
String folder ="US825779";
@@ -284,6 +295,11 @@ public class VfDeploymentInformationalArtifacts extends SetupCDTest {
// TC1443738 - Update With One New Version Deployment Artifact
@Test
public void updateWithOneNewVersionDeploymentArtifact() throws Exception {
+
+ if(true){
+ throw new SkipException("Open bug 310971 and 369139");
+ }
+
String fileName = "ImportTC1443738.csar";
String folder ="US825779";
@@ -309,6 +325,11 @@ public class VfDeploymentInformationalArtifacts extends SetupCDTest {
// TC1443887 - Update With One New Informational Artifact
@Test
public void updateWithOneNewInformationalArtifact() throws Exception {
+
+ if(true){
+ throw new SkipException("Open bug 310971 and 369139");
+ }
+
String fileName = "ImportTC1443887.csar";
String folder ="US825779";
@@ -332,6 +353,11 @@ public class VfDeploymentInformationalArtifacts extends SetupCDTest {
// TC1443888 - Update With One Removed Informational Artifact
@Test
public void updateWithOneRemovedInformationalArtifact() throws Exception {
+
+ if(true){
+ throw new SkipException("Open bug 310971 and 369139");
+ }
+
String folder ="US825779";
String fileName = "ImportTC1443888.csar";
@@ -361,6 +387,11 @@ public class VfDeploymentInformationalArtifacts extends SetupCDTest {
// TC1443890 - Update With One New Artifact Version Informational Artifact
@Test
public void updateWithOneNewArtifactVersionInformationalArtifact() throws Exception {
+
+ if(true){
+ throw new SkipException("Open bug 310971 and 369139");
+ }
+
String folder ="US825779";
String fileName = "ImportTC1443890.csar";
@@ -385,7 +416,12 @@ public class VfDeploymentInformationalArtifacts extends SetupCDTest {
// US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
// TC1443893 - Update CSAR With Same Artifacts As Imported
@Test
- public void updateCSARWithSameArtifactsAsImported() throws Exception {
+ public void updateCSARWithSameArtifactsAsImported() throws Exception {
+
+ if(true){
+ throw new SkipException("Open bug 310971 and 369139");
+ }
+
String folder ="US825779";
String fileName = "ImportUpdateTC1443893.csar";
@@ -611,6 +647,10 @@ public class VfDeploymentInformationalArtifacts extends SetupCDTest {
// TC1444530 - Update Deployment Artifact With Invalid Type
@Test
public void updateDeploymentArtifactWithInvalidType() throws Exception {
+
+ if(true){
+ throw new SkipException("Open bug 310971 and 369139");
+ }
String folder ="US825779";
String fileName = "ImportTC1444530.csar";
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/DriverFactory.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/DriverFactory.java
index 6c76e327f0..0ba51de87a 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/DriverFactory.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/DriverFactory.java
@@ -21,16 +21,6 @@
package org.openecomp.sdc.ci.tests.execute.setup;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-
import org.apache.commons.io.FileUtils;
import org.openecomp.sdc.ci.tests.config.Config;
import org.openecomp.sdc.ci.tests.utilities.FileHandling;
@@ -40,6 +30,12 @@ import org.openqa.selenium.firefox.FirefoxProfile;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.*;
+
public class DriverFactory {
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentManager.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentManager.java
index 09dcad7c36..0a66f5f610 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentManager.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentManager.java
@@ -20,8 +20,11 @@
package org.openecomp.sdc.ci.tests.execute.setup;
-import java.io.File;
-
+import com.aventstack.extentreports.ExtentReports;
+import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
+import com.aventstack.extentreports.reporter.ExtentXReporter;
+import com.aventstack.extentreports.reporter.configuration.Protocol;
+import com.aventstack.extentreports.reporter.configuration.Theme;
import org.openecomp.sdc.ci.tests.config.Config;
import org.openecomp.sdc.ci.tests.utilities.FileHandling;
import org.openecomp.sdc.ci.tests.utilities.RestCDUtils;
@@ -29,11 +32,12 @@ import org.openecomp.sdc.ci.tests.utils.Utils;
import org.openecomp.sdc.ci.tests.utils.rest.AutomationUtils;
import org.testng.ITestContext;
-import com.aventstack.extentreports.ExtentReports;
-import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
-import com.aventstack.extentreports.reporter.ExtentXReporter;
-import com.aventstack.extentreports.reporter.configuration.Protocol;
-import com.aventstack.extentreports.reporter.configuration.Theme;
+import java.io.File;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
public class ExtentManager {
@@ -70,9 +74,8 @@ public class ExtentManager {
if (extent == null) {
extentxReporter = new ExtentXReporter(dbIp, dbPort);
- extent = new ExtentReports();
- initAndSetExtentHtmlReporter(filePath, htmlFile, isAppend);
-
+ extent = new ExtentReports();
+ initAndSetExtentHtmlReporter(filePath, htmlFile, isAppend);
if(extentxReporter.config().getReportObjectId() != null){
setExtentXReporter(isAppend);
}else{
@@ -88,7 +91,7 @@ public class ExtentManager {
}
public synchronized static void initAndSetExtentHtmlReporter(String filePath, String htmlFile, Boolean isAppend) throws Exception{
- htmlReporter = new ExtentHtmlReporter(filePath + htmlFile);
+ htmlReporter = new ExtentHtmlReporter(filePath + htmlFile);
setConfiguration(htmlReporter);
htmlReporter.setAppendExisting(isAppend);
extent.attachReporter(htmlReporter);
@@ -105,11 +108,11 @@ public class ExtentManager {
Config config = Utils.getConfig();
String envData = config.getUrl();
String suiteName = getSuiteName(context);
-
+ String reportStartDate = null;
if(suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue())){
- if (config.getUseBrowserMobProxy())
- setTrafficCaptue(config);
-
+ if (config.getUseBrowserMobProxy()) {
+ setTrafficCaptue(config);
+ }
setReporter(filepath, htmlFile, true);
String suiteNameFromVersionInfoFile = FileHandling.getKeyByValueFromPropertyFormatFile(filepath + VERSIONS_INFO_FILE_NAME, "suiteName");
reporterDataDefinition(onboardVersion, osVersion, envData, suiteNameFromVersionInfoFile);
@@ -117,8 +120,11 @@ public class ExtentManager {
FileHandling.deleteDirectory(SetupCDTest.getReportFolder());
FileHandling.createDirectory(filepath);
setReporter(filepath, htmlFile, false);
+ Calendar calendar = new GregorianCalendar();
+ SimpleDateFormat formatter = new SimpleDateFormat("MMM dd, yyyy hh:mm:ss a");
+ reportStartDate = formatter.format(calendar.getTime());
reporterDataDefinition(onboardVersion, osVersion, envData, suiteName);
- AutomationUtils.createVersionsInfoFile(filepath + VERSIONS_INFO_FILE_NAME, onboardVersion, osVersion, envData, suiteName);
+ AutomationUtils.createVersionsInfoFile(filepath + VERSIONS_INFO_FILE_NAME, onboardVersion, osVersion, envData, suiteName, reportStartDate);
}
}
@@ -152,6 +158,7 @@ public class ExtentManager {
htmlReporter.config().setReportName("SDC Automation Report");
htmlReporter.config().setChartVisibilityOnOpen(false);
htmlReporter.config().setJS(icon);
+ htmlReporter.setStartTime(null);
return htmlReporter;
}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestManager.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestManager.java
index 6d9b367460..4d28e9a8b4 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestManager.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestManager.java
@@ -20,12 +20,11 @@
package org.openecomp.sdc.ci.tests.execute.setup;
-import java.util.HashMap;
-
-import org.openecomp.sdc.ci.tests.api.SomeInterface;
-
import com.aventstack.extentreports.ExtentReports;
import com.aventstack.extentreports.ExtentTest;
+import org.openecomp.sdc.ci.tests.api.SomeInterface;
+
+import java.util.HashMap;
public class ExtentTestManager implements SomeInterface{
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java
index 3bb4c7598c..2e05c2c059 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java
@@ -26,14 +26,21 @@ import java.io.IOException;
import java.util.Arrays;
import java.util.Map;
import java.util.UUID;
+import java.util.logging.FileHandler;
+import java.util.logging.Handler;
+import java.util.logging.LogManager;
+import java.util.logging.Logger;
import org.json.simple.JSONObject;
+import org.littleshoot.proxy.impl.ClientToProxyConnection;
+import org.littleshoot.proxy.impl.ProxyToServerConnection;
import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestManager;
import org.openecomp.sdc.ci.tests.api.SomeInterface;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
import org.openecomp.sdc.ci.tests.datatypes.UserCredentials;
import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.sanity.Onboard;
+import org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsUI;
import org.openecomp.sdc.ci.tests.execute.setup.ExtentManager.suiteNameXml;
import org.openecomp.sdc.ci.tests.pages.HomePage;
import org.openecomp.sdc.ci.tests.run.StartTest;
@@ -59,11 +66,14 @@ import org.testng.annotations.Optional;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
+import com.aventstack.extentreports.ExtentReports;
import com.aventstack.extentreports.ExtentTest;
import com.aventstack.extentreports.Status;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.LoggerContext;
+import groovyjarjarantlr.Utils;
+import net.lightbody.bmp.BrowserMobProxyServer;
import net.lightbody.bmp.core.har.Har;
public abstract class SetupCDTest extends DriverFactory {
@@ -195,9 +205,9 @@ public abstract class SetupCDTest extends DriverFactory {
addTrafficFileToReport(result);
}
- if (result.getInstanceName().equals(Onboard.class.getName()) && result.getStatus() == ITestResult.FAILURE){
+ if (result.getInstanceName().equals(OnboardingFlowsUI.class.getName()) && result.getStatus() == ITestResult.FAILURE){
System.out.println("Onboarding test failed, closign browser....");
- getExtendTest().log(Status.INFO, "Onboarding test failed, closign browser....");
+ getExtendTest().log(Status.INFO, "Onboarding test failed, closing browser....");
quitDriver();
}
else if (!getUser().getRole().toLowerCase().equals(UserRoleEnum.ADMIN.name().toLowerCase())){
@@ -217,21 +227,28 @@ public abstract class SetupCDTest extends DriverFactory {
ExtentTestManager.endTest();
- addResultToCSV(result, context);
+ String suiteName = ExtentManager.getSuiteName(context);
+// write result to csv file
+ if((!suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue())) && (result.getStatus() == ITestResult.SKIP)) {
+ addResultToCSV(result, context);
+ }
+ if(suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue()) && !(result.getStatus() == ITestResult.SUCCESS)) {
+ addResultToCSV(result, context);
+ }
// ExtentManager.closeReporter();
FileHandling.cleanCurrentDownloadDir();
}
}
public void addResultToCSV(ITestResult result, ITestContext context) {
- String suiteName = ExtentManager.getSuiteName(context);
+// String suiteName = ExtentManager.getSuiteName(context);
ExtentTest test = getExtendTest();
com.aventstack.extentreports.model.Test model = test.getModel();
String name = model.getName();
String status = model.getStatus().toString();
- if (suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue()) && !(result.getStatus() == ITestResult.SUCCESS)) {
+// if (suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue()) && !(result.getStatus() == ITestResult.SUCCESS)) {
getCsvReport().writeRow(result.getInstanceName(), name.replace(RE_RUN,""), status);
- }
+// }
}
public void generateReport4Jenkins(ITestContext context) {
@@ -288,7 +305,7 @@ public abstract class SetupCDTest extends DriverFactory {
String message = "no URL found";
System.out.println(message);
Assert.fail(message);
- } else if (!url.contains("localhost") && !url.contains("127.0.0.1")) {
+ } else if (!url.contains("localhost") && !url.contains("192.168.33.10") && !url.contains("127.0.0.1")) {
localEnv = false;
}
return url;
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/CompositionPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/CompositionPage.java
index 264971e2d9..e9789ca850 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/CompositionPage.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/CompositionPage.java
@@ -20,8 +20,7 @@
package org.openecomp.sdc.ci.tests.pages;
-import java.util.List;
-
+import com.aventstack.extentreports.Status;
import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
@@ -32,8 +31,9 @@ import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.Select;
+import org.testng.AssertJUnit;
-import com.aventstack.extentreports.Status;
+import java.util.List;
public class CompositionPage extends GeneralPageElements {
@@ -92,6 +92,10 @@ public class CompositionPage extends GeneralPageElements {
}
public static void changeComponentVersion(CanvasManager canvasManager, CanvasElement element, String version) {
+ changeComponentVersion(canvasManager,element,version,false);
+ }
+
+ public static void changeComponentVersion(CanvasManager canvasManager, CanvasElement element, String version, boolean isValidate) {
try{
SetupCDTest.getExtendTest().log(Status.INFO, String.format("Changing component version to %s", version));
canvasManager.clickOnCanvaElement(element);
@@ -105,6 +109,16 @@ public class CompositionPage extends GeneralPageElements {
selectlist.selectByValue(version);
GeneralUIUtils.ultimateWait();
GeneralUIUtils.clickSomewhereOnPage();
+
+ // Validate Selection
+ if(isValidate)
+ {
+ GeneralUIUtils.ultimateWait();
+ canvasManager.clickOnCanvaElement(element);
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating component version changed to %s", version));
+ String actualSelectedValue = GeneralUIUtils.getWebElementBy(By.xpath(String.format("//select[@data-tests-id='%s']//option[@selected='selected']",DataTestIdEnum.CompositionScreenEnum.CHANGE_VERSION.getValue()))).getText();
+ AssertJUnit.assertTrue(actualSelectedValue.equals(version));
+ }
}
catch(Exception e){
throw e;
@@ -117,7 +131,7 @@ public class CompositionPage extends GeneralPageElements {
}
public static String getSelectedInstanceName(){
- return GeneralUIUtils.getWebElementByTestID("selectedCompTitle").getText();
+ return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionRightPanel.COMPONENT_TITLE.getValue()).getText();
}
public static void showInformationArtifactTab() throws Exception {
@@ -188,6 +202,21 @@ public class CompositionPage extends GeneralPageElements {
return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT_ENV.getValue() +fileName);
}
+ public static void setSingleProperty(String propertyDataTestID, String propertyValue)
+ {
+ WebElement findElement = GeneralUIUtils.getWebElementByTestID(propertyDataTestID);
+ findElement.click();
+ PropertiesPage.getPropertyPopup().insertPropertyDefaultValue(propertyValue);
+ PropertiesPage.getPropertyPopup().clickSave();
+ GeneralUIUtils.ultimateWait();
+ findElement = GeneralUIUtils.getWebElementByTestID("value_" + propertyDataTestID);
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating property %s is set", propertyValue));
+ AssertJUnit.assertTrue(findElement.getText().equals(propertyValue));
+ GeneralUIUtils.ultimateWait();
+ }
+
+
+
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/DeploymentArtifactPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/DeploymentArtifactPage.java
index cc6f9b7c89..4230769692 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/DeploymentArtifactPage.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/DeploymentArtifactPage.java
@@ -20,10 +20,7 @@
package org.openecomp.sdc.ci.tests.pages;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
+import com.aventstack.extentreports.Status;
import org.apache.commons.lang.WordUtils;
import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
@@ -37,7 +34,9 @@ import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.collections.Lists;
-import com.aventstack.extentreports.Status;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
public class DeploymentArtifactPage extends GeneralPageElements {
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertiesAssignmentPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertiesAssignmentPage.java
index cdf68da0dd..1dd67b1036 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertiesAssignmentPage.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertiesAssignmentPage.java
@@ -1,6 +1,8 @@
package org.openecomp.sdc.ci.tests.pages;
+import java.util.List;
+
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.PropertiesAssignmentScreen;
import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
@@ -41,7 +43,7 @@ public class PropertiesAssignmentPage {
}
public static void findSearchBoxAndClick(String resourceName) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + resourceName + " in homepage");
+ SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + resourceName + " in Properties");
WebElement searchTextbox = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesAssignmentScreen.SEARCH_BOX.getValue());
try{
searchTextbox.clear();
@@ -55,7 +57,7 @@ public class PropertiesAssignmentPage {
try{
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on the %s component from home screen", resourceName));
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on the %s component in Properties", resourceName));
GeneralUIUtils.clickOnElementByTestId(resourceName);
GeneralUIUtils.ultimateWait();
GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.LIFECYCLE_STATE.getValue());
@@ -84,15 +86,11 @@ public class PropertiesAssignmentPage {
GeneralUIUtils.ultimateWait();
}
- public static void clickOnFilterAll() {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on property %s "));
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_CHECKBOX_ALL.getValue());
- GeneralUIUtils.ultimateWait();
- }
+
public static void clickOnComponentInComposition(String resourceName) throws Exception{
try{
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on the %s component from properties composition", resourceName));
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on the %s component on Properties screen", resourceName));
GeneralUIUtils.clickOnElementByTestId(resourceName);
GeneralUIUtils.ultimateWait();
GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.LIFECYCLE_STATE.getValue());
@@ -104,7 +102,7 @@ public class PropertiesAssignmentPage {
}
public static void findInput(String componentName, String resourceName) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + componentName + "_" + resourceName + " in homepage");
+ SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + componentName + "_" + resourceName + " on Inputs screen");
WebElement searchTextbox = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesAssignmentScreen.SEARCH_BOX.getValue());
String searchPattern = componentName + "_" + resourceName;
try{
@@ -120,7 +118,7 @@ public class PropertiesAssignmentPage {
}
public static void findProperty(String resourceName) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + resourceName + " in homepage");
+ SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + resourceName + " property on Properties screen");
WebElement searchTextbox = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesAssignmentScreen.SEARCH_BOX.getValue());
try{
@@ -146,4 +144,69 @@ public class PropertiesAssignmentPage {
}
+ //Filter Actions
+ public static void clickOnFilterButton() {
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Filter button "));
+ GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_BUTTON.getValue());
+ GeneralUIUtils.ultimateWait();
+ }
+
+ public static void clickOnFilterAllCheckbox() {
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Filter All Checkbox "));
+ GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_CHECKBOX_ALL.getValue());
+ GeneralUIUtils.ultimateWait();
+ }
+
+ public static void clickOnFilterCPCheckbox() {
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Filter CP Checkbox "));
+ GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_CHECKBOX_CP.getValue());
+ GeneralUIUtils.ultimateWait();
+ }
+
+ public static void clickOnFilterVfcCheckbox() {
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Filter VFC Checkbox "));
+ GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_CHECKBOX_VFC.getValue());
+ GeneralUIUtils.ultimateWait();
+ }
+
+ public static void clickOnFilterVlCheckbox() {
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Filter VL Checkbox "));
+ GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_CHECKBOX_VL.getValue());
+ GeneralUIUtils.ultimateWait();
+ }
+
+ public static void clickOnFilterApplyButton(){
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Filter Apply Button"));
+ GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_APPLY_BUTTON.getValue());
+ GeneralUIUtils.ultimateWait();
+ }
+
+ public static void clickOnFilterCloseButton(){
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Filter Close Button"));
+ GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_CLOSE_BUTTON.getValue());
+ GeneralUIUtils.ultimateWait();
+ }
+
+ public static void clickOnFilterClearAllButton(){
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Filter Clear All Button"));
+ GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.CLEAR_FILTER_BUTTON.getValue());
+ GeneralUIUtils.ultimateWait();
+ }
+
+ public static void findFilterBoxAndClick(String resourceName) throws Exception {
+ SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + resourceName + " property in Properties table");
+ WebElement searchTextbox = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesAssignmentScreen.FILTER_BOX.getValue());
+ try{
+ searchTextbox.clear();
+ searchTextbox.sendKeys(resourceName);
+ GeneralUIUtils.ultimateWait();
+ }
+ catch(Exception e){
+ SetupCDTest.getExtendTest().log(Status.INFO, "Can't interact with search bar");
+ e.printStackTrace();
+ }
+
+ }
+
+
}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ArtifactUIUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ArtifactUIUtils.java
index 2f581cc009..501a7471a5 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ArtifactUIUtils.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ArtifactUIUtils.java
@@ -38,6 +38,7 @@ import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
import org.openecomp.sdc.be.datatypes.elements.HeatParameterDataDefinition;
import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
@@ -502,7 +503,7 @@ public final class ArtifactUIUtils {
Map<String, Object> mapExpectedFile = FileHandling.parseYamlFileToMapByPattern(expectedFile, pattern);
Map<String, Object> mapActualFile = FileHandling.parseYamlFileToMapByPattern(actualFile, pattern);
SetupCDTest.getExtendTest().log(Status.INFO, "Going to compare file " + expectedFile.getName());
- assertTrue("File" + actualFile.getName() + " contains different parameters number from expected file", mapActualFile.size() == mapExpectedFile.size());
+ assertTrue("File " + actualFile.getName() + " contains different parameters number from expected file", mapActualFile.size() == mapExpectedFile.size());
assertTrue("File " + actualFile.getName() + " does not contains all expected parameters", mapActualFile.entrySet().containsAll(mapExpectedFile.entrySet()));
}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/FileHandling.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/FileHandling.java
index cbe3283a66..d455243227 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/FileHandling.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/FileHandling.java
@@ -48,6 +48,7 @@ import org.openecomp.sdc.be.model.DataTypeDefinition;
import org.openecomp.sdc.ci.tests.config.Config;
import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
+import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
import org.openecomp.sdc.common.util.GeneralUtility;
import org.yaml.snakeyaml.Yaml;
@@ -209,6 +210,9 @@ public class FileHandling {
for (File file : dir.listFiles(extensionFilter)) {
filenames.add(file.getName());
}
+
+ filenames.removeAll(OnboardingUtils.exludeVnfList);
+
return filenames;
}
@@ -222,21 +226,21 @@ public class FileHandling {
try{
ZipFile zipFile = new ZipFile(filepath + File.separator + zipFilename);
Enumeration<? extends ZipEntry> entries = zipFile.entries();
-
- String[] artifactNames = new String[zipFile.size() - 1];
- int i = 0;
+ List<String> artifactNames = new ArrayList<String>();
+
while(entries.hasMoreElements()){
ZipEntry nextElement = entries.nextElement();
if (!nextElement.isDirectory()){
if (!nextElement.getName().equals("MANIFEST.json")){
String name = nextElement.getName();
- artifactNames[i++] = name;
+ artifactNames.add(name);
}
}
}
zipFile.close();
- return artifactNames;
+ // convert list to array
+ return artifactNames.toArray(new String[0]);
}
catch(ZipException zipEx){
System.err.println("Error in zip file named : " + zipFilename);
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/GeneralUIUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/GeneralUIUtils.java
index 526ed7a8f4..f198ed98a1 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/GeneralUIUtils.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/GeneralUIUtils.java
@@ -20,8 +20,19 @@
package org.openecomp.sdc.ci.tests.utilities;
-import java.awt.Robot;
-import java.awt.Toolkit;
+import com.aventstack.extentreports.Status;
+import org.apache.commons.io.FileUtils;
+import org.openecomp.sdc.ci.tests.datatypes.CatalogFilterTitlesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
+import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.DashboardCardEnum;
+import org.openecomp.sdc.ci.tests.execute.setup.DriverFactory;
+import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
+import org.openqa.selenium.*;
+import org.openqa.selenium.firefox.FirefoxDriver;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.ui.*;
+
+import java.awt.*;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.event.KeyEvent;
@@ -34,30 +45,6 @@ import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
-import org.apache.commons.io.FileUtils;
-import org.openecomp.sdc.ci.tests.datatypes.CatalogFilterTitlesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.DashboardCardEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.DriverFactory;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openqa.selenium.By;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.Keys;
-import org.openqa.selenium.NoSuchElementException;
-import org.openqa.selenium.OutputType;
-import org.openqa.selenium.TakesScreenshot;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.firefox.FirefoxDriver;
-import org.openqa.selenium.interactions.Actions;
-import org.openqa.selenium.support.ui.ExpectedCondition;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.FluentWait;
-import org.openqa.selenium.support.ui.Select;
-import org.openqa.selenium.support.ui.WebDriverWait;
-
-import com.aventstack.extentreports.Status;
-
public final class GeneralUIUtils {
@@ -164,6 +151,13 @@ public final class GeneralUIUtils {
return true;
}
+ public static boolean isWebElementExistByClass(String className) {
+ if(getDriver().findElements(By.className(className)).size() == 0) {
+ return false;
+ }
+ return true;
+ }
+
public static WebElement getInputElement(String dataTestId) {
try{
ultimateWait();
@@ -180,6 +174,7 @@ public final class GeneralUIUtils {
}
+
public static WebElement getWebElementBy(By by) {
return getWebElementBy(by, timeOut);
}
@@ -274,6 +269,18 @@ public final class GeneralUIUtils {
clickOnElementByTestIdWithoutWait(dataTestId);
ultimateWait();
}
+
+ public static void clickOnElementByClassName(String className) {
+ WebDriverWait wait = new WebDriverWait(getDriver(), timeOut);
+ wait.until(ExpectedConditions.elementToBeClickable(By.className(className))).click();
+ ultimateWait();
+ }
+
+ public static void clickOnElementById(String id) {
+ WebDriverWait wait = new WebDriverWait(getDriver(), timeOut);
+ wait.until(ExpectedConditions.elementToBeClickable(By.id(id))).click();
+ ultimateWait();
+ }
public static void clickOnElementByTestIdWithoutWait(String dataTestId) {
WebDriverWait wait = new WebDriverWait(getDriver(), timeOut);
@@ -790,5 +797,59 @@ public final class GeneralUIUtils {
Object elementAttributes = getAllElementAttributes(getDriver().findElement(By.cssSelector(cssString)));
return elementAttributes.toString().contains("disabled");
}
+
+ public static void setTextInElementByDataTestID(String dataTestsID, String text)
+ {
+ WebElement webElement = GeneralUIUtils.getWebElementByTestID(dataTestsID);
+ webElement.clear();
+ webElement.sendKeys(text);
+ ultimateWait();
+ }
+
+ public static void selectByValueTextContained(String dataTestsId, String value) {
+
+ List<WebElement> options = GeneralUIUtils.getWebElementsListBy(By.xpath(String.format("//select[@data-tests-id='%s']//option[contains(@value,'%s')]",dataTestsId,value)));
+
+ boolean matched = false;
+ for (WebElement option : options) {
+ option.click();
+ matched = true;
+ }
+
+ if (!matched) {
+ throw new NoSuchElementException("Cannot locate option with value: " + value);
+ }
+
+ ultimateWait();
+ }
+
+ public static void setTextInElementByXpath(String xPath, String text)
+ {
+ WebElement webElement = GeneralUIUtils.getWebElementBy(By.xpath(xPath));
+ webElement.clear();
+ webElement.click();
+ webElement.sendKeys(text);
+ ultimateWait();
+ }
+
+ public static String getTextValueFromInput(WebElement webElement)
+ {
+ return webElement.getAttribute("value");
+ }
+
+ public static String getTextValueFromWebElementByXpath(String Xpath)
+ {
+ WebElement webElement = getWebElementBy(By.xpath(Xpath));
+ return webElement.getAttribute("value");
+ }
+
+ public static void refreshPage(){
+ Actions actions = new Actions(getDriver());
+ actions.keyDown(Keys.CONTROL).sendKeys(Keys.F5).perform();
+ }
+
+
+
+
}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/HomeUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/HomeUtils.java
index ca4dd567d6..b40ebf86fc 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/HomeUtils.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/HomeUtils.java
@@ -20,6 +20,7 @@
package org.openecomp.sdc.ci.tests.utilities;
+import com.aventstack.extentreports.Status;
import org.openecomp.sdc.ci.tests.datatypes.CheckBoxStatusEnum;
import org.openecomp.sdc.ci.tests.datatypes.CreateAndImportButtonsEnum;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
@@ -29,7 +30,7 @@ import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
-import com.aventstack.extentreports.Status;
+import java.util.List;
public final class HomeUtils {
@@ -110,7 +111,28 @@ public final class HomeUtils {
Assert.fail(msg);
}
}
-
-
+ public static void findComponentAndClickByVersion(String componentName, String version) throws Exception {
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("finding component %s v%s", componentName, version));
+ GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtons.SEARCH_BOX.getValue()).sendKeys(componentName);
+ List<WebElement> foundComp = null;
+ try {
+ foundComp = GeneralUIUtils.getWebElementsListByTestID(componentName + "Version");
+
+ for (WebElement webElement : foundComp)
+ {
+ if(webElement.getText().contains(version))
+ {
+ webElement.click();
+ GeneralUIUtils.ultimateWait();
+ break;
+ }
+ }
+ } catch (Exception e) {
+ String msg = String.format("DID NOT FIND A COMPONENT NAMED %s", componentName);
+ SetupCDTest.getExtendTest().log(Status.FAIL, msg);
+ System.out.println(msg);
+ Assert.fail(msg);
+ }
+ }
}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUiUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUiUtils.java
index b610cf1c54..e2956774bf 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUiUtils.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUiUtils.java
@@ -20,746 +20,34 @@
package org.openecomp.sdc.ci.tests.utilities;
-import static org.testng.AssertJUnit.assertEquals;
-
-import java.io.File;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
+import com.aventstack.extentreports.Status;
+import com.clearspring.analytics.util.Pair;
import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.datatypes.*;
import org.openecomp.sdc.ci.tests.execute.devCI.ArtifactFromCsar;
import org.openecomp.sdc.ci.tests.execute.setup.ArtifactsCorrelationManager;
import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
import org.openecomp.sdc.ci.tests.pages.HomePage;
import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.general.VendorLicenseModelRestUtils;
+import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
-import com.aventstack.extentreports.Status;
-import com.clearspring.analytics.util.Pair;
-
-
-
-
-
-
-
+import java.io.File;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
public class OnboardingUiUtils {
-// /**
-// * excluded VNF file list
-// */
-// protected static List<String> exludeVnfList =
-//// new ArrayList<String>();
-//
-// Arrays.asList(
-//
-//// new VNFs
-// "Vhss-epc-rdm3-lab-vf-0921-v2.0-MOBILITY-10-20.zip", "Apndns-1710-vf-v3.0-10-20.zip",
-// "HeatCandidate_2017-09-22_01-48_55Name_2016-182-asbg-nsbg-tsbg-v1.0-(VOIP).zip", "HeatCandidate_2017-09-22_01-47_55Name_2016-182-asbg-nsbg-tsbg-v7.0-(VOIP).zip",
-// "Efmc-dbe-nin-v24.0-VOIP-10-20.zip", "VF_LMSP_v5-062317-V3.0-(Mobility).zip", "base_bwks_nfm_volume-236262502.zip",
-//
-//// newest failed VNFs
-// "HeatCandidate_2017-09-20_15-07_66Name_2016-20-visbc1vf-v4.0-(VOIP).zip",
-// "HeatCandidate_2017-09-20_15-06_66Name_2016-20-visbc1vf-v6.0-(VOIP).zip", "1-Vf-zrdm5bpxtc02-092017-(MOBILITY)_v3.0.zip",
-// "2-Vf-zrdm5bpxtc02-092017-(MOBILITY)_v2.0.zip", "1-2017-491-4vshaken-HTTP-CM-vf-(VOIP)_v2.0.zip"
-//
-// );
-//
-// /**
-// * additional files to exludeVnfList files for tosca parser tests
-// */
-// protected static List<String> exludeVnfListForToscaParser = new ArrayList<String>();
-// //Arrays.asList("2016-043_vsaegw_fdnt_30_1607_e2e.zip", "vIRC_CC.zip",
-//// "2016-045_vlb_lmsp_30_1607_e2e.zip", "2016-050_vdns_vmdns_30_1607_e2e.zip",
-//// "2016-247_mns_mns_30_1610_e2e.zip", "2016-044_vfw_fcgi_30_1607_e2e.zip");
-
- public OnboardingUiUtils() {
- }
-
-// public static Pair<String, Map<String, String>> createVendorSoftwareProduct(ResourceReqDetails resourceReqDetails, String heatFileName, String filepath, User user, AmdocsLicenseMembers amdocsLicenseMembers, Map<CvfcTypeEnum, String> cvfcArtifacts)
-// throws Exception {
-//
-// Pair<String, Map<String, String>> pair = createVSP(resourceReqDetails, heatFileName, filepath, user, amdocsLicenseMembers);
-// String vspid = pair.right.get("vspId");
-// if(cvfcArtifacts != null && ! cvfcArtifacts.isEmpty()){
-// OnboardingUiUtils.addCvfcArtifacts(cvfcArtifacts, vspid, user, null);
-//
-// }
-// prepareVspForUse(user, vspid, "0.1");
-// return pair;
-// }
-
- public static void prepareVspForUse(User user, String vspid, String vspVersion) throws Exception {
-
- RestResponse checkin = OnboardingUtils.checkinVendorSoftwareProduct(vspid, user, vspVersion);
- assertEquals("did not succeed to checking new VSP", 200, checkin.getErrorCode().intValue());
-
- RestResponse submit = OnboardingUtils.submitVendorSoftwareProduct(vspid, user, vspVersion);
- assertEquals("did not succeed to submit new VSP", 200, submit.getErrorCode().intValue());
-
- RestResponse createPackage = OnboardingUtils.createPackageOfVendorSoftwareProduct(vspid, user, vspVersion);
- assertEquals("did not succeed to create package of new VSP ", 200, createPackage.getErrorCode().intValue());
- if(SetupCDTest.getExtendTest() != null){
- SetupCDTest.getExtendTest().log(Status.INFO, "Succeeded in creating the vendor software product");
- }
- }
-
-
-// public static VendorSoftwareProductObject createAndFillVendorSoftwareProduct(ResourceReqDetails resourceReqDetails, String heatFileName, String filePath, User user, AmdocsLicenseMembers amdocsLicenseMembers, Map<CvfcTypeEnum, String> cvfcArtifacts)
-// throws Exception {
-//
-// Pair<String, Map<String, String>> createVendorSoftwareProduct = OnboardingUiUtils.createVendorSoftwareProduct(resourceReqDetails, heatFileName, filePath, user, amdocsLicenseMembers, cvfcArtifacts);
-// VendorSoftwareProductObject vendorSoftwareProductObject = OnboardViaApis.fillVendorSoftwareProductObjectWithMetaData(heatFileName, createVendorSoftwareProduct);
-// return vendorSoftwareProductObject;
-//
-// }
-
-// public static Pair<String, Map<String, String>> createVendorSoftwareProduct(ResourceReqDetails resourceReqDetails, String heatFileName, String filepath, User user, AmdocsLicenseMembers amdocsLicenseMembers)
-// throws Exception {
-//
-// Map<CvfcTypeEnum, String> cvfcArtifacts = new HashMap<>();
-// return createVendorSoftwareProduct(resourceReqDetails, heatFileName, filepath, user, amdocsLicenseMembers, cvfcArtifacts);
-// }
-
-// public static Pair<String, Map<String, String>> createVSP(ResourceReqDetails resourceReqDetails, String heatFileName, String filepath, User user, AmdocsLicenseMembers amdocsLicenseMembers) throws Exception {
-// String vspName = handleFilename(heatFileName);
-//
-// if(SetupCDTest.getExtendTest() != null){
-// SetupCDTest.getExtendTest().log(Status.INFO, "Starting to create the vendor software product");
-// }
-//
-// Pair<RestResponse, Map<String, String>> createNewVspPair = createNewVendorSoftwareProduct(resourceReqDetails, vspName, amdocsLicenseMembers, user);
-// RestResponse createNewVendorSoftwareProduct = createNewVspPair.left;
-// assertEquals("did not succeed to create new VSP", 200,createNewVendorSoftwareProduct.getErrorCode().intValue());
-// String vspid = ResponseParser.getValueFromJsonResponse(createNewVendorSoftwareProduct.getResponse(), "vspId");
-// String componentId = ResponseParser.getValueFromJsonResponse(createNewVendorSoftwareProduct.getResponse(), "componentId");
-//
-// Map<String, String> vspMeta = createNewVspPair.right;
-// Map<String, String> vspObject = new HashMap<String, String>();
-// Iterator<String> iterator = vspMeta.keySet().iterator();
-// while(iterator.hasNext()){
-// Object key = iterator.next();
-// Object value = vspMeta.get(key);
-// vspObject.put(key.toString(), value.toString());
-// }
-// vspObject.put("vspId", vspid);
-// vspObject.put("componentId", componentId);
-// vspObject.put("vendorName", amdocsLicenseMembers.getVendorLicenseName());
-// vspObject.put("attContact", user.getUserId());
-//
-// RestResponse uploadHeatPackage = uploadHeatPackage(filepath, heatFileName, vspid, user, "0.1");
-// assertEquals("did not succeed to upload HEAT package", 200, uploadHeatPackage.getErrorCode().intValue());
-//
-// RestResponse validateUpload = validateUpload(vspid, user, "0.1");
-// assertEquals("did not succeed to validate upload process, reason: " + validateUpload.getResponse(), 200, validateUpload.getErrorCode().intValue());
-//
-// Pair<String, Map<String, String>> pair = new Pair<String, Map<String, String>>(vspName, vspObject);
-//
-// return pair;
-// }
-
-// public static void updateVspWithVfcArtifacts(String filepath, String vspId, String updatedSnmpPoll, String updatedSnmpTrap, String componentId, User user, String vspVersion) throws Exception{
-// RestResponse checkout = checkoutVendorSoftwareProduct(vspId, user, vspVersion);
-// assertEquals("did not succeed to checkout new VSP", 200, checkout.getErrorCode().intValue());
-// ExtentTestActions.log(Status.INFO, "Deleting SNMP POLL");
-// deleteArtifactByType(componentId, vspId, user, CvfcTypeEnum.SNMP_POLL);
-// ExtentTestActions.log(Status.INFO, "Deleting SNMP TRAP");
-// deleteArtifactByType(componentId, vspId, user, CvfcTypeEnum.SNMP_TRAP);
-// addVFCArtifacts(filepath, updatedSnmpPoll, updatedSnmpTrap, vspId, user, componentId);
-// prepareVspForUse(user, vspId, vspVersion);
-// }
-
- public static String updateVendorSoftwareProduct(String vspId, String HeatFileName, String filepath, User user, String vspVersion)
- throws Exception, Throwable {
- String vspName = OnboardingUtils.handleFilename(HeatFileName);
- SetupCDTest.getExtendTest().log(Status.INFO, "Starting to update the vendor software product");
-
- RestResponse checkout = OnboardingUtils.checkoutVendorSoftwareProduct(vspId, user, vspVersion);
- assertEquals("did not succeed to checkout new VSP", 200, checkout.getErrorCode().intValue());
-
- RestResponse uploadHeatPackage = OnboardingUtils.uploadHeatPackage(filepath, HeatFileName, vspId, user, vspVersion);
- assertEquals("did not succeed to upload HEAT package", 200, uploadHeatPackage.getErrorCode().intValue());
-
- RestResponse validateUpload = OnboardingUtils.validateUpload(vspId, user, vspVersion);
- assertEquals("did not succeed to validate upload process", 200, validateUpload.getErrorCode().intValue());
-
- RestResponse checkin = OnboardingUtils.checkinVendorSoftwareProduct(vspId, user, vspVersion);
- assertEquals("did not succeed to checking VSP", 200, checkin.getErrorCode().intValue());
-
- RestResponse submit = OnboardingUtils.submitVendorSoftwareProduct(vspId, user, vspVersion);
- assertEquals("did not succeed to submit VSP", 200, submit.getErrorCode().intValue());
-
- RestResponse createPackage = OnboardingUtils.createPackageOfVendorSoftwareProduct(vspId, user, vspVersion);
- assertEquals("did not succeed to update package of VSP ", 200, createPackage.getErrorCode().intValue());
-
- SetupCDTest.getExtendTest().log(Status.INFO, "Succeeded in updating the vendor software product");
-
- return vspName;
- }
-
-// public static void updateVendorSoftwareProductToNextVersion(VendorSoftwareProductObject vendorSoftwareProductObject, String toVspVersion, User user)
-// throws Exception, Throwable {
-//
-// RestResponse checkout = checkoutVendorSoftwareProduct(vendorSoftwareProductObject.getVspId(), user, vendorSoftwareProductObject.getVersion());
-// assertEquals("did not succeed to checkout new VSP", 200, checkout.getErrorCode().intValue());
-//
-// RestResponse checkin = checkinVendorSoftwareProduct(vendorSoftwareProductObject.getVspId(), user, vendorSoftwareProductObject.getVersion());
-// assertEquals("did not succeed to checking VSP", 200, checkin.getErrorCode().intValue());
-//
-// RestResponse submit = submitVendorSoftwareProduct(vendorSoftwareProductObject.getVspId(), user, vendorSoftwareProductObject.getVersion());
-// assertEquals("did not succeed to submit VSP", 200, submit.getErrorCode().intValue());
-//
-// vendorSoftwareProductObject.setVersion(toVspVersion);
-// }
-
-// public static String handleFilename(String heatFileName) {
-// final String namePrefix = String.format("%sVFOnboarded-", ElementFactory.getResourcePrefix());
-// final String nameSuffix = "-" + getShortUUID();
-//
-// String subHeatFileName = heatFileName.substring(0, heatFileName.lastIndexOf("."));
-//
-// if ((namePrefix + subHeatFileName + nameSuffix).length() >= 50) {
-// subHeatFileName = subHeatFileName.substring(0, 50 - namePrefix.length() - nameSuffix.length());
-// }
-//
-// if (subHeatFileName.contains("(") || subHeatFileName.contains(")")) {
-// subHeatFileName = subHeatFileName.replace("(", "-");
-// subHeatFileName = subHeatFileName.replace(")", "-");
-// }
-//
-// String vnfName = namePrefix + subHeatFileName + nameSuffix;
-// return vnfName;
-// }
-
-// public static String addVFCArtifacts(String filepath, String snmpPoll, String snmpTrap, String vspid, User user, String vspComponentId) throws Exception{
-// vspComponentId = (vspComponentId == null) ? getVSPComponentId(vspid, user) : vspComponentId;
-// if (vspComponentId != null){
-// if (snmpPoll != null){
-// ExtentTestActions.log(Status.INFO, "Adding VFC artifact of type SNMP POLL with the file " + snmpPoll);
-// RestResponse uploadSnmpPollArtifact = uploadSnmpPollArtifact(filepath, snmpPoll, vspid, user, vspComponentId);
-// assertEquals("Did not succeed to add SNMP POLL", 200, uploadSnmpPollArtifact.getErrorCode().intValue());
-// }
-// if (snmpTrap != null){
-// ExtentTestActions.log(Status.INFO, "Adding VFC artifact of type SNMP TRAP with the file " + snmpTrap);
-// RestResponse uploadSnmpTrapArtifact = uploadSnmpTrapArtifact(filepath, snmpTrap, vspid, user, vspComponentId);
-// assertEquals("Did not succeed to add SNMP TRAP", 200, uploadSnmpTrapArtifact.getErrorCode().intValue());
-// }
-// }
-//
-// return vspComponentId;
-// }
-
-// public static String addCvfcArtifacts(Map<CvfcTypeEnum, String> componentVfcArtifacts, String vspid, User user, String vspComponentId) throws Exception{
-// vspComponentId = (vspComponentId == null) ? getVSPComponentId(vspid, user) : vspComponentId;
-// if (vspComponentId != null){
-// for(Entry<CvfcTypeEnum, String> entry : componentVfcArtifacts.entrySet()){
-// ExtentTestActions.log(Status.INFO, "Adding VFC artifact of type " + entry.getKey().getValue() + " with the file " + entry.getValue());
-// RestResponse uploadSnmpPollArtifact = uploadCvfcArtifact(entry.getValue(), entry.getKey().getValue(), vspid, user, vspComponentId);
-// assertEquals("Did not succeed to add " + entry.getKey().getValue(), BaseRestUtils.STATUS_CODE_SUCCESS, uploadSnmpPollArtifact.getErrorCode().intValue());
-// }
-// }
-// return vspComponentId;
-// }
-
-// public static String addVFCArtifacts(String filepath, String snmpPoll, String snmpTrap, String vspid, User user) throws Exception{
-// return addVFCArtifacts(filepath, snmpPoll, snmpTrap, vspid, user, null);
-// }
-
-// public static RestResponse uploadCvfcArtifact(String filepath, String cvfcType, String vspid, User user, String vspComponentId) throws FileNotFoundException, IOException, ClientProtocolException {
-// Config config = Utils.getConfig();
-// String snmpPollUrl = String.format(Urls.UPLOAD_AMDOCS_ARTIFACT, config.getCatalogBeHost(),config.getCatalogBePort(), vspid, vspComponentId, cvfcType);
-// return uploadFile(filepath, null, snmpPollUrl, user);
-// }
-
-// private static RestResponse uploadSnmpPollArtifact(String filepath, String zipArtifact, String vspid, User user,
-// String vspComponentId) throws FileNotFoundException, IOException, ClientProtocolException {
-// Config config = Utils.getConfig();
-// String snmpPollUrl = String.format(Urls.UPLOAD_SNMP_POLL_ARTIFACT, config.getCatalogBeHost(),config.getCatalogBePort(), vspid, vspComponentId);
-// return uploadFile(filepath, zipArtifact, snmpPollUrl, user);
-// }
-
-// private static RestResponse uploadSnmpTrapArtifact(String filepath, String zipArtifact, String vspid, User user,
-// String vspComponentId) throws FileNotFoundException, IOException, ClientProtocolException {
-// Config config = Utils.getConfig();
-// String snmpTrapUrl = String.format(Urls.UPLOAD_SNMP_POLL_ARTIFACT, config.getCatalogBeHost(),config.getCatalogBePort(), vspid, vspComponentId);
-// return uploadFile(filepath, zipArtifact, snmpTrapUrl, user);
-// }
-
-// private static RestResponse deleteArtifactByType(String componentId, String vspId, User user, CvfcTypeEnum snmpType) throws Exception
-// {
-// Config config = Utils.getConfig();
-// String url = String.format(Urls.DELETE_AMDOCS_ARTIFACT_BY_TYPE, config.getCatalogBeHost(),config.getCatalogBePort(), vspId, componentId, snmpType.getValue());
-// String userId = user.getUserId();
-// Map<String, String> headersMap = prepareHeadersMap(userId);
-//
-// HttpRequest http = new HttpRequest();
-// RestResponse response = http.httpSendDelete(url, headersMap);
-// return response;
-// }
-
-// private static String getVSPComponentId(String vspid, User user) throws Exception, JSONException {
-// RestResponse components = getVSPComponents(vspid, user);
-// String response = components.getResponse();
-// Map<String, Object> responseMap = (Map<String, Object>) JSONValue.parse(response);
-// JSONArray results = (JSONArray)responseMap.get("results");
-// for (Object res : results){
-// Map<String, Object> compMap= (Map<String, Object>) JSONValue.parse(res.toString());
-// String componentId = compMap.get("id").toString();
-// return componentId;
-// }
-// return null;
-// }
-
-// private static RestResponse getVSPComponents(String vspid, User user) throws Exception{
-// Config config = Utils.getConfig();
-// String url = String.format(Urls.GET_VSP_COMPONENTS, config.getCatalogBeHost(),config.getCatalogBePort(), vspid);
-// String userId = user.getUserId();
-//
-// Map<String, String> headersMap = prepareHeadersMap(userId);
-//
-// HttpRequest http = new HttpRequest();
-// RestResponse response = http.httpSendGet(url, headersMap);
-// return response;
-// }
-
-// private static RestResponse getVSPComponentByVersion(String vspId, String vspVersion, User user) throws Exception{
-// Config config = Utils.getConfig();
-// String url = String.format(Urls.GET_VSP_COMPONENT_BY_VERSION, config.getCatalogBeHost(),config.getCatalogBePort(), vspId,vspVersion);
-// String userId = user.getUserId();
-//
-// Map<String, String> headersMap = prepareHeadersMap(userId);
-//
-// HttpRequest http = new HttpRequest();
-// RestResponse response = http.httpSendGet(url, headersMap);
-// return response;
-// }
-
-// private static RestResponse getVLMComponentByVersion(String vlmId, String vlmVersion, User user) throws Exception{
-// Config config = Utils.getConfig();
-// String url = String.format(Urls.GET_VLM_COMPONENT_BY_VERSION, config.getCatalogBeHost(),config.getCatalogBePort(), vlmId,vlmVersion);
-// String userId = user.getUserId();
-//
-// Map<String, String> headersMap = prepareHeadersMap(userId);
-//
-// HttpRequest http = new HttpRequest();
-// RestResponse response = http.httpSendGet(url, headersMap);
-// return response;
-// }
-
-// public static boolean validateVspExist(String vspId, String vspVersion, User user) throws Exception {
-// RestResponse restResponse = getVSPComponentByVersion(vspId, vspVersion, user);
-// assertEquals(String.format("Vsp version not updated, reponse message: %s", restResponse.getResponse()),restResponse.getErrorCode().intValue(),200);
-// return (restResponse.getErrorCode()==200);
-// }
-//
-// public static boolean validateVlmExist(String vlmId, String vlmVersion, User user) throws Exception {
-// RestResponse restResponse = getVLMComponentByVersion(vlmId, vlmVersion, user);
-// assertEquals(String.format("VLM version not updated, reponse code message: %s", restResponse.getResponse()),restResponse.getErrorCode().intValue(),200);
-// return (restResponse.getErrorCode()==200);
-// }
-
- public static AmdocsLicenseMembers createVendorLicense(User user) throws Exception {
-
- AmdocsLicenseMembers amdocsLicenseMembers;
- if(SetupCDTest.getExtendTest() != null){
- SetupCDTest.getExtendTest().log(Status.INFO, "Starting to create the vendor license");
- }
- String vendorLicenseName = "ciLicense" + OnboardingUtils.getShortUUID();
- RestResponse vendorLicenseResponse = OnboardingUtils.createVendorLicenseModels_1(vendorLicenseName, user);
- assertEquals("did not succeed to create vendor license model", 200, vendorLicenseResponse.getErrorCode().intValue());
- String vendorId = ResponseParser.getValueFromJsonResponse(vendorLicenseResponse.getResponse(), "value");
-
- RestResponse vendorKeyGroupsResponse = OnboardingUtils.createVendorKeyGroups_2(vendorId, user);
- assertEquals("did not succeed to create vendor key groups", 200, vendorKeyGroupsResponse.getErrorCode().intValue());
- String keyGroupId = ResponseParser.getValueFromJsonResponse(vendorKeyGroupsResponse.getResponse(), "value");
-
- RestResponse vendorEntitlementPool = OnboardingUtils.createVendorEntitlementPool_3(vendorId, user);
- assertEquals("did not succeed to create vendor entitlement pool", 200, vendorEntitlementPool.getErrorCode().intValue());
- String entitlementPoolId = ResponseParser.getValueFromJsonResponse(vendorEntitlementPool.getResponse(), "value");
-
- RestResponse vendorLicenseFeatureGroups = OnboardingUtils.createVendorLicenseFeatureGroups_4(vendorId, keyGroupId, entitlementPoolId, user);
- assertEquals("did not succeed to create vendor license feature groups", 200, vendorLicenseFeatureGroups.getErrorCode().intValue());
- String featureGroupId = ResponseParser.getValueFromJsonResponse(vendorLicenseFeatureGroups.getResponse(), "value");
-
- RestResponse vendorLicenseAgreement = OnboardingUtils.createVendorLicenseAgreement_5(vendorId, featureGroupId, user);
- assertEquals("did not succeed to create vendor license agreement", 200, vendorLicenseAgreement.getErrorCode().intValue());
- String vendorLicenseAgreementId = ResponseParser.getValueFromJsonResponse(vendorLicenseAgreement.getResponse(), "value");
-
- RestResponse checkinVendorLicense = OnboardingUtils.checkinVendorLicense(vendorId, user, "0.1");
- assertEquals("did not succeed to checkin vendor license", 200, checkinVendorLicense.getErrorCode().intValue());
-
- RestResponse submitVendorLicense = OnboardingUtils.submitVendorLicense(vendorId, user, "0.1");
- assertEquals("did not succeed to submit vendor license", 200, submitVendorLicense.getErrorCode().intValue());
-
- if(SetupCDTest.getExtendTest() != null){
- SetupCDTest.getExtendTest().log(Status.INFO, "Succeeded in creating the vendor license");
- }
-
- amdocsLicenseMembers = new AmdocsLicenseMembers(vendorId, vendorLicenseName, vendorLicenseAgreementId, featureGroupId);
- amdocsLicenseMembers.setVersion("1.0"); // Once object created and submitted, his initial version is 1.0
-
- return amdocsLicenseMembers;
- }
-
-// public static void updateVendorLicense(AmdocsLicenseMembers amdocsLicenseMembers, User user, String vlmVersion) throws Exception {
-//
-// RestResponse checkoutVendorLicense = checkoutVendorLicense(amdocsLicenseMembers.getVendorId(), user, vlmVersion);
-// assertEquals("did not succeed to checkout vendor license", 200, checkoutVendorLicense.getErrorCode().intValue());
-//
-// RestResponse checkinVendorLicense = checkinVendorLicense(amdocsLicenseMembers.getVendorId(), user, vlmVersion);
-// assertEquals("did not succeed to checkin vendor license", 200, checkinVendorLicense.getErrorCode().intValue());
-//
-// RestResponse submitVendorLicense = submitVendorLicense(amdocsLicenseMembers.getVendorId(), user, vlmVersion);
-// assertEquals("did not succeed to submit vendor license", 200, submitVendorLicense.getErrorCode().intValue());
-//
-// if(SetupCDTest.getExtendTest() != null){
-// SetupCDTest.getExtendTest().log(Status.INFO, "Succeeded in updating the vendor license");
-// }
-// }
-
-
-// private static String getShortUUID() {
-// return UUID.randomUUID().toString().split("-")[0];
-// }
-
-// private static RestResponse actionOnComponent(String vspid, String action, String onboardComponent, User user, String componentVersion)
-// throws Exception {
-// Config config = Utils.getConfig();
-// String url = String.format(Urls.ACTION_ON_COMPONENT, config.getCatalogBeHost(), config.getCatalogBePort(), onboardComponent, vspid, componentVersion);
-// String userId = user.getUserId();
-//
-// JSONObject jObject = new JSONObject();
-// jObject.put("action", action);
-//
-// Map<String, String> headersMap = prepareHeadersMap(userId);
-//
-// HttpRequest http = new HttpRequest();
-// RestResponse response = http.httpSendPut(url, jObject.toString(), headersMap);
-// return response;
-// }
-
-// public static RestResponse checkinVendorLicense(String vspid, User user, String vlmVersion) throws Exception {
-// return actionOnComponent(vspid, "Checkin", "vendor-license-models", user, vlmVersion);
-// }
-//
-// public static RestResponse checkoutVendorLicense(String vspid, User user, String vlmVersion) throws Exception {
-// return actionOnComponent(vspid, "Checkout", "vendor-license-models", user, vlmVersion);
-// }
-//
-// public static RestResponse submitVendorLicense(String vspid, User user, String vlmVersion) throws Exception {
-// return actionOnComponent(vspid, "Submit", "vendor-license-models", user, vlmVersion);
-// }
-
-// public static RestResponse createVendorLicenseModels_1(String name, User user) throws Exception {
-// Config config = Utils.getConfig();
-// String url = String.format(Urls.CREATE_VENDOR_LISENCE_MODELS, config.getCatalogBeHost(),
-// config.getCatalogBePort());
-// String userId = user.getUserId();
-//
-// JSONObject jObject = new JSONObject();
-// jObject.put("vendorName", name);
-// jObject.put("description", "new vendor license model");
-// jObject.put("iconRef", "icon");
-//
-// Map<String, String> headersMap = prepareHeadersMap(userId);
-//
-// HttpRequest http = new HttpRequest();
-// RestResponse response = http.httpSendPost(url, jObject.toString(), headersMap);
-// return response;
-//
-// }
-//
-// public static RestResponse createVendorLicenseAgreement_5(String vspid, String featureGroupId, User user)
-// throws Exception {
-// Config config = Utils.getConfig();
-// String url = String.format(Urls.CREATE_VENDOR_LISENCE_AGREEMENT, config.getCatalogBeHost(), config.getCatalogBePort(), vspid);
-// String userId = user.getUserId();
-//
-// JSONObject licenseTermpObject = new JSONObject();
-// licenseTermpObject.put("choice", "Fixed_Term");
-// licenseTermpObject.put("other", "");
-//
-// JSONObject jObjectBody = new JSONObject();
-// jObjectBody.put("name", "abc");
-// jObjectBody.put("description", "new vendor license agreement");
-// jObjectBody.put("requirementsAndConstrains", "abc");
-// jObjectBody.put("licenseTerm", licenseTermpObject);
-// jObjectBody.put("addedFeatureGroupsIds", Arrays.asList(featureGroupId).toArray());
-//
-// Map<String, String> headersMap = prepareHeadersMap(userId);
-//
-// HttpRequest http = new HttpRequest();
-// RestResponse response = http.httpSendPost(url, jObjectBody.toString(), headersMap);
-// return response;
-// }
-//
-// public static RestResponse createVendorLicenseFeatureGroups_4(String vspid, String licenseKeyGroupId,
-// String entitlementPoolId, User user) throws Exception {
-// Config config = Utils.getConfig();
-// String url = String.format(Urls.CREATE_VENDOR_LISENCE_FEATURE_GROUPS, config.getCatalogBeHost(), config.getCatalogBePort(), vspid);
-// String userId = user.getUserId();
-//
-// JSONObject jObject = new JSONObject();
-// jObject.put("name", "xyz");
-// jObject.put("description", "new vendor license feature groups");
-// jObject.put("partNumber", "123abc456");
-// jObject.put("manufacturerReferenceNumber", "5");
-// jObject.put("addedLicenseKeyGroupsIds", Arrays.asList(licenseKeyGroupId).toArray());
-// jObject.put("addedEntitlementPoolsIds", Arrays.asList(entitlementPoolId).toArray());
-//
-// Map<String, String> headersMap = prepareHeadersMap(userId);
-//
-// HttpRequest http = new HttpRequest();
-// RestResponse response = http.httpSendPost(url, jObject.toString(), headersMap);
-// return response;
-//
-// }
-//
-// public static RestResponse createVendorEntitlementPool_3(String vspid, User user) throws Exception {
-// Config config = Utils.getConfig();
-// String url = String.format(Urls.CREATE_VENDOR_LISENCE_ENTITLEMENT_POOL, config.getCatalogBeHost(), config.getCatalogBePort(), vspid);
-// String userId = user.getUserId();
-//
-// JSONObject jEntitlementMetricObject = new JSONObject();
-// jEntitlementMetricObject.put("choice", "CPU");
-// jEntitlementMetricObject.put("other", "");
-//
-// JSONObject jAggregationFunctionObject = new JSONObject();
-// jAggregationFunctionObject.put("choice", "Peak");
-// jAggregationFunctionObject.put("other", "");
-//
-// JSONObject jOperationalScope = new JSONObject();
-// jOperationalScope.put("choices", Arrays.asList("Availability_Zone").toArray());
-// jOperationalScope.put("other", "");
-//
-// JSONObject jTimeObject = new JSONObject();
-// jTimeObject.put("choice", "Hour");
-// jTimeObject.put("other", "");
-//
-// JSONObject jObjectBody = new JSONObject();
-// jObjectBody.put("name", "def"+ getShortUUID());
-// jObjectBody.put("description", "new vendor license entitlement pool");
-// jObjectBody.put("thresholdValue", "23");
-// jObjectBody.put("thresholdUnits", "Absolute");
-// jObjectBody.put("entitlementMetric", jEntitlementMetricObject);
-// jObjectBody.put("increments", "abcd");
-// jObjectBody.put("aggregationFunction", jAggregationFunctionObject);
-// jObjectBody.put("operationalScope", jOperationalScope);
-// jObjectBody.put("time", jTimeObject);
-// jObjectBody.put("manufacturerReferenceNumber", "123aaa");
-//
-// Map<String, String> headersMap = prepareHeadersMap(userId);
-//
-// HttpRequest http = new HttpRequest();
-// RestResponse response = http.httpSendPost(url, jObjectBody.toString(), headersMap);
-// return response;
-// }
-//
-// public static RestResponse createVendorKeyGroups_2(String vspid, User user) throws Exception {
-// Config config = Utils.getConfig();
-// String url = String.format(Urls.CREATE_VENDOR_LISENCE_KEY_GROUPS, config.getCatalogBeHost(), config.getCatalogBePort(), vspid);
-// String userId = user.getUserId();
-//
-// JSONObject jOperationalScope = new JSONObject();
-// jOperationalScope.put("choices", Arrays.asList("Tenant").toArray());
-// jOperationalScope.put("other", "");
-//
-// JSONObject jObjectBody = new JSONObject();
-// jObjectBody.put("name", "keyGroup" + getShortUUID());
-// jObjectBody.put("description", "new vendor license key group");
-// jObjectBody.put("operationalScope", jOperationalScope);
-// jObjectBody.put("type", "Universal");
-//
-// Map<String, String> headersMap = prepareHeadersMap(userId);
-//
-// HttpRequest http = new HttpRequest();
-// RestResponse response = http.httpSendPost(url, jObjectBody.toString(), headersMap);
-// return response;
-// }
-
-// public static Pair<RestResponse, Map<String, String>> createNewVendorSoftwareProduct(ResourceReqDetails resourceReqDetails, String vspName, AmdocsLicenseMembers amdocsLicenseMembers, User user) throws Exception {
-// Map<String, String> vspMetadta = new HashMap<String, String>();
-//
-// Config config = Utils.getConfig();
-// String url = String.format(Urls.CREATE_VENDOR_SOFTWARE_PRODUCT, config.getCatalogBeHost(), config.getCatalogBePort());
-// String userId = user.getUserId();
-// VendorSoftwareProductObject vendorSoftwareProductObject = new VendorSoftwareProductObject();
-// LicensingData licensingData = new LicensingData(amdocsLicenseMembers.getVendorLicenseAgreementId(), Arrays.asList(amdocsLicenseMembers.getFeatureGroupId()));
-// LicensingVersion licensingVersion = new LicensingVersion("1.0", "1.0");
-// ResourceCategoryEnum resourceCategoryEnum = ResourceCategoryEnum.findEnumNameByValues(resourceReqDetails.getCategories().get(0).getName(), resourceReqDetails.getCategories().get(0).getSubcategories().get(0).getName());
-//
-// vendorSoftwareProductObject.setLicensingVersion(licensingVersion);
-//
-// vendorSoftwareProductObject.setName(vspName);
-// vendorSoftwareProductObject.setDescription(resourceReqDetails.getDescription());
-// vendorSoftwareProductObject.setCategory(resourceCategoryEnum.getCategoryUniqeId());
-// vendorSoftwareProductObject.setSubCategory(resourceCategoryEnum.getSubCategoryUniqeId());
-// vendorSoftwareProductObject.setOnboardingMethod("NetworkPackage");
-// vendorSoftwareProductObject.setVendorName(amdocsLicenseMembers.getVendorLicenseName());
-// vendorSoftwareProductObject.setVendorId(amdocsLicenseMembers.getVendorId());
-// vendorSoftwareProductObject.setIcon("icon");
-// vendorSoftwareProductObject.setLicensingData(licensingData);
-//
-// vspMetadta.put("description", resourceReqDetails.getDescription());
-// vspMetadta.put("category", resourceCategoryEnum.getCategory());
-// vspMetadta.put("subCategory", resourceCategoryEnum.getSubCategory());
-//
-// Map<String, String> headersMap = prepareHeadersMap(userId);
-// HttpRequest http = new HttpRequest();
-// Gson gson = new Gson();
-// String body = gson.toJson(vendorSoftwareProductObject);
-//
-// RestResponse response = http.httpSendPost(url, body, headersMap);
-// return new Pair<RestResponse, Map<String, String>>(response, vspMetadta);
-// }
-
-
-// public static RestResponse validateUpload(String vspid, User user, String vspVersion) throws Exception {
-// Config config = Utils.getConfig();
-// String url = String.format(Urls.VALIDATE_UPLOAD, config.getCatalogBeHost(), config.getCatalogBePort(), vspid,vspVersion);
-//
-// String userId = user.getUserId();
-//
-// Map<String, String> headersMap = prepareHeadersMap(userId);
-// HttpRequest http = new HttpRequest();
-//
-// String body =null;
-//
-// RestResponse response = http.httpSendPut(url, body, headersMap);
-//
-// return response;
-// }
-
-// public static RestResponse uploadHeatPackage(String filepath, String filename, String vspid, User user, String vspVersion) throws Exception {
-// Config config = Utils.getConfig();
-// String url = String.format(Urls.UPLOAD_HEAT_PACKAGE, config.getCatalogBeHost(), config.getCatalogBePort(), vspid, vspVersion);
-// return uploadFile(filepath, filename, url, user);
-// }
-
-// private static RestResponse uploadFile(String filepath, String filename, String url, User user)
-// throws FileNotFoundException, IOException, ClientProtocolException {
-// CloseableHttpResponse response = null;
-//
-// MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
-// mpBuilder.addPart("upload", new FileBody(getTestZipFile(filepath, filename)));
-//
-// Map<String, String> headersMap = prepareHeadersMap(user.getUserId());
-// headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "multipart/form-data");
-//
-// CloseableHttpClient client = HttpClients.createDefault();
-// try {
-// HttpPost httpPost = new HttpPost(url);
-// RestResponse restResponse = new RestResponse();
-//
-// Iterator<String> iterator = headersMap.keySet().iterator();
-// while (iterator.hasNext()) {
-// String key = iterator.next();
-// String value = headersMap.get(key);
-// httpPost.addHeader(key, value);
-// }
-// httpPost.setEntity(mpBuilder.build());
-// response = client.execute(httpPost);
-// HttpEntity entity = response.getEntity();
-// String responseBody = null;
-// if (entity != null) {
-// InputStream instream = entity.getContent();
-// try {
-// StringWriter writer = new StringWriter();
-// IOUtils.copy(instream, writer);
-// responseBody = writer.toString();
-// } finally {
-// instream.close();
-// }
-// }
-//
-// restResponse.setErrorCode(response.getStatusLine().getStatusCode());
-// restResponse.setResponse(responseBody);
-//
-// return restResponse;
-//
-// } finally {
-// closeResponse(response);
-// closeHttpClient(client);
-//
-// }
-// }
-
-// private static void closeResponse(CloseableHttpResponse response) {
-// try {
-// if (response != null) {
-// response.close();
-// }
-// } catch (IOException e) {
-// System.out.println(String.format("failed to close client or response: %s", e.getMessage()));
-// }
-// }
-//
-// private static void closeHttpClient(CloseableHttpClient client) {
-// try {
-// if (client != null) {
-// client.close();
-// }
-// } catch (IOException e) {
-// System.out.println(String.format("failed to close client or response: %s", e.getMessage()));
-// }
-// }
-
-// private static File getTestZipFile(String filepath, String filename) throws IOException {
-// Config config = Utils.getConfig();
-// String sourceDir = config.getImportResourceTestsConfigDir();
-// java.nio.file.Path filePath;
-// if(filename == null){
-// filePath = FileSystems.getDefault().getPath(filepath);
-// }else{
-// filePath = FileSystems.getDefault().getPath(filepath + File.separator + filename);
-// }
-// return filePath.toFile();
-// }
-
-// public static RestResponse checkinVendorSoftwareProduct(String vspid, User user, String vspVersion) throws Exception {
-// return actionOnComponent(vspid, "Checkin", "vendor-software-products", user, vspVersion);
-// }
-//
-// private static RestResponse checkoutVendorSoftwareProduct(String vspid, User user, String vspVersion) throws Exception {
-// return actionOnComponent(vspid, "Checkout", "vendor-software-products", user, vspVersion);
-// }
-//
-// public static RestResponse submitVendorSoftwareProduct(String vspid, User user, String vspVersion) throws Exception {
-// return actionOnComponent(vspid, "Submit", "vendor-software-products", user, vspVersion);
-// }
-//
-// public static RestResponse createPackageOfVendorSoftwareProduct(String vspid, User user, String vspVersion) throws Exception {
-// return actionOnComponent(vspid, "Create_Package", "vendor-software-products", user, vspVersion);
-// }
-
-// protected static Map<String, String> prepareHeadersMap(String userId) {
-// Map<String, String> headersMap = new HashMap<String, String>();
-// headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
-// headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
-// headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId);
-// return headersMap;
-// }
-
-
- private static void importUpdateVSP(Pair<String, Map<String, String>> vsp, boolean isUpdate) throws Exception{
+ private static void importUpdateVSP(Pair<String, VendorSoftwareProductObject> vsp, boolean isUpdate) throws Exception{
String vspName = vsp.left;
- Map<String, String> vspMetadata = vsp.right;
+ VendorSoftwareProductObject vspMetadata = vsp.right;
boolean vspFound = HomePage.searchForVSP(vspName);
if (vspFound){
@@ -773,7 +61,6 @@ public class OnboardingUiUtils {
if (isUpdate){
GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ImportVfRepository.UPDATE_VSP.getValue());
-
}
else{
GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ImportVfRepository.IMPORT_VSP.getValue());
@@ -786,7 +73,6 @@ public class OnboardingUiUtils {
try {
ResourceGeneralPage.clickCheckoutButton();
Assert.assertTrue(ResourceGeneralPage.getLifeCycleState().equals(LifeCycleStateEnum.CHECKOUT.getValue()), "Did not succeed to checkout");
-
} catch (Exception e) {
ExtentTestActions.log(Status.ERROR, "Did not succeed to checkout");
e.printStackTrace();
@@ -813,39 +99,36 @@ public class OnboardingUiUtils {
GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.CHECKIN_BUTTON.getValue());
}
- public static void updateVSP(Pair<String, Map<String, String>> vsp) throws Exception{
+ public static void updateVSP(Pair<String, VendorSoftwareProductObject> vsp) throws Exception{
ExtentTestActions.log(Status.INFO, "Updating VSP " + vsp.left);
importUpdateVSP(vsp, true);
}
- public static void importVSP(Pair<String, Map<String, String>> vsp) throws Exception{
+ public static void importVSP(Pair<String, VendorSoftwareProductObject> vsp) throws Exception{
ExtentTestActions.log(Status.INFO, "Importing VSP " + vsp.left);
importUpdateVSP(vsp, false);
}
- public static void updateVnfAndValidate(String filepath, Pair<String, Map<String, String>> vsp, String updatedVnfFile, User user) throws Exception, Throwable {
+ public static void updateVnfAndValidate(String filePath, Pair<String, VendorSoftwareProductObject> vsp, String updatedVnfFile, User user) throws Exception, Throwable {
ExtentTestActions.log(Status.INFO, String.format("Going to update the VNF with %s......", updatedVnfFile));
System.out.println(String.format("Going to update the VNF with %s......", updatedVnfFile));
-
- Map<String, String> vspMap = vsp.right;
- String vspId = vspMap.get("vspId");
-
- updateVendorSoftwareProduct(vspId, updatedVnfFile, filepath, user, "0.1");
+
+ VendorSoftwareProductRestUtils.updateVendorSoftwareProductToNextVersion(vsp.right, user, filePath, updatedVnfFile);
HomePage.showVspRepository();
updateVSP(vsp);
ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
- DeploymentArtifactPage.verifyArtifactsExistInTable(filepath, updatedVnfFile);
+ DeploymentArtifactPage.verifyArtifactsExistInTable(filePath, updatedVnfFile);
}
- public static Pair<String, Map<String, String>> onboardAndValidate(ResourceReqDetails resourceReqDetails, String filepath, String vnfFile, User user) throws Exception {
+ public static Pair<String, VendorSoftwareProductObject> onboardAndValidate(ResourceReqDetails resourceReqDetails, String filepath, String vnfFile, User user) throws Exception {
ExtentTestActions.log(Status.INFO, String.format("Going to onboard the VNF %s", vnfFile));
System.out.println(String.format("Going to onboard the VNF %s", vnfFile));
- AmdocsLicenseMembers amdocsLicenseMembers = createVendorLicense(user);
- Pair<String, Map<String, String>> createVendorSoftwareProduct = OnboardingUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filepath, user, amdocsLicenseMembers);
+ AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(user);
+ Pair<String, VendorSoftwareProductObject> createVendorSoftwareProduct = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filepath, user, amdocsLicenseMembers);
String vspName = createVendorSoftwareProduct.left;
- DownloadManager.downloadCsarByNameFromVSPRepository(vspName, createVendorSoftwareProduct.right.get("vspId"));
+ DownloadManager.downloadCsarByNameFromVSPRepository(vspName, createVendorSoftwareProduct.right.getVspId());
File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir();
ExtentTestActions.log(Status.INFO, String.format("Searching for onboarded %s", vnfFile));
@@ -894,76 +177,4 @@ public class OnboardingUiUtils {
}
}
-// public static VendorSoftwareProductObject updateVSPWithNewVLMParameters(VendorSoftwareProductObject vendorSoftwareProductObject,
-// AmdocsLicenseMembers amdocsLicenseMembers, User user, String vspCurrentVersion, String vspNextVersion) throws Exception {
-//
-// LicensingVersion licensingVersion = new LicensingVersion(amdocsLicenseMembers.getLicenseVersionId(),amdocsLicenseMembers.getLicenseVersionId());
-// LicensingData licensingData = new LicensingData(amdocsLicenseMembers.getVendorLicenseAgreementId(), Arrays.asList(amdocsLicenseMembers.getFeatureGroupId()));
-// vendorSoftwareProductObject.setVendorId(amdocsLicenseMembers.getVendorId());
-// vendorSoftwareProductObject.setVendorName(amdocsLicenseMembers.getVendorLicenseName());
-// vendorSoftwareProductObject.setLicensingVersion(licensingVersion);
-// vendorSoftwareProductObject.setLicensingData(licensingData);
-//
-// VendorSoftwareProductObjectReqDetails vendorSoftwareProductObjectReqDetails = new VendorSoftwareProductObjectReqDetails(
-// vendorSoftwareProductObject.getName(),
-// vendorSoftwareProductObject.getDescription(),
-// vendorSoftwareProductObject.getCategory(),
-// vendorSoftwareProductObject.getSubCategory(),
-// vendorSoftwareProductObject.getVendorId(),
-// vendorSoftwareProductObject.getVendorName(),
-// licensingVersion,
-// licensingData,
-// vendorSoftwareProductObject.getOnboardingMethod(),
-// vendorSoftwareProductObject.getNetworkPackageName(),
-// vendorSoftwareProductObject.getOnboardingOrigin());
-//
-// Gson gson = new Gson();
-// String json = gson.toJson(vendorSoftwareProductObjectReqDetails);
-//
-// RestResponse checkout = checkoutVendorSoftwareProduct(vendorSoftwareProductObject.getVspId(), user, "1.0");
-// assertEquals("did not succeed to checkout new VSP", 200, checkout.getErrorCode().intValue());
-//
-// Config config = Utils.getConfig();
-// String url = String.format(Urls.UPDATE_VSP, config.getCatalogBeHost(), config.getCatalogBePort(), vendorSoftwareProductObject.getVspId(), vspCurrentVersion);
-// String userId = user.getUserId();
-//
-// Map<String, String> headersMap = prepareHeadersMap(userId);
-// HttpRequest http = new HttpRequest();
-//
-// RestResponse response = http.httpSendPut(url, json, headersMap);
-//
-// RestResponse checkin = checkinVendorSoftwareProduct(vendorSoftwareProductObject.getVspId(), user, vspCurrentVersion);
-// assertEquals("did not succeed to checking VSP", 200, checkin.getErrorCode().intValue());
-//
-// RestResponse submit = submitVendorSoftwareProduct(vendorSoftwareProductObject.getVspId(), user, vspCurrentVersion);
-// assertEquals("did not succeed to submit VSP", 200, submit.getErrorCode().intValue());
-//
-// vendorSoftwareProductObject.setVersion(vspNextVersion);
-//
-// return vendorSoftwareProductObject;
-// }
-
-// /**
-// * @return
-// * The method returns VNF names list from Files directory under sdc-vnfs repository
-// */
-// public static List<String> getVnfNamesFileList() {
-// String filepath = FileHandling.getVnfRepositoryPath();
-// List<String> fileNamesFromFolder = FileHandling.getZipFileNamesFromFolder(filepath);
-// fileNamesFromFolder.removeAll(exludeVnfList);
-// return fileNamesFromFolder;
-// }
-//
-// /**
-// * @return
-// * The method returns VNF names list from Files directory under sdc-vnfs repository excluding zip files that known as failed in tosca parser
-// */
-// public static List<String> getVnfNamesFileListExcludeToscaParserFailure() {
-// List<String> fileNamesFromFolder = getVnfNamesFileList();
-// fileNamesFromFolder.removeAll(exludeVnfListForToscaParser);
-// return fileNamesFromFolder;
-// }
-
}
-
-
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/PortMirroringUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/PortMirroringUtils.java
new file mode 100644
index 0000000000..404325190e
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/PortMirroringUtils.java
@@ -0,0 +1,132 @@
+package org.openecomp.sdc.ci.tests.utilities;
+
+import com.aventstack.extentreports.Status;
+import com.clearspring.analytics.util.Pair;
+import fj.data.Either;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.*;
+import org.openecomp.sdc.ci.tests.datatypes.*;
+import org.openecomp.sdc.ci.tests.datatypes.enums.CircleSize;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
+import org.openecomp.sdc.ci.tests.pages.CompositionPage;
+import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
+import org.openecomp.sdc.ci.tests.utils.general.*;
+import org.openecomp.sdc.ci.tests.utils.general.FileHandling;
+import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtillViaApis;
+import org.openecomp.sdc.ci.tests.utils.rest.PropertyRestUtils;
+
+import java.util.List;
+
+public class PortMirroringUtils {
+
+
+ public static ServiceContainer createServiceFromHeatFile(String filePath, String vnfFile) throws Throwable {
+// 1. Import VSP v1.0
+ User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+ AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", amdocsLicenseMembers.getVendorLicenseName()));
+ ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile));
+ Pair<String, VendorSoftwareProductObject> createVendorSoftwareProduct = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails1, amdocsLicenseMembers);
+// VendorSoftwareProductObject vendorSoftwareProductObject = OnboardViaApis.fillVendorSoftwareProductObjectWithMetaData(vnfFile, createVendorSoftwareProduct);
+ VendorSoftwareProductObject vendorSoftwareProductObject = createVendorSoftwareProduct.right;
+// 2. Create VF, certify - v1.0 is created
+ resourceReqDetails = org.openecomp.sdc.ci.tests.utils.general.OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
+ Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
+ resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating Virtual Function (VF): %s v1.0", resourceReqDetails.getName()));
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Certify the VF"));
+// 3. Create Service add to it the certified VF and certify the Service v1.0
+ ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
+ Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating Service: %s v1.0", serviceReqDetails.getName()));
+ Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
+ ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Adding VF instance to Service"));
+ service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Certify the Service"));
+
+ return new ServiceContainer(service, resource, vendorSoftwareProductObject, amdocsLicenseMembers);
+ }
+
+ public static Resource GeneratePNFAndUpdateInput(String resourceName, String vendorModelNumber, User user) throws Exception {
+ Resource resource = getResourceByType(ResourceTypeEnum.PNF, resourceName, vendorModelNumber);
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating pnf %s and certify it", resource.getName()));
+ Component componentObject = AtomicOperationUtils.getComponentObject(resource, UserRoleEnum.DESIGNER);
+ UpdateResourceInputViaAPI(user, componentObject, "physicalProbe", "nf_role");
+ resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+ return resource;
+ }
+
+ private static void UpdateResourceInputViaAPI(User user, Component componentObject, String defaultValue, String inputName) throws Exception {
+ List<InputDefinition> componentInputs = componentObject.getInputs();
+ PropertyObject propertyObject = new PropertyObject(defaultValue, inputName, componentInputs.get(1).getParentUniqueId(), componentInputs.get(1).getUniqueId());
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Update input %s to %s", "nf_role", "physicalProbe"));
+ PropertyRestUtils.updateInput(componentObject, propertyObject, user);
+ }
+
+ public static Resource getResourceByType(ResourceTypeEnum resourceTypeEnum, String resourceName, String vendorModelNumber) {
+ ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResourceByType(resourceTypeEnum, resourceName, ResourceCategoryEnum.NETWORK_L2_3_INFRASTRUCTURE, resourceName, vendorModelNumber);
+ return AtomicOperationUtils.createResourceByResourceDetails(resourceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
+ }
+
+ public static String createProxyInstanceServiceName(String serviceName, String instanceId) {
+ String serviceProxyInstanceName = String.format("%s_proxy %s", serviceName, instanceId);
+ return serviceProxyInstanceName;
+ }
+
+ public static PortMirrioringConfigurationObject createPortMirriongConfigurationStructure() throws Throwable {
+
+ //Using API onboard and certify 2 zip files Source: vmmme and Collector: Vprobe
+ String filePath = FileHandling.getPortMirroringRepositoryPath();
+ ServiceContainer serviceContainerVmme_Source = PortMirroringUtils.createServiceFromHeatFile(filePath, PortMirroringEnum.VMME_ZIP.getValue());
+ ServiceContainer serviceContainerVprobe_Collector = PortMirroringUtils.createServiceFromHeatFile(filePath, PortMirroringEnum.VPROBE_ZIP.getValue());
+
+// String vmmeSourceName = "ciServiceb560327d162f";
+// String vprobeSourceName = "ciService3d9933d31791";
+
+ // create service
+ ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
+ //ServiceUIUtils.createService(serviceMetadata, getUser());
+
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating container %s: ", serviceReqDetails.getName()));
+ Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
+
+ String vmmeSourceName = serviceContainerVmme_Source.getService().getName();
+ String vprobeSourceName = serviceContainerVprobe_Collector.getService().getName();
+
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ GeneralUIUtils.findComponentAndClick(service.getName());
+
+ ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+
+ CompositionPage.searchForElement(vmmeSourceName);
+ CanvasElement serviceElementVmmeSourceName = canvasManager.createElementOnCanvas(vmmeSourceName);
+
+ CompositionPage.searchForElement(vprobeSourceName);
+ CanvasElement serviceElementVprobeCollector = canvasManager.createElementOnCanvas(vprobeSourceName);
+
+ CompositionPage.searchForElement(PortMirroringEnum.PMC_ELEMENT_IN_PALLETE.getValue());
+ CanvasElement portMirroringConfigurationElement = canvasManager.createElementOnCanvas(PortMirroringEnum.PMC_ELEMENT_IN_PALLETE.getValue());
+
+ ConnectionWizardPopUpObject connectionWizardPopUpObjectVMME = new ConnectionWizardPopUpObject("", "",
+ PortMirroringEnum.PM_REQ_TYPE.getValue(), PortMirroringEnum.PMC_SOURCE_CAP.getValue());
+ ConnectionWizardPopUpObject connectionWizardPopUpObjectVProbe = new ConnectionWizardPopUpObject("", "",
+ PortMirroringEnum.PM_REQ_TYPE.getValue(), PortMirroringEnum.PMC_COLLECTOR_CAP.getValue());
+
+ canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVmmeSourceName, CircleSize.SERVICE, portMirroringConfigurationElement, CircleSize.NORMATIVE, connectionWizardPopUpObjectVMME);
+ canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVprobeCollector, CircleSize.SERVICE, portMirroringConfigurationElement, CircleSize.NORMATIVE, connectionWizardPopUpObjectVProbe);
+
+ PortMirrioringConfigurationObject portMirrioringConfigurationObject = new PortMirrioringConfigurationObject(serviceReqDetails, vmmeSourceName,
+ vprobeSourceName, canvasManager, serviceElementVmmeSourceName, serviceElementVprobeCollector, service,
+ portMirroringConfigurationElement, serviceContainerVmme_Source.getService(), serviceContainerVprobe_Collector.getService());
+
+ return portMirrioringConfigurationObject;
+ }
+
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/RestCDUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/RestCDUtils.java
index aa219d0d12..0f6999c28f 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/RestCDUtils.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/RestCDUtils.java
@@ -20,18 +20,8 @@
package org.openecomp.sdc.ci.tests.utilities;
-import static org.testng.AssertJUnit.assertTrue;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import org.codehaus.jackson.map.ObjectMapper;
+import com.aventstack.extentreports.Status;
+import com.fasterxml.jackson.databind.ObjectMapper;
import org.codehaus.jettison.json.JSONObject;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.model.Component;
@@ -56,7 +46,16 @@ import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
import org.openecomp.sdc.ci.tests.utils.rest.UserRestUtils;
-import com.aventstack.extentreports.Status;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import static org.testng.AssertJUnit.assertTrue;
public class RestCDUtils {
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/DeploymentViewVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/DeploymentViewVerificator.java
index 8eb2122b3d..4dcd26c3a1 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/DeploymentViewVerificator.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/DeploymentViewVerificator.java
@@ -38,6 +38,7 @@ import java.util.stream.Stream;
import org.apache.commons.io.FileUtils;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
+import org.openecomp.sdc.ci.tests.datatypes.enums.GroupPropertyEnum;
import org.openecomp.sdc.ci.tests.execute.devCI.ArtifactFromCsar;
import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
import org.openecomp.sdc.ci.tests.pages.DeploymentPage;
@@ -51,24 +52,26 @@ import org.openqa.selenium.WebElement;
import com.aventstack.extentreports.Status;
public class DeploymentViewVerificator {
-
- private static List<String> currentPropertiesForUI = Arrays.asList("isBase",
+
+ //GroupPropertyEnum.getGroupPropertyNames();
+ private static List<String> currentPropertiesForUI = Arrays.asList("isBase",
"vf_module_label",
"vf_module_description",
"min_vf_module_instances",
"max_vf_module_instances",
"initial_count",
- "vf_module_type",
+ "vf_module_type", //works as isBase property, value can be Base/Expantion
"volume_group",
"vfc_list",
"availability_zone_count");
- private static List<String> currentPropertiesWithoutIsBaseForFile = Arrays.asList("vf_module_label",
- "vf_module_description",
- "min_vf_module_instances",
- "max_vf_module_instances",
- "initial_count",
- "vf_module_type",
+ //GroupPropertyEnum.getGroupPropertyNamesWithoutIsbase();
+ private static List<String> currentPropertiesWithoutIsBaseForFile = Arrays.asList("vf_module_label",
+ "vf_module_description",
+ "min_vf_module_instances",
+ "max_vf_module_instances",
+ "initial_count",
+ "vf_module_type", //works as isBase property, value can be Base/Expantion
"volume_group",
"vfc_list",
"availability_zone_count");
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PortMirroringVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PortMirroringVerificator.java
new file mode 100644
index 0000000000..2c8e8c486a
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PortMirroringVerificator.java
@@ -0,0 +1,85 @@
+package org.openecomp.sdc.ci.tests.verificator;
+
+import com.aventstack.extentreports.Status;
+import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
+import org.openecomp.sdc.ci.tests.datatypes.PortMirroringEnum;
+import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
+import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
+import org.openecomp.sdc.ci.tests.utilities.PortMirroringUtils;
+import org.openqa.selenium.By;
+
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.IOException;
+
+import static org.testng.Assert.assertTrue;
+
+public class PortMirroringVerificator {
+
+ public static void checkProxyServiceName(String serviceName, String instanceId)
+ {
+ String serviceActualName = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionRightPanel.COMPONENT_TITLE.getValue()).getText();
+ String serviceExpectedName = PortMirroringUtils.createProxyInstanceServiceName(serviceName,instanceId);
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying the instance name is %s", serviceExpectedName));
+ assertTrue(serviceActualName.equalsIgnoreCase(serviceExpectedName));
+ }
+
+ public static void checkProxyServiceType()
+ {
+ String serviceActualName = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionRightPanel_GenerInfo.TYPE.getValue()).getText();
+ SetupCDTest.getExtendTest().log(Status.INFO, "Verifying the instance type is Service Proxy");
+ assertTrue(serviceActualName.equalsIgnoreCase(PortMirroringEnum.SERVICE_PROXY_TYPE.getValue()));
+ }
+
+ public static void validatingProxyServiceNameAndType(String serviceName, String instanceId)
+ {
+ checkProxyServiceName(serviceName, instanceId);
+ checkProxyServiceType();
+ }
+
+ public static void validateGeneralInfo()
+ {
+ String type = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionRightPanel_GenerInfo.TYPE.getValue()).getText();
+ String resourceType = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionRightPanel_GenerInfo.RESOURCE_TYPE.getValue()).getText();
+ String category = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionRightPanel_GenerInfo.CATEGORY.getValue()).getText();
+ String subCategory = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionRightPanel_GenerInfo.SUB_CATEGORY.getValue()).getText();
+
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying the type equals %s", PortMirroringEnum.TYPE.getValue()));
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying the resource type equals %s", PortMirroringEnum.RESOURCE_TYPE.getValue()));
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying the category equals %s", PortMirroringEnum.CATEGORY.getValue()));
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying the sub category equals %s", PortMirroringEnum.SUB_CATEGORY.getValue()));
+
+ assertTrue(type.equalsIgnoreCase(PortMirroringEnum.TYPE.getValue()));
+ assertTrue(resourceType.equalsIgnoreCase(PortMirroringEnum.RESOURCE_TYPE.getValue()));
+ assertTrue(category.equalsIgnoreCase(PortMirroringEnum.CATEGORY.getValue()));
+ assertTrue(subCategory.equalsIgnoreCase(PortMirroringEnum.SUB_CATEGORY.getValue()));
+ }
+
+ public static void validateReqsAndCapsTabExist()
+ {
+ SetupCDTest.getExtendTest().log(Status.INFO, "Verifying tab reqs and caps exist for PMC element");
+ GeneralUIUtils.getWebElementBy(By.xpath(DataTestIdEnum.CompositionRightPanel.REQS_AND_CAPS_TAB_XPATH.getValue())).click();
+ }
+
+ public static void validateElementName(String expectedName)
+ {
+ String serviceActualName = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionRightPanel.COMPONENT_TITLE.getValue()).getText();
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying the instance name is %s", expectedName));
+ assertTrue(serviceActualName.equalsIgnoreCase(expectedName));
+ }
+
+ public static void validateLinkProperties() throws IOException, UnsupportedFlavorException {
+ SetupCDTest.getExtendTest().log(Status.INFO, "Validate Link properties values");
+ String actualNetworkRole = GeneralUIUtils.getTextValueFromWebElementByXpath(PortMirroringEnum.NETWORK_ROLE_XPATH.getValue());
+ String actualNfcType = GeneralUIUtils.getTextValueFromWebElementByXpath(PortMirroringEnum.NFC_TYPE_XPATH.getValue());
+ String actualPpsCapacity = GeneralUIUtils.getTextValueFromWebElementByXpath(PortMirroringEnum.PPS_CAPACITY_XPATH.getValue());
+ String actualNfType = GeneralUIUtils.getTextValueFromWebElementByXpath(PortMirroringEnum.NF_TYPE_XPATH.getValue());
+
+ assertTrue(actualNetworkRole.equalsIgnoreCase(PortMirroringEnum.NETWORK_ROLE_VALUE.getValue()));
+ assertTrue(actualNfcType.equalsIgnoreCase(PortMirroringEnum.NFC_TYPE_VALUE.getValue()));
+ assertTrue(actualPpsCapacity.equalsIgnoreCase(PortMirroringEnum.PPS_CAPACITY_VALUE.getValue()));
+ assertTrue(actualNfType.equalsIgnoreCase(PortMirroringEnum.NF_TYPE_VALUE.getValue()));
+ }
+
+
+
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PropertiesAssignmentVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PropertiesAssignmentVerificator.java
new file mode 100644
index 0000000000..fa68f4123d
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PropertiesAssignmentVerificator.java
@@ -0,0 +1,18 @@
+package org.openecomp.sdc.ci.tests.verificator;
+
+import static org.testng.Assert.assertTrue;
+
+import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
+import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
+
+import com.aventstack.extentreports.Status;
+
+public class PropertiesAssignmentVerificator {
+
+ public static void validateFilteredPropertiesCount(int propertiesCount, String propertyLocation){
+ int actualPropertiesCount = GeneralUIUtils.getWebElementsListByContainsClassName(propertyLocation).size();
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating. Expected properties count: %s , Actual: %s", propertiesCount, actualPropertiesCount));
+ String errMsg = String.format("Properties amount not as expected, expected: %s ,Actual: %s", propertiesCount, actualPropertiesCount);
+ assertTrue(actualPropertiesCount == propertiesCount, errMsg);
+ }
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ServiceVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ServiceVerificator.java
index 90861cacd5..407ce13328 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ServiceVerificator.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ServiceVerificator.java
@@ -75,10 +75,15 @@ public class ServiceVerificator {
} else if (component instanceof ResourceReqDetails) {
responseAfterDrag = RestCDUtils.getResource((ResourceReqDetails) component, user).getResponse();
}
+ int size = 0;
JSONObject jsonResource = (JSONObject) JSONValue.parse(responseAfterDrag);
- int size = ((JSONArray) jsonResource.get("componentInstances")).size();
- assertTrue(size == numOfVFC, "Expected number of componenet instances is " + numOfVFC + ", but actual is " + size);
- ExtentTestActions.log(Status.INFO, "The number of components on the canvas was verified.");
+ if(jsonResource.get("componentInstances")!= null){
+ size = ((JSONArray) jsonResource.get("componentInstances")).size();
+ assertTrue(size == numOfVFC, "Expected number of componenet instances is " + numOfVFC + ", but actual is " + size);
+ ExtentTestActions.log(Status.INFO, "The number of components on the canvas was verified.");
+ }else{
+ assertTrue(false, "Expected number of componenet instances is " + numOfVFC + ", but actual is " + size);
+ }
}
public static void verifyServiceUpdatedInUI(ServiceReqDetails service) {
@@ -190,7 +195,7 @@ public class ServiceVerificator {
return customizationUUIDList;
}
- public static String getVFModulePropertieValue(ServiceReqDetails service, String propertyName, String moduleName) throws Exception {
+ public static String getVFModulePropertyValue(ServiceReqDetails service, String propertyName, String moduleName) throws Exception {
Service serviceObj = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, service.getName(), service.getVersion());
List<GroupInstance> groupInstances = serviceObj.getComponentInstances().get(0).getGroupInstances();
List<GroupInstanceProperty> groupInstancesProperties = groupInstances.stream().
@@ -198,12 +203,12 @@ public class ServiceVerificator {
findFirst().
get().
convertToGroupInstancesProperties();
- String propertieValue = groupInstancesProperties.stream().
+ String propertyValue = groupInstancesProperties.stream().
filter(e -> e.getName().equals(propertyName)).
findFirst().
get().
getValue();
- return propertieValue;
+ return propertyValue;
}
public static boolean isEqualCustomizationUUIDsAfterChanges(List<String> listBefore, List<String> listAfter){
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ToscaValidation.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ToscaValidation.java
index 922c6e4a03..203368d361 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ToscaValidation.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ToscaValidation.java
@@ -1,21 +1,21 @@
package org.openecomp.sdc.ci.tests.verificator;
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
+import com.aventstack.extentreports.Status;
+import fj.data.Either;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaInputsTopologyTemplateDefinition;
+import org.openecomp.sdc.ci.tests.tosca.datatypes.*;
import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.openecomp.sdc.toscaparser.api.Group;
+import org.openecomp.sdc.toscaparser.api.Property;
import org.openecomp.sdc.toscaparser.api.elements.Metadata;
import org.openecomp.sdc.toscaparser.api.parameters.Input;
-import com.aventstack.extentreports.Status;
-
-import fj.data.Either;
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
public class ToscaValidation {
@@ -63,6 +63,278 @@ public class ToscaValidation {
return serviceToscaMetadataValidator;
}
+ public static Either<Boolean, Map<String, Object>> serviceToscaGroupMetadataValidator(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedServiceGroup, ToscaDefinition actualToscaDefinition){
+
+ SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate service TOSCA group metadata...");
+ Map<String, ToscaGroupsTopologyTemplateDefinition> actualServiceGroups = actualToscaDefinition.getTopology_template().getGroups();
+ Either<Boolean,Map<String,Object>> serviceToscaGroupMetadataValidator = compareServiceGroupMetadata(expectedServiceGroup, actualServiceGroups);
+ if(serviceToscaGroupMetadataValidator.isLeft()){
+ SetupCDTest.getExtendTest().log(Status.INFO, "Service TOSCA group metadata verification success");
+ }else{
+ SetupCDTest.getExtendTest().log(Status.ERROR, "Service TOSCA group metadata verification failed" + serviceToscaGroupMetadataValidator.right().value().toString());
+ }
+ return serviceToscaGroupMetadataValidator;
+ }
+
+ public static Either<Boolean,Map<String,Object>> compareServiceGroupMetadata(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedServiceGroup, Map<String, ToscaGroupsTopologyTemplateDefinition> actualServiceGroups) {
+
+ Map<String, Object> errorMap = new HashMap<>();
+ for (String groupName : expectedServiceGroup.keySet()){
+ if (actualServiceGroups.get(groupName) == null ){
+ errorMap.put("group/module [" + groupName + "]", " does not exist in TOSCA main yaml");
+ }else{
+ compareServiceGroupData(expectedServiceGroup.get(groupName).getMetadata(), actualServiceGroups.get(groupName).getMetadata(), groupName, errorMap);
+ }
+ }
+ if(errorMap != null && !errorMap.isEmpty()){
+ return Either.right(errorMap);
+ }
+ return Either.left(true);
+ }
+
+ public static Either<Boolean, Map<String, Object>> compareServiceGroupData(ToscaServiceGroupsMetadataDefinition expectedServiceGroupMetadata, ToscaServiceGroupsMetadataDefinition actualServiceGroupMetadata, String groupName, Map<String, Object> errorMap) {
+
+ Field[] declaredFields = expectedServiceGroupMetadata.getClass().getDeclaredFields();
+ for (Field field : declaredFields){
+ try {
+ String expectedValue = field.get(expectedServiceGroupMetadata).toString();
+ String actualValue = field.get(actualServiceGroupMetadata).toString();
+ if(expectedValue != null && !expectedValue.toString().trim().equals("")) {
+ if (actualValue != null) {
+ Boolean result = compareValue(expectedValue, actualValue);
+ if(! result ){
+ errorMap.put("Data field [" + field.getName()+"] in group service metadata [" + groupName + "]", "expected: " + expectedValue + ", actual: " + actualValue);
+ }
+ } else {
+ errorMap.put("Data field [" + field.getName() + "] in group service metadata [" + groupName + "]", " does not exist in actual object");
+ System.out.println("Data field [" + field.getName() + "] in group service metadata [" + groupName + "] does not exist in actual object");
+ }
+ }
+ }catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ }
+
+ if(errorMap != null && !errorMap.isEmpty()){
+ return Either.right(errorMap);
+ }
+ return Either.left(true);
+ }
+
+
+// ###########################UsingParser############################
+public static Either<Boolean, Map<String, Object>> serviceToscaGroupMetadataValidatorUsingParser(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedServiceGroup, List<Group> actualServiceGroups){
+
+ SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate service TOSCA group metadata...");
+ Either<Boolean,Map<String,Object>> serviceToscaGroupMetadataValidator = compareServiceGroupMetadataUsingParser(expectedServiceGroup, actualServiceGroups);
+ if(serviceToscaGroupMetadataValidator.isLeft()){
+ SetupCDTest.getExtendTest().log(Status.INFO, "Service TOSCA group metadata verification vs. tosca parser success");
+ }else{
+ SetupCDTest.getExtendTest().log(Status.ERROR, "Service TOSCA group metadata verification vs. tosca parser failed" + serviceToscaGroupMetadataValidator.right().value().toString());
+ }
+ return serviceToscaGroupMetadataValidator;
+}
+
+ public static Either<Boolean,Map<String,Object>> compareServiceGroupMetadataUsingParser(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedServiceGroup, List<Group> actualServiceGroups) {
+
+ Map<String, Object> errorMap = new HashMap<>();
+ for (String groupName : expectedServiceGroup.keySet()){
+ Group actualGroup = getServiceToscaParserGroupFromObject(groupName, actualServiceGroups);
+ if (actualGroup == null ){
+ errorMap.put("group/module [" + groupName + "]", " does not exist in TOSCA main yaml");
+ }else{
+ compareServiceGroupDataUsingParser(expectedServiceGroup.get(groupName).getMetadata(), actualGroup.getMetadata(), groupName, errorMap);
+ }
+ }
+ if(errorMap != null && !errorMap.isEmpty()){
+ return Either.right(errorMap);
+ }
+ return Either.left(true);
+ }
+
+ private static Group getServiceToscaParserGroupFromObject(String groupName, List<Group> actualServiceGroups) {
+ for(Group group : actualServiceGroups){
+ if(group.getName().equals(groupName)){
+ return group;
+ }
+ }
+ return null;
+ }
+
+ public static Either<Boolean, Map<String, Object>> compareServiceGroupDataUsingParser(ToscaServiceGroupsMetadataDefinition expectedServiceGroupMetadata, Metadata actualServiceGroupMetadata, String groupName, Map<String, Object> errorMap) {
+
+ Field[] declaredFields = expectedServiceGroupMetadata.getClass().getDeclaredFields();
+ for (Field field : declaredFields){
+ try {
+ String expectedValue = field.get(expectedServiceGroupMetadata).toString();
+ String actualValue = actualServiceGroupMetadata.getValue(field.getName());
+ if(expectedValue != null && !expectedValue.toString().trim().equals("")) {
+ if (actualValue != null) {
+ Boolean result = compareValue(expectedValue, actualValue);
+ if(! result ){
+ errorMap.put("Data field [" + field.getName()+"] in group service metadata [" + groupName + "]", "expected: " + expectedValue + ", actual: " + actualValue);
+ }
+ } else {
+ errorMap.put("Data field [" + field.getName() + "] in group service metadata [" + groupName + "]", " does not exist in actual object");
+ System.out.println("Data field [" + field.getName() + "] in group service metadata [" + groupName + "] does not exist in actual object");
+ }
+ }
+ }catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ }
+
+ if(errorMap != null && !errorMap.isEmpty()){
+ return Either.right(errorMap);
+ }
+ return Either.left(true);
+ }
+
+// ############################################################################################
+
+
+
+ // ###########################Property UsingParser############################
+ public static Either<Boolean, Map<String, Object>> serviceToscaGroupPropertyValidatorUsingParser(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedServiceGroup, List<Group> actualServiceGroups){
+
+ SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate service TOSCA group property...");
+ Either<Boolean,Map<String,Object>> serviceToscaGroupMetadataValidator = compareServiceGroupPropertyUsingParser(expectedServiceGroup, actualServiceGroups);
+ if(serviceToscaGroupMetadataValidator.isLeft()){
+ SetupCDTest.getExtendTest().log(Status.INFO, "Service TOSCA group property verification vs. tosca parser success");
+ }else{
+ SetupCDTest.getExtendTest().log(Status.ERROR, "Service TOSCA group property verification vs. tosca parser failed" + serviceToscaGroupMetadataValidator.right().value().toString());
+ }
+ return serviceToscaGroupMetadataValidator;
+ }
+
+ public static Either<Boolean,Map<String,Object>> compareServiceGroupPropertyUsingParser(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedServiceGroup, List<Group> actualServiceGroups) {
+
+ Map<String, Object> errorMap = new HashMap<>();
+ for (String groupName : expectedServiceGroup.keySet()){
+ Group actualGroup = getServiceToscaParserGroupFromObject(groupName, actualServiceGroups);
+ if (actualGroup == null ){
+ errorMap.put("group/module [" + groupName + "]", " does not exist in TOSCA main yaml");
+ }else{
+ compareServiceGroupPropertyUsingParser(expectedServiceGroup.get(groupName).getProperties(), actualGroup.getProperties(), groupName, errorMap);
+ }
+ }
+ if(errorMap != null && !errorMap.isEmpty()){
+ return Either.right(errorMap);
+ }
+ return Either.left(true);
+ }
+
+ public static Either<Boolean, Map<String, Object>> compareServiceGroupPropertyUsingParser(ToscaGroupPropertyDefinition expectedServiceGroupProperty, LinkedHashMap<String, Property> actualServiceGroupProperty, String groupName, Map<String, Object> errorMap) {
+
+ Field[] declaredFields = expectedServiceGroupProperty.getClass().getDeclaredFields();
+ for (Field field : declaredFields){
+ try {
+ String expectedValue = (String) field.get(expectedServiceGroupProperty);
+ String actualValue = null;
+ if(actualServiceGroupProperty.get(field.getName()).getValue()!= null) {
+ actualValue = actualServiceGroupProperty.get(field.getName()).getValue().toString();
+ }
+ if(expectedValue != null && !expectedValue.toString().trim().equals("")) {
+ if (actualValue != null) {
+ Boolean result = compareValue(expectedValue, actualValue);
+ if(! result ){
+ errorMap.put("Data field [" + field.getName()+"] in group service property [" + groupName + "]", "expected: " + expectedValue + ", actual: " + actualValue);
+ }
+ } else {
+ errorMap.put("Data field [" + field.getName() + "] in group service property [" + groupName + "]", " does not exist in actual object");
+ System.out.println("Data field [" + field.getName() + "] in group service property [" + groupName + "] does not exist in actual object");
+ }
+ }
+ }catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ }
+
+ if(errorMap != null && !errorMap.isEmpty()){
+ return Either.right(errorMap);
+ }
+ return Either.left(true);
+ }
+
+// ############################################################################################
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//?-------
+ public static Either<Boolean, Map<String, Object>> serviceToscaGroupPropertyValidator(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedServiceGroup, ToscaDefinition actualToscaDefinition){
+
+ SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate service TOSCA group property...");
+ Map<String, ToscaGroupsTopologyTemplateDefinition> actualServiceGroups = actualToscaDefinition.getTopology_template().getGroups();
+ Either<Boolean,Map<String,Object>> serviceToscaGroupPropertyValidator = compareServiceGroupProperty(expectedServiceGroup, actualServiceGroups);
+ if(serviceToscaGroupPropertyValidator.isLeft()){
+ SetupCDTest.getExtendTest().log(Status.INFO, "Service TOSCA group property verification success");
+ }else{
+ SetupCDTest.getExtendTest().log(Status.ERROR, "Service TOSCA group property verification failed" + serviceToscaGroupPropertyValidator.right().value().toString());
+ }
+ return serviceToscaGroupPropertyValidator;
+ }
+
+ public static Either<Boolean,Map<String,Object>> compareServiceGroupProperty(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedServiceGroup, Map<String, ToscaGroupsTopologyTemplateDefinition> actualServiceGroups) {
+
+ Map<String, Object> errorMap = new HashMap<>();
+ for (String groupName : expectedServiceGroup.keySet()){
+ if (actualServiceGroups.get(groupName) == null ){
+ errorMap.put("group/module [" + groupName + "]", " does not exist in TOSCA main yaml");
+ }else{
+ compareServiceGroupProperty(expectedServiceGroup.get(groupName).getProperties(), actualServiceGroups.get(groupName).getProperties(), groupName, errorMap);
+ }
+ }
+ if(errorMap != null && !errorMap.isEmpty()){
+ return Either.right(errorMap);
+ }
+ return Either.left(true);
+ }
+
+ public static Either<Boolean, Map<String, Object>> compareServiceGroupProperty(ToscaGroupPropertyDefinition expectedServiceGroupProperty, ToscaGroupPropertyDefinition actualServiceGroupProperty, String groupName, Map<String, Object> errorMap) {
+
+ Field[] declaredFields = expectedServiceGroupProperty.getClass().getDeclaredFields();
+ for (Field field : declaredFields){
+ try {
+ String expectedValue = (String) field.get(expectedServiceGroupProperty);
+ String actualValue = (String) field.get(actualServiceGroupProperty);
+ if(expectedValue != null && !expectedValue.toString().trim().equals("")) {
+ if (actualValue != null) {
+ Boolean result = compareValue(expectedValue, actualValue);
+ if(! result ){
+ errorMap.put("Data field [" + field.getName()+"] in group service property [" + groupName + "]", "expected: " + expectedValue + ", actual: " + actualValue);
+ }
+ } else {
+ errorMap.put("Data field [" + field.getName() + "] in group service property [" + groupName + "]", " does not exist in actual object");
+ System.out.println("Data field [" + field.getName() + "] in group service property [" + groupName + "] does not exist in actual object");
+ }
+ }
+ }catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ }
+
+ if(errorMap != null && !errorMap.isEmpty()){
+ return Either.right(errorMap);
+ }
+ return Either.left(true);
+ }
+
+
+// ----------------------------------
public static Either<Boolean, Map<String, Object>> componentToscaNodeTemplateMetadataValidator(Map<String, String> expectedMetadata, ToscaDefinition actualToscaDefinition, String nodeTemplateName, ComponentTypeEnum componentType, String componentName){
SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate "+ componentName + " " + componentType.getValue() + " node template TOSCA metadata...");
@@ -166,7 +438,7 @@ public class ToscaValidation {
Object expectedValue = field.get(expectedInputDefinition);
Object actualValue = field.get(actualInputDefinition);
// verification exclude fields as (immutable, hidden, constraints, entry_schema) according Renana
- if(expectedValue != null && expectedValue.toString().trim()!= "" && field.getName() != "name" && field.getName() != "immutable" && field.getName() != "hidden" && field.getName() != "constraints" && field.getName() != "entry_schema" && field.getName() != "required") {
+ if(expectedValue != null && !expectedValue.toString().trim().equals("") && field.getName() != "name" && field.getName() != "immutable" && field.getName() != "hidden" && field.getName() != "constraints" && field.getName() != "entry_schema" && field.getName() != "required") {
if (actualValue != null) {
compareInputValue(expectedInputDefinition, errorMap, field, expectedValue, actualValue);
} else {
@@ -285,5 +557,4 @@ public class ToscaValidation {
return actualInputsMap;
}
-
}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfModuleVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfModuleVerificator.java
index 588e984106..02e92f8943 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfModuleVerificator.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfModuleVerificator.java
@@ -25,6 +25,8 @@ import static org.testng.AssertJUnit.assertNotNull;
import static org.testng.AssertJUnit.assertTrue;
import java.io.File;
+import java.lang.reflect.Field;
+import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@@ -58,7 +60,9 @@ public class VfModuleVerificator {
int heatMetaGroupCount = 0;
int toscaDefinitionGroupCount = 0;
for (TypeHeatMetaDefinition typeHeatMetaDefinition : listTypeHeatMetaDefinition) {
- heatMetaGroupCount = typeHeatMetaDefinition.getGroupHeatMetaDefinition().size();
+ if(!typeHeatMetaDefinition.getTypeName().equals("artifacts")) {
+ heatMetaGroupCount = typeHeatMetaDefinition.getGroupHeatMetaDefinition().size();
+ }
}
toscaDefinitionGroupCount = toscaDefinition.getTopology_template().getGroups().size();
assertEquals("Expected num of groups in HEAT.meta file is " + heatMetaGroupCount + ", but was in TOSCA yaml file " + toscaDefinitionGroupCount, heatMetaGroupCount, toscaDefinitionGroupCount);
@@ -127,8 +131,14 @@ public class VfModuleVerificator {
for(String propertyType : PROPERTY_TYPES){
int numberOfTypes = (int) vfModules.stream().
- filter(e -> e.getProperties().containsKey(propertyType)).
- count();
+ // Get all declared fields from class ToscaGroupPropertyDefinition, collect them to List and check that current property exist and declared class
+ filter(e -> Arrays.asList(e.getProperties().getClass().getDeclaredFields()).stream().
+ map(p -> p.getName()).
+ collect(Collectors.toList()).
+ contains(propertyType)
+ ).
+ collect(Collectors.toList()).
+ size();
SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating VF property %s exist, Expected: %s, Actual: %s ", propertyType, vfModules.size(), numberOfTypes));
assertTrue(numberOfTypes == vfModules.size());
}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfVerificator.java
index 38fb351179..b2397cb23f 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfVerificator.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfVerificator.java
@@ -20,15 +20,7 @@
package org.openecomp.sdc.ci.tests.verificator;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertTrue;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
+import com.aventstack.extentreports.Status;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
@@ -40,6 +32,7 @@ import org.openecomp.sdc.be.model.category.CategoryDefinition;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
import org.openecomp.sdc.ci.tests.datatypes.enums.PropertyTypeEnum;
import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
@@ -54,7 +47,12 @@ import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
-import com.aventstack.extentreports.Status;
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+import static org.testng.Assert.*;
public final class VfVerificator {
@@ -77,7 +75,8 @@ public final class VfVerificator {
ExtentTestActions.log(Status.INFO, "The link was verified.");
}
-
+
+// @Step(description="Verifying fields on General screen through UI ...")
public static void verifyVFMetadataInUI(ResourceReqDetails vf) {
SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying fields on General screen through UI ..."));
assertTrue(vf.getName().equals(ResourceGeneralPage.getNameText()));
@@ -94,6 +93,7 @@ public final class VfVerificator {
assertTrue(vf.getContactId().equals(ResourceGeneralPage.getContactIdText()));
}
+// @Step(description="Verifying fields on General screen through Backend ...")
public static void verifyVFUpdated(ResourceReqDetails vf, User user) {
SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying fields on General screen through Backend ..."));
String response = RestCDUtils.getResource(vf, user).getResponse();
@@ -217,17 +217,22 @@ public final class VfVerificator {
}
}
- public static void verifyOnboardedVnfMetadata(String vspName, Map<String, String> vspMetadata) {
+ public static void verifyOnboardedVnfMetadata(String vspName, VendorSoftwareProductObject vspMetadata) {
SetupCDTest.getExtendTest().log(Status.INFO, "Verifying metadata");
assertTrue(vspName.equals(ResourceGeneralPage.getNameText()), "VSP name is not valid.");
- assertTrue(vspMetadata.get("description").equals(ResourceGeneralPage.getDescriptionText()), "VSP description is not valid.");
- assertTrue(vspMetadata.get("subCategory").equals(GeneralUIUtils.getSelectedElementFromDropDown(ResourceGeneralPage.getCategoryDataTestsIdAttribute()).getText().trim()), "VSP category is not valid.");
- assertTrue(vspMetadata.get("vendorName").equals(ResourceGeneralPage.getVendorNameText()), "VSP vendor name is not valid.");
+ assertTrue(vspMetadata.getDescription().equals(ResourceGeneralPage.getDescriptionText()), "VSP description is not valid.");
+
+ String [] splitedSubCategorey = vspMetadata.getSubCategory().split("\\.");
+ String expectedSubCategory = splitedSubCategorey[splitedSubCategorey.length-1];
+ String actualSubCategory = GeneralUIUtils.getSelectedElementFromDropDown(ResourceGeneralPage.getCategoryDataTestsIdAttribute()).getText().trim().toLowerCase();
+
+ assertTrue(expectedSubCategory.equals(actualSubCategory), "VSP category is not valid.");
+ assertTrue(vspMetadata.getVendorName().equals(ResourceGeneralPage.getVendorNameText()), "VSP vendor name is not valid.");
assertTrue("1.0".equals(ResourceGeneralPage.getVendorReleaseText()), "VSP version is not valid.");
List<WebElement> tagsList = ResourceGeneralPage.getElementsFromTagsTable();
assertTrue(tagsList.size() == 1, "VSP tags size is not equal to 1.");
assertTrue(vspName.equals(tagsList.get(0).getText()), "VSP tag is not its name.");
- assertTrue(vspMetadata.get("attContact").equals(ResourceGeneralPage.getContactIdText()), "VSP attContact is not valid.");
+ assertTrue(vspMetadata.getAttContact().equals(ResourceGeneralPage.getContactIdText()), "VSP attContact is not valid.");
}
public static void verifyIsElementDisabled(String elementLocator, String elementName){
diff --git a/ui-ci/src/main/resources/META-INF/aop-ajc.xml b/ui-ci/src/main/resources/META-INF/aop-ajc.xml
new file mode 100644
index 0000000000..8587abb2e1
--- /dev/null
+++ b/ui-ci/src/main/resources/META-INF/aop-ajc.xml
@@ -0,0 +1,15 @@
+<aspectj>
+
+<aspects>
+<aspect name="com.att.automation.common.report_portal_integration.aspects.StepAspects"/>
+<aspect name="com.att.automation.common.report_portal_integration.aspects.WebDriverAspects"/>
+<aspect name="com.att.automation.common.report_portal_integration.aspects.AssertAspects"/>
+<aspect name="com.att.automation.common.report_portal_integration.aspects.ReportPortalAspects"/>
+</aspects>
+<weaver options="-Xset:weaveJavaxPackages=true -warn:none -Xlint:ignore">
+<include within="org.openecomp.sdc.ci.tests..*"/>
+<include within="com.att.automation..*"/>
+<include within="com.epam..*"/>
+<include within="org.testng.TestNG"/>
+</weaver>
+</aspectj> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/conf/attsdc.yaml b/ui-ci/src/main/resources/ci/conf/attsdc.yaml
index 9537cf5360..403d915aef 100644
--- a/ui-ci/src/main/resources/ci/conf/attsdc.yaml
+++ b/ui-ci/src/main/resources/ci/conf/attsdc.yaml
@@ -39,6 +39,8 @@ windowsDownloadDirectory: "c:\\apache-ftpserver-1.1.0\\res\\home\\"
systemUnderDebug: false
reportDBhost: dbhost
reportDBport: 27017
+sdcHttpMethod: https
+localDataCenter: DC-Automate01
useBrowserMobProxy: false
captureTraffic: false
diff --git a/ui-ci/src/main/resources/ci/scripts/addUsersFromList_new.sh b/ui-ci/src/main/resources/ci/scripts/addUsersFromList_new.sh
index 1b6f0258d6..e695db26b2 100644
--- a/ui-ci/src/main/resources/ci/scripts/addUsersFromList_new.sh
+++ b/ui-ci/src/main/resources/ci/scripts/addUsersFromList_new.sh
@@ -46,12 +46,12 @@ function addUser ()
firstName=`echo $user|awk '{print $3}'`
lastName=`echo $user|awk '{print $4}'`
email=`echo $user|awk '{print $5}'`
- curl --noproxy '*' -i -X post -d '{ "userId" : "'${userId}'", "role" : "'${role}'", "firstName" : "'${firstName}'", "lastName" : "'${lastName}'", "email" : "'${email}'" }' -H "Content-Type: application/json" -H "USER_ID: jh0003" http://${IP}:8080/sdc2/rest/v1/user
+ curl --noproxy '*' -i -X post -d '{ "userId" : "'${userId}'", "role" : "'${role}'", "firstName" : "'${firstName}'", "lastName" : "'${lastName}'", "email" : "'${email}'" }' -H "Content-Type: application/json" -H "USER_ID: jh0003" https://${IP}:8443/sdc2/rest/v1/user
else
echo "Host" $IP "Is Unreachable"
fi
done
-curl --noproxy '*' -i -X post -d '{"consumerName": "ci","consumerSalt": "2a1f887d607d4515d4066fe0f5452a50","consumerPassword": "0a0dc557c3bf594b1a48030e3e99227580168b21f44e285c69740b8d5b13e33b"}' -H "Content-Type: application/json" -H "USER_ID: jh0003" -H "Authorization:Basic Y2k6MTIzNDU2" http://${IP}:8080/sdc2/rest/v1/consumers
+curl --noproxy '*' -i -X post -d '{"consumerName": "ci","consumerSalt": "2a1f887d607d4515d4066fe0f5452a50","consumerPassword": "0a0dc557c3bf594b1a48030e3e99227580168b21f44e285c69740b8d5b13e33b"}' -H "Content-Type: application/json" -H "USER_ID: jh0003" -H "Authorization:Basic Y2k6MTIzNDU2" https://${IP}:8443/sdc2/rest/v1/consumers
}
diff --git a/ui-ci/src/main/resources/ci/scripts/sendMail.sh b/ui-ci/src/main/resources/ci/scripts/sendMail.sh
index 794534fc8a..ead4e343d6 100644
--- a/ui-ci/src/main/resources/ci/scripts/sendMail.sh
+++ b/ui-ci/src/main/resources/ci/scripts/sendMail.sh
@@ -6,8 +6,9 @@ REPORT_NAME=$1
VERSION=$2
ENV=$3
-RECIPIENTS1="dl-sdcqa@intl.att.com,ml636r@intl.att.com,bl5783intl.att.com,ak314p@intl.att.com,el489u@intl.att.com,hk096q@intl.att.com,bs5719@intl.att.com"
-RECIPIENTS2="dl-asdcqa@intl.att.com"
+RECIPIENTS1="dl-sdcqa@att.com,ml636r@att.com,bl5783@att.com,ak314p@att.com,el489u@att.com,hk096q@att.com,bs5719@att.com"
+#RECIPIENTS2="dl-asdcqa@att.com"
+RECIPIENTS2="md9897@att.com,ms656r@att.com,al714h@att.com,ak991p@att.com,ya107f@att.com,bv095y@att.com,st198j@att.com,th0695@att.com,vk195d@att.com,gg980r@att.com,il0695@att.com,el489u@att.com"
source ExtentReport/versions.info
if [ -z "$REPORT_NAME" ]
diff --git a/ui-ci/src/main/resources/ci/scripts/startTest.sh b/ui-ci/src/main/resources/ci/scripts/startTest.sh
index 8bf35a5d88..e1065583aa 100644
--- a/ui-ci/src/main/resources/ci/scripts/startTest.sh
+++ b/ui-ci/src/main/resources/ci/scripts/startTest.sh
@@ -22,7 +22,7 @@ function isBoolean ()
VALUE=$2
if [[ ${VALUE} != "true" ]] && [[ ${VALUE} != "false" ]]; then
echo "Valid parameter" ${PARAM_NAME} "values are: true/false"
- help_usage
+ help_usage
fi
}
@@ -32,6 +32,27 @@ function prepareFailedXmlFile ()
PATTERN=`grep -w "test name=" ${FULL_PATH}/${TEST_SUITES}/$2 | awk -F'"' '{print $2}'`
sed '/<test name="'${PATTERN}'"/,/<!-- '${PATTERN}' --/d' $1 > ${FULL_PATH}/${TEST_SUITES}/${fileName}
sed -i 's/thread-count="[0-9]\+"/thread-count="1"/g' ${FULL_PATH}/${TEST_SUITES}/${fileName}
+ if [ -s "ExtentReport/ShortReport.csv" ]
+ then
+ SKIP_TESTS_LIST=$(cat ExtentReport/ShortReport.csv |awk -F, '{print $2}' | sed 's/&.*//g' | uniq)
+ for SKIP_TEST in ${SKIP_TESTS_LIST}; do
+ sed -i "s/.*\"${SKIP_TEST}\".*//g" ${FULL_PATH}/${TEST_SUITES}/${fileName};
+ done;
+ fi
+}
+
+function setUpdatedTimeToReport ()
+{
+ LINE_NUMBER_OF_START_REPORT_DATE=`grep -A1 -nw "Start" ExtentReport/SDC_UI_Extent_Report.html | tail -1 | awk '{print $1}' | tr -d -`
+ END_REPORT_DATE=`grep -A1 -nw "End" ExtentReport/SDC_UI_Extent_Report.html | tail -1 | awk -F'[>|<]' '{print $3}'`
+ EPOCH_START_REPORT_DATE=`date --date="${1}" +%s`
+ EPOCH_END_REPORT_DATE=`date --date="${END_REPORT_DATE}" +%s`
+ let DIFF_EPOCH_TIME=${EPOCH_END_REPORT_DATE}-${EPOCH_START_REPORT_DATE}
+ TAKEN_TIME_IN_MINUTES=`echo $((${DIFF_EPOCH_TIME}/60))`
+ LINE_NUMBER_OF_TAKEN_REPORT_TIME=`grep -A1 -nw "Time Taken" ExtentReport/SDC_UI_Extent_Report.html | tail -1 | awk '{print $1}' | tr -d -`
+ PATTERN="div class='panel-lead'>";
+ sed -i "${LINE_NUMBER_OF_START_REPORT_DATE}s/${PATTERN}.*\</${PATTERN}$1\<\//1" ExtentReport/SDC_UI_Extent_Report.html
+ sed -i "${LINE_NUMBER_OF_TAKEN_REPORT_TIME}s/${PATTERN}.*\</${PATTERN}${TAKEN_TIME_IN_MINUTES} min\<\//1" ExtentReport/SDC_UI_Extent_Report.html
}
#main
@@ -92,7 +113,7 @@ ADD_USERS_SCRIPT="addUsersFromList_new.sh"
USER_LIST="conf/userList.txt"
chmod +x ${ADD_USERS_SCRIPT}
echo "add users..."
-`./${ADD_USERS_SCRIPT} -ip ${BE_IP} -f ${USER_LIST}`
+./${ADD_USERS_SCRIPT} -ip ${BE_IP} -f ${USER_LIST}
@@ -117,7 +138,7 @@ if [ ${RERUN} == "true" ]; then
echo "Prepare" ${TARGET_DIR}/${fileName} "file to rerun all failed tests ...";
prepareFailedXmlFile ${TARGET_DIR}/${fileName} $SUITE_FILE;
SUITE_FILE=${fileName};
- cmd="java -Xmx2048m -Xms1024m $JAVA_OPTION -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -DfilePath=${FILES_TEST} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -cp $JAR_FILE ${MainClass} $SUITE_FILE &"
+ cmd="java -Xmx2048m -Xms1024m $JAVA_OPTION -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -DfilePath=${FILES_TEST} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -cp $JAR_FILE ${MainClass} $SUITE_FILE &"
$cmd;
fi
fi
@@ -128,6 +149,11 @@ source ExtentReport/versions.info
now=$(date +'%Y-%m-%d_%H_%M')
REPORT_NAME=${now}
VERSION=${osVersion}
+REPORT_START_DATE=${reportStartTime}
+
+if [ ${RERUN} == "true" ]; then
+ setUpdatedTimeToReport "${REPORT_START_DATE}";
+fi
if [[ $env == *"DEV20"* ]]
then
@@ -139,7 +165,7 @@ fi
COPY_REPORT_SCRIPT="copyToStorage.sh"
chmod +x ${COPY_REPORT_SCRIPT}
echo "copy report to storage..."
-sh ./${COPY_REPORT_SCRIPT} ${REPORT_NAME} ${VERSION} ${MYENV}
+( ./${COPY_REPORT_SCRIPT} ${REPORT_NAME} ${VERSION} ${MYENV} )
MAILING_SCRIPT_NAME="sendMail.sh"
diff --git a/ui-ci/src/main/resources/ci/testSuites/PortMirroring.xml b/ui-ci/src/main/resources/ci/testSuites/PortMirroring.xml
new file mode 100644
index 0000000000..da03e8285e
--- /dev/null
+++ b/ui-ci/src/main/resources/ci/testSuites/PortMirroring.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="2">
+ <test name="PortMirroringTests">
+ <classes>
+ <class name="org.openecomp.sdc.ci.tests.execute.sanity.PortMirroring"/>
+ </classes>
+ </test>
+</suite> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/testSuites/andreyPara.xml b/ui-ci/src/main/resources/ci/testSuites/andreyPara.xml
index f4f99db3a1..3e3efdd9cd 100644
--- a/ui-ci/src/main/resources/ci/testSuites/andreyPara.xml
+++ b/ui-ci/src/main/resources/ci/testSuites/andreyPara.xml
@@ -1,10 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="2" data-provider-thread-count="2">
- <test name="uiSanity">
+ <suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="2" data-provider-thread-count="2">
+
+<listeners>
+ <listener class-name="com.att.automation.common.report_portal_integration.listeners.ReportPortalListener"/>
+</listeners>
+
+ <test name="VF1">
<classes>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.VfArtifacts"/>
- <!-- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Vf"/> -->
+ <class name="org.openecomp.sdc.ci.tests.execute.sanity.Vf">
+ <methods>
+ <include name="updateVF"/>
+ </methods>
+ </class>
+
+ </classes>
+ </test> <!-- uitests -->
+
+ <test name="VF2">
+ <classes>
+ <class name="org.openecomp.sdc.ci.tests.execute.sanity.Vf">
+ <methods>
+ <include name="addUpdateDeleteDeploymentArtifactToVfTest"/>
+ <include name="addPropertiesToVfcInstanceInVfTest"/>
+ </methods>
+ </class>
+
</classes>
</test> <!-- uitests -->
</suite> <!-- uisuite --> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/testSuites/devOnboardE2EOneFileSanity.xml b/ui-ci/src/main/resources/ci/testSuites/devOnboardE2EOneFileSanity.xml
index 73ddc90cf3..8802e9f8ef 100644
--- a/ui-ci/src/main/resources/ci/testSuites/devOnboardE2EOneFileSanity.xml
+++ b/ui-ci/src/main/resources/ci/testSuites/devOnboardE2EOneFileSanity.xml
@@ -4,7 +4,7 @@
<test name="uitests">
<classes>
<!--onboard-->
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Onboard">
+ <class name="org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsUI">
<methods>
<include name="onboardVNFTestSanityOneFile"/>
</methods>
diff --git a/ui-ci/src/main/resources/ci/testSuites/extendedSanity.xml b/ui-ci/src/main/resources/ci/testSuites/extendedSanity.xml
index 87a52bde7a..b0bcc333a5 100644
--- a/ui-ci/src/main/resources/ci/testSuites/extendedSanity.xml
+++ b/ui-ci/src/main/resources/ci/testSuites/extendedSanity.xml
@@ -1,17 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="2" data-provider-thread-count="2">
+<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="4" data-provider-thread-count="2">
<parameter name="makeDistribution" value="true"/>
<test name="uiSanity">
<classes>
- <class name="org.openecomp.sdc.ci.tests.dataProvider.OnbordingDataProviders">
- <methods>
- <include name="OnbordingDataProviders"/>
- </methods>
- </class>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Onboard">
+ <class name="org.openecomp.sdc.ci.tests.execute.sanity.ToscaValidationTest"/>
+ <class name="org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsUI">
<methods>
<exclude name="onboardVNFTestSanity"/>
<exclude name="onboardVNFShotFlow"/>
@@ -21,6 +17,7 @@
</class>
<class name="org.openecomp.sdc.ci.tests.execute.sanity.CatalogLeftPanelTest"/>
<class name="org.openecomp.sdc.ci.tests.execute.sanity.Vf"/>
+ <class name="org.openecomp.sdc.ci.tests.execute.sanity.VfAPI"/>
<class name="org.openecomp.sdc.ci.tests.execute.sanity.Service"/>
<class name="org.openecomp.sdc.ci.tests.execute.sanity.ImportVFCAsset"/>
<class name="org.openecomp.sdc.ci.tests.execute.sanity.ImportDCAE"/>
@@ -37,7 +34,7 @@
<class name="org.openecomp.sdc.ci.tests.US.MIBsArtifactsOnResourceInstance"/>
<class name="org.openecomp.sdc.ci.tests.US.NewArtifactTypeGuide"/>
<class name="org.openecomp.sdc.ci.tests.US.RemoveRestrictionOfDeploymentArtifacts"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlows"/>
+ <class name="org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsThroughAPI"/>
<class name="org.openecomp.sdc.ci.tests.execute.sanity.PortMirroring"/>
<!-- <class name="org.openecomp.sdc.ci.tests.US.AddComponentInstancesArtifactsInCsar"/> -->
diff --git a/ui-ci/src/main/resources/log4j2.xml b/ui-ci/src/main/resources/log4j2.xml
new file mode 100644
index 0000000000..5a92e611b0
--- /dev/null
+++ b/ui-ci/src/main/resources/log4j2.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration status="ERROR" packages="com.epam.ta.reportportal.log4j.appender">
+ <properties>
+ <property name="pattern">[%d{HH:mm:ss,SSS}] %-5p (%F:%L) - %m%n</property>
+ <property name="report.pattern">%m%n</property>
+ </properties>
+ <Appenders>
+ <Console name="Console" target="SYSTEM_OUT">
+ <PatternLayout pattern="${pattern}"/>
+ </Console>
+ <ReportPortalLog4j2Appender name="ReportPortalAppender">
+ <PatternLayout pattern="${pattern}"/>
+ </ReportPortalLog4j2Appender>
+ <Console name="ConsoleReport" target="SYSTEM_OUT">
+ <PatternLayout pattern="${report.pattern}"/>
+ </Console>
+ <ReportPortalLog4j2Appender name="ReportPortalLogReport">
+ <PatternLayout pattern="${report.pattern}"/>
+ </ReportPortalLog4j2Appender>
+ </Appenders>
+ <Loggers>
+ <Root level="all">
+ <AppenderRef ref="Console"/>
+ <AppenderRef ref="ReportPortalAppender"/>
+ </Root>
+ <logger name="upload.file.to.reportportal" level="all" additivity="false">
+ <AppenderRef ref="ReportPortalAppender"/>
+ </logger>
+ <logger name="logger.report" level="all" additivity="false">
+<!-- <AppenderRef ref="ConsoleReport"/> -->
+ <AppenderRef ref="ReportPortalLogReport"/>
+ </logger>
+ <logger name="rp.org.apache.http" level="WARN"/>
+ <logger name="org.apache.http" level="WARN"/>
+ <logger name="com.epam.reportportal" level="WARN"/>
+ <logger name="CouchDbDataAdapter" level="WARN"/>
+ </Loggers>
+</Configuration> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/reportportal.properties b/ui-ci/src/main/resources/reportportal.properties
new file mode 100644
index 0000000000..373610ef62
--- /dev/null
+++ b/ui-ci/src/main/resources/reportportal.properties
@@ -0,0 +1,5 @@
+rp.endpoint = http://reportportal.intl.att.com:8080
+rp.uuid = 4be0a132-e2ea-4a8c-a0d4-54367259d8d2
+rp.project= ASDC
+rp.mode = DEBUG
+rp.enable = true \ No newline at end of file