summaryrefslogtreecommitdiffstats
path: root/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java
diff options
context:
space:
mode:
Diffstat (limited to 'ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java')
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java127
1 files changed, 119 insertions, 8 deletions
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 0bb315aefe..d24000806e 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,5 +1,7 @@
package org.openecomp.sdc.ci.tests.execute.sanity;
+import static org.testng.Assert.assertTrue;
+
import java.util.List;
import org.openecomp.sdc.be.dao.api.ActionStatus;
@@ -10,22 +12,32 @@ 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.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.utils.general.ElementFactory;
import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
@@ -60,7 +72,7 @@ public class PNF extends SetupCDTest {
// update Resource
ResourceReqDetails updatedResource = new ResourceReqDetails();
- updatedResource.setName("ciUpdatedName");
+ updatedResource.setName(ElementFactory.getResourcePrefix() + "UpdatedName" + pnfMetaData.getName());
updatedResource.setDescription("kuku");
updatedResource.setVendorName("updatedVendor");
updatedResource.setVendorRelease("updatedRelease");
@@ -68,7 +80,7 @@ public class PNF extends SetupCDTest {
updatedResource.setCategories(pnfMetaData.getCategories());
updatedResource.setVersion("0.1");
updatedResource.setResourceType(ResourceTypeEnum.VF.getValue());
- List<String> newTags = pnfMetaData.getTags();
+ List<String> newTags = pnfMetaData.getTags();
newTags.remove(pnfMetaData.getName());
newTags.add(updatedResource.getName());
updatedResource.setTags(newTags);
@@ -105,7 +117,7 @@ public class PNF extends SetupCDTest {
@Test
public void addPropertiesToVfcInstanceInPNFTest() throws Exception {
- String fileName = "CP.yml";
+ String fileName = "CP02.yml";
ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.CP, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
try{
@@ -130,6 +142,7 @@ public class PNF extends SetupCDTest {
PropertiesPage.getPropertyPopup().clickSave();
findElement = properties.get(i).findElement(By.className("i-sdc-designer-sidebar-section-content-item-property-value"));
+ SetupCDTest.getExtendTest().log(Status.INFO, "Validating properties");
AssertJUnit.assertTrue(findElement.getText().equals(propertyValue));
}
}
@@ -145,7 +158,7 @@ public class PNF extends SetupCDTest {
ResourceReqDetails pnfMetaData = null;
CanvasManager vfCanvasManager;
CanvasElement cpElement = null;
- String fileName = "CP.yml";
+ String fileName = "CP03.yml";
try{
atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.CP, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
@@ -228,7 +241,7 @@ public class PNF extends SetupCDTest {
}
@Test
- public void deletePNFCheckedoutTest() throws Exception{
+ public void deletePNFTest() throws Exception{
ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
GeneralPageElements.clickTrashButtonAndConfirm();
@@ -253,9 +266,9 @@ public class PNF extends SetupCDTest {
VfVerificator.verifyVFMetadataInUI(pnfMetaData);
}
-
+
@Test
- public void checkoutVfTest() throws Exception{
+ public void checkoutPnfTest() throws Exception{
ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
ResourceGeneralPage.clickCheckinButton(pnfMetaData.getName());
@@ -287,7 +300,105 @@ public class PNF extends SetupCDTest {
ResourceUIUtils.createPNF(pnfMetaData, getUser());
return pnfMetaData;
}
-
+
+ @Test
+ public void verifyPNF_UI_Limitations() throws Exception {
+ ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
+
+ SetupCDTest.getExtendTest().log(Status.INFO, "Validating Deployment Artifact Left Side Menu not exist");
+ assertTrue(GeneralUIUtils.isElementInvisibleByTestId("Deployment ArtifactLeftSideMenu"));
+ SetupCDTest.getExtendTest().log(Status.INFO, "Validating Deployment Left Side Menu not exist");
+ assertTrue(GeneralUIUtils.isElementInvisibleByTestId("DeploymentLeftSideMenu"));
+ }
+
+ @Test
+ public void filteringCatalogByPNF() throws Exception {
+ ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
+
+ String pnfName = pnfMetaData.getName();
+ ResourceGeneralPage.clickSubmitForTestingButton(pnfName);
+ reloginWithNewRole(UserRoleEnum.TESTER);
+ GeneralUIUtils.findComponentAndClick(pnfName);
+ TesterOperationPage.certifyComponent(pnfName);
+
+ pnfMetaData.setVersion("1.0");
+ VfVerificator.verifyVFLifecycle(pnfMetaData, getUser(), LifecycleStateEnum.CERTIFIED);
+
+ reloginWithNewRole(UserRoleEnum.DESIGNER);
+ CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
+ CatalogUIUtilitis.catalogFilterTypeChecBox(TypesEnum.valueOf("PNF"));
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating resource %s found", pnfName));
+ GeneralUIUtils.clickOnElementByTestId(pnfName);
+ }
+
+ @Test
+ public void addPNFtoServiceAndDistribute() throws Exception {
+ ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
+
+ ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
+ CompositionPage.searchForElement("ContrailPort");
+ vfCanvasManager.createElementOnCanvas("ContrailPort");
+
+ String pnfName = pnfMetaData.getName();
+ ResourceGeneralPage.clickSubmitForTestingButton(pnfName);
+
+ reloginWithNewRole(UserRoleEnum.TESTER);
+ GeneralUIUtils.findComponentAndClick(pnfName);
+ TesterOperationPage.certifyComponent(pnfName);
+
+ pnfMetaData.setVersion("1.0");
+ VfVerificator.verifyVFLifecycle(pnfMetaData, getUser(), LifecycleStateEnum.CERTIFIED);
+
+ reloginWithNewRole(UserRoleEnum.DESIGNER);
+ ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
+ ServiceUIUtils.createService(serviceMetadata, getUser());
+ DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
+ CanvasManager canvasManager = CanvasManager.getCanvasManager();
+ CompositionPage.searchForElement(pnfName);
+ CanvasElement pnfElement = canvasManager.createElementOnCanvas(pnfName);
+ CompositionPage.searchForElement("Network");
+ CanvasElement networkElement = canvasManager.createElementOnCanvas("Network");
+
+ canvasManager.linkElements(pnfElement, CircleSize.VF, networkElement, CircleSize.NORMATIVE);
+ String serviceName = serviceMetadata.getName();
+ ServiceGeneralPage.clickSubmitForTestingButton(serviceName);
+ reloginWithNewRole(UserRoleEnum.TESTER);
+ GeneralUIUtils.findComponentAndClick(serviceName);
+ TesterOperationPage.certifyComponent(serviceName);
+
+ reloginWithNewRole(UserRoleEnum.GOVERNOR);
+ GeneralUIUtils.findComponentAndClick(serviceName);
+ GovernorOperationPage.approveSerivce(serviceName);
+
+ reloginWithNewRole(UserRoleEnum.OPS);
+ GeneralUIUtils.findComponentAndClick(serviceName);
+ OpsOperationPage.distributeService();
+ }
+
+ @Test
+ public void checkInfomationArtifactUploadLimitation() throws Exception {
+ ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
+ ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
+ List<WebElement> webElements = GeneralUIUtils.getWebElementsListBy(By.xpath("//button[@class='add-button ng-scope']"));
+ int numberOfElements = webElements.size();
+ String buttonText = webElements.get(0).getText();
+ SetupCDTest.getExtendTest().log(Status.INFO, "Verifying only one button exist: Add Other Artifact");
+ assertTrue(buttonText.equalsIgnoreCase(("Add Other Artifact")));
+ assertTrue(1==numberOfElements, "There should be only one option for uploading artifact in PNF");
+ }
+
+ @Test
+ public void checkNonCPVLObjectsNotExistInComosition() throws Exception {
+ ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
+ ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
+ String pnfName = pnfMetaData.getName();
+ // Searching for VFC element and make sure it not exist in PNF composition (Only VL/CP are allowed).
+ CompositionPage.searchForElement("BlockStorage");
+ SetupCDTest.getExtendTest().log(Status.INFO, "Verifying Element found");
+ assertTrue(GeneralUIUtils.isElementInvisibleByTestId("BlockStorage"));
+ }
+
@Override
protected UserRoleEnum getRole() {
return UserRoleEnum.DESIGNER;