diff options
author | sebdet <sebastien.determe@intl.att.com> | 2021-06-04 17:28:49 +0200 |
---|---|---|
committer | Andr� Schmid <andre.schmid@est.tech> | 2021-06-08 09:13:46 +0000 |
commit | c65578b5c01651975d218d81e0f4856746641298 (patch) | |
tree | 68cd6938175fee780facf22b5e7ecae1da0408e8 /integration-tests/src/test/java/org/onap | |
parent | b08daeee5442d8422e2e23047ed13aa10d8303f9 (diff) |
Dead Code removal
Removal of dead code found during Config manager analysis
Issue-ID: SDC-3616
Change-Id: I50c15dfcba7518c32af953fe481ef013aa393ca5
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Diffstat (limited to 'integration-tests/src/test/java/org/onap')
2 files changed, 6 insertions, 108 deletions
diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/AmdocsComplexService/PathValidations.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/AmdocsComplexService/PathValidations.java index 93c15f2596..a3e7bab014 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/AmdocsComplexService/PathValidations.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/AmdocsComplexService/PathValidations.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * SDC * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017, 2021 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. @@ -22,33 +22,22 @@ package org.onap.sdc.frontend.ci.tests.execute.AmdocsComplexService; import com.aventstack.extentreports.Status; import com.clearspring.analytics.util.Pair; -import org.apache.commons.lang3.RandomStringUtils; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import org.apache.commons.lang.RandomStringUtils; import org.json.JSONObject; import org.onap.sdc.frontend.ci.tests.datatypes.DataTestIdEnum; -import org.onap.sdc.backend.ci.tests.datatypes.HeatMetaFirstLevelDefinition; import org.onap.sdc.backend.ci.tests.datatypes.ServiceReqDetails; -import org.onap.sdc.backend.ci.tests.datatypes.VendorSoftwareProductObject; import org.onap.sdc.backend.ci.tests.datatypes.http.RestResponse; -import org.onap.sdc.backend.ci.tests.execute.devCI.ArtifactFromCsar; -import org.onap.sdc.frontend.ci.tests.pages.DeploymentArtifactPage; -import org.onap.sdc.frontend.ci.tests.utilities.DownloadManager; -import org.onap.sdc.frontend.ci.tests.utilities.FileHandling; import org.onap.sdc.frontend.ci.tests.utilities.GeneralUIUtils; -import org.onap.sdc.frontend.ci.tests.utilities.OnboardingUiUtils; -import org.onap.sdc.frontend.ci.tests.execute.setup.ArtifactsCorrelationManager; import org.onap.sdc.frontend.ci.tests.execute.setup.ExtentTestActions; import org.onap.sdc.frontend.ci.tests.execute.setup.SetupCDTest; -import org.onap.sdc.frontend.ci.tests.pages.ResourceGeneralPage; import org.openqa.selenium.WebElement; -import java.io.File; -import java.util.*; -import java.util.stream.Collectors; - import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertNotSame; - public class PathValidations { @@ -56,46 +45,6 @@ public class PathValidations { public static final int NUMBER_OF_LINES = 3; public static final int NUMBER_OF_LINES_TO_DELETE = 1; - public static String[] validateServiceExtendedPath(String vspName) throws Exception { - PathUtilities.linkVFs(vspName, NUMBER_OF_LINKS); - PathUtilities.openCreatePath(); - String pathName = "name1"; - PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1"); - PathUtilities.selectFirstLineParam(); - PathValidations.extendPath(NUMBER_OF_LINES); - //delete line - PathUtilities.deleteLines(NUMBER_OF_LINES_TO_DELETE, NUMBER_OF_LINES); - GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue()); - ExtentTestActions.log(Status.INFO, "path has been created"); - PathValidations.checkPathFilter(pathName, true); - GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.PATH_MENU_BUTTON.getValue() + "']/parent::*").get(0).click(); - GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue()); - String PathListName1 = GeneralUIUtils.findByText(pathName).getText(); - // edit path - String newPathName = "name2"; - PathUtilities.editPathName(pathName, newPathName); - - GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.PATH_MENU_BUTTON.getValue() + "']/parent::*").get(0).click(); - GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue()); - String PathListName2 = GeneralUIUtils.findByText(newPathName).getText(); - - // assert names changed - assertNotSame("path name expected to change after edit but did not", PathListName1, PathListName2); - - // delete path - int paths_before_deletion = GeneralUIUtils.findElementsByXpath("//*[text()='" + newPathName + "']/parent::*//span").size(); - GeneralUIUtils.findElementsByXpath(newPathName).get(1).click(); - GeneralUIUtils.ultimateWait(); - int paths_after_deletion = GeneralUIUtils.findElementsByXpath("//*[text()='" + newPathName + "']/parent::*//span").size(); - assertNotSame("path expected to be deleted but did not", paths_after_deletion, paths_before_deletion); - - GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_CLOSE.getValue()); - SetupCDTest.getExtendTest().log(Status.INFO, "Path has been created"); - // check that path got deleted in the path filter list - PathValidations.checkPathFilter(newPathName, false); - return new String[]{pathName, newPathName}; - } - public static String[] validateComplexExtendedPath(String[] services) throws Exception { PathUtilities.linkServices(services[0], services[1], NUMBER_OF_LINKS); PathUtilities.openCreatePath(); @@ -333,28 +282,4 @@ public class PathValidations { PathUtilities.openPathList(); PathUtilities.editPathName(pathName, "newName2"); } - - public static void importAndVerifyVSP(VendorSoftwareProductObject createVendorSoftwareProduct, String filepath, String vnfFile) throws Exception { - DownloadManager.downloadCsarByNameFromVSPRepository(createVendorSoftwareProduct.getName(), createVendorSoftwareProduct.getVspId()); - File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir(); - - OnboardingUiUtils.importVSP(createVendorSoftwareProduct); - - ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen(); - - // Verify deployment artifacts - Map<String, Object> combinedMap = ArtifactFromCsar.combineHeatArtifacstWithFolderArtifacsToMap(latestFilefromDir.getAbsolutePath()); - - LinkedList<HeatMetaFirstLevelDefinition> deploymentArtifacts = ((LinkedList<HeatMetaFirstLevelDefinition>) combinedMap.get("Deployment")); - ArtifactsCorrelationManager.addVNFartifactDetails(vnfFile, deploymentArtifacts); - - List<String> heatEnvFilesFromCSAR = deploymentArtifacts.stream().filter(e -> e.getType().equals("HEAT_ENV")). - map(e -> e.getFileName()). - collect(Collectors.toList()); - - OnboardingUiUtils.validateDeploymentArtifactsVersion(deploymentArtifacts, heatEnvFilesFromCSAR); - - DeploymentArtifactPage.verifyArtifactsExistInTable(filepath, vnfFile); - } - } diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/DeploymentArtifactPage.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/DeploymentArtifactPage.java index 9a8e5ec35a..999391f771 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/DeploymentArtifactPage.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/DeploymentArtifactPage.java @@ -2,7 +2,7 @@ * ============LICENSE_START=======================================================
* SDC
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017, 2021 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.
@@ -33,8 +33,6 @@ import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum; import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.collections.Lists;
-
-import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@@ -69,10 +67,6 @@ public class DeploymentArtifactPage extends GeneralPageElements { addNewArtifact(ArtifactGroupTypeEnum.DEPLOYMENT);
}
- public static void clickAddAnotherArtifact() {
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.ADD_ANOTHER_ARTIFACT.getValue()).click();
- }
-
public static void clickEditArtifact(String artifactLabel) {
GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.EDIT_ARTIFACT.getValue() + artifactLabel).click();
}
@@ -90,12 +84,6 @@ public class DeploymentArtifactPage extends GeneralPageElements { GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.DELETE_ARTIFACT.getValue() + artifactLabel).click();
}
- public static WebElement clickDownloadArtifact(String artifactLabel) {
- WebElement downloadButton = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT.getValue() + artifactLabel);
-
- return downloadButton;
- }
-
public static void clickDownloadEnvArtifact(String envFileNameToDownload) {
ExtentTestActions.log(Status.INFO, String.format("Downloading the updated %s artifact for validate parameters with the response after the update...", envFileNameToDownload));
GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT_ENV.getValue() + envFileNameToDownload);
@@ -112,10 +100,6 @@ public class DeploymentArtifactPage extends GeneralPageElements { GeneralUIUtils.ultimateWait();
}
- public static WebElement getAddOtherArtifactButton() {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.ADD_ANOTHER_ARTIFACT.getValue());
- }
-
public static void clickOK() {
SetupCDTest.getExtendTest().log(Status.INFO, "Artifact Page, Clicking OK");
GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.OK.getValue()).click();
@@ -259,17 +243,6 @@ public class DeploymentArtifactPage extends GeneralPageElements { return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.TYPE.getValue() + artifactName).getText();
}
- public static List<String> getHeatParametersInUI(String dataTestId) {
- List<WebElement> elements;
- List<String> Names = new ArrayList<>();
- elements = GeneralUIUtils.getWebElementsListByContainTestID(dataTestId);
- for (WebElement webElement : elements) {
- String attributevalue = webElement.getAttribute("data-tests-id");
- Names.add(attributevalue.replace("heatParameterName_", ""));
- }
- return Names;
- }
-
public static void searchBoxEnv(String parameterName) {
GeneralUIUtils.getWebElementByContainsClassName("w-sdc-env-search-input").sendKeys(parameterName);
}
|