-/*-
- * ============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.pages;
-
-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;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-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;
-
-public class DeploymentArtifactPage extends GeneralPageElements {
-
- public DeploymentArtifactPage() {
- super();
- }
-
- public static ResourceLeftMenu getLeftPanel() {
- return new ResourceLeftMenu();
- }
-
- public static UploadArtifactPopup artifactPopup() {
- return new UploadArtifactPopup();
- }
-
- protected static void addNewArtifact(ArtifactGroupTypeEnum artifactGroupType) {
- switch (artifactGroupType) {
- case DEPLOYMENT:
- GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPageEnum.ADD_DEPLOYMENT_ARTIFACT.getValue()).click();
- break;
- case INFORMATIONAL:
- GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPageEnum.ADD_INFORMATIONAL_ARTIFACT.getValue()).click();
- break;
- default:
- break;
- }
- }
-
- public static void clickAddNewArtifact() {
- 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();
- }
-
- public static void clickEditEnvArtifact(String artifactLabel) {
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.EDIT_PARAMETERS_OF_ARTIFACT.getValue() + artifactLabel).click();
- }
-
- public static void clickDeleteArtifact(String artifactLabel) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Deleting %s Artefact ",artifactLabel));
- 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);
- ExtentTestActions.log(Status.INFO, String.format("%s Envartifact was downloaded successfully!", envFileNameToDownload));
- }
-
- public static void clickSaveEnvParameters() {
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPopup.SAVE.getValue()).click();
- 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();
- GeneralUIUtils.getWebElementBy(By.className("flex-container"));
- GeneralUIUtils.waitForAngular();
- }
-
- public static String getArtifactDescription(String artifactLabel) throws Exception {
- clickOnArtifactDescription(artifactLabel); // open artifact
- WebElement artifactDescriptionElement = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.GET_DEPLOYMENT_ARTIFACT_DESCRIPTION.getValue());
- String artifactDesc = artifactDescriptionElement.getAttribute("value");
- closeArtifactDescription(artifactLabel); // close artifact
- return artifactDesc;
- }
-
- public static void closeArtifactDescription(String artifactLabel) {
- GeneralUIUtils.clickOnElementByTestId("popover-x-button");
- }
-
- public static WebElement clickOnArtifactDescription(String artifactLabel) throws Exception {
- try{
- WebElement artifact = GeneralUIUtils.getWebElementByTestID("descriptionIcon_" + artifactLabel);
- artifact.click();
- GeneralUIUtils.waitForLoader();
- return artifact;
- }
- catch(Exception e){
- throw new Exception("Artifact " + artifactLabel + "is not found");
- }
- }
-
- public static boolean checkElementsCountInTable(int expectedElementsCount) {
- return GeneralPageElements.checkElementsCountInTable(expectedElementsCount + 1);
- }
-
- public static String[] verifyArtifactsExistInTable(String filepath, String vnfFile) throws Exception{
- String[] artifactNamesFromZipFile = FileHandling.getArtifactsFromZip(filepath, vnfFile);
- return verifyArtifactsExistInTable(artifactNamesFromZipFile);
- }
-
- public static String[] verifyArtifactsExistInTable(String[] artifactNamesFromZipFile) throws Exception{
- if (artifactNamesFromZipFile != null){
- checkArtifactsDisplayed(artifactNamesFromZipFile);
- checkEnvArtifactsDisplayed();
- }
-
- return artifactNamesFromZipFile;
- }
-
- public static void checkArtifactsDisplayed(String[] artifactsFromZipFile) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Verifying the artifacts in the table");
- List<String> artifactList = Lists.newArrayList(artifactsFromZipFile).stream().filter(p -> !p.contains(".env")).map(p -> getVisualArtifactName(p)).collect(Collectors.toList());
- try{
-// List<WebElement> rows = GeneralUIUtils.getElementsByCSS("div div[data-tests-id^='artifact-item'] span.ng-binding:nth-of-type(2)");
- List<WebElement> rows = GeneralUIUtils.getElementsByCSS("div div[data-tests-id^='artifact-item'] span[data-tests-id^='artifactDisplayName']");
- for (WebElement r : rows){
- String artifactDisplayed = r.getAttribute("textContent").trim();
- if (artifactList.contains(artifactDisplayed)){
- artifactList.remove(artifactDisplayed);
- }
- else if (artifactDisplayed.toLowerCase().contains("license")){
- artifactList.add(artifactDisplayed);
- }
- }
- checkLicenseArtifactsDisplayed(artifactList);
- }
- catch(Exception e){
- throw new Exception("Table problem");
- }
-
-
- if (!artifactList.isEmpty()){
- throw new Exception(String.format("missing the following artifact(s) : %s", artifactList.toString()));
- }
- }
-
- public static void checkEnvArtifactsDisplayed() throws Exception {
- List<WebElement> envRows;
- List<WebElement> heatRows;
- List<WebElement> heatNetRows;
- List<WebElement> heatVolRows;
- int envArtifactsSize = 0;
-
- SetupCDTest.getExtendTest().log(Status.INFO, "Verifying the HEAT_ENV artifacts in the table");
-
- try{
- envRows = GeneralUIUtils.getElementsByCSS("div div[data-tests-id='HEAT_ENV']");
-
- heatRows = GeneralUIUtils.getElementsByCSS("div div[tooltip-content='HEAT']");
- heatNetRows = GeneralUIUtils.getElementsByCSS("div div[tooltip-content='HEAT_NET']");
- heatVolRows = GeneralUIUtils.getElementsByCSS("div div[tooltip-content='HEAT_VOL']");
-
- envArtifactsSize = heatRows.size() + heatNetRows.size() + heatVolRows.size();
- }
- catch(Exception e){
- throw new Exception("Table problem");
- }
-
- if (envArtifactsSize !=envRows.size()){
- throw new Exception(String.format("some env artifacts are missing... there is %s instead of %s", envRows.size(), envArtifactsSize));
- }
-
- }
-
- public static void checkLicenseArtifactsDisplayed(List<String> rowsFromTable) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Verifying the license artifacts in the table");
- String vfLicense = getPreparedLicense(ArtifactTypeEnum.VF_LICENSE.getType());
- String[] split = vfLicense.split(" ");
- vfLicense = vfLicense.replaceAll(split[0], split[0].toUpperCase());
- if (rowsFromTable.contains(vfLicense)){
- rowsFromTable.remove(vfLicense);
- }
-
- String vendorLicense = getPreparedLicense(ArtifactTypeEnum.VENDOR_LICENSE.getType());
- if (rowsFromTable.contains(vendorLicense)){
- rowsFromTable.remove(vendorLicense);
- }
-
- }
-
- public static String getPreparedLicense(String license) {
- return WordUtils.capitalizeFully(license.replaceAll("_", " "));
- }
-
-
- private static String getVisualArtifactName(String artifactName) {
- if (artifactName.contains(".")){
- return artifactName.substring(0, artifactName.lastIndexOf("."));
- }
- return artifactName;
- }
-
- public static void updateDescription(String newDescription, ArtifactInfo artefact) throws Exception{
- UploadArtifactPopup artifactPopup = new UploadArtifactPopup(true);
- DeploymentArtifactPage.clickEditArtifact(artefact.getArtifactLabel());
- artifactPopup.insertDescription(newDescription);
- artifactPopup.clickDoneButton();
- }
-
- public static List<String> getDeploymentArtifactsNamesWorkSpace() {
- return GeneralUIUtils.getWebElementListText(GeneralUIUtils.getWebElementsListByContainTestID(DataTestIdEnum.ArtifactPageEnum.ARTIFACT_NAME.getValue()));
- }
-
- //Get Artifact Type by Artifact Name.
- public static String getArtifactType(String artifactName){
- 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);
- }
-
- public static void clearSearchBoxEnv() {
- GeneralUIUtils.getWebElementByContainsClassName("w-sdc-env-search-input").clear();
- }
-
-}
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * SDC\r
+ * ================================================================================\r
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
+ * ================================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END=========================================================\r
+ */\r
+\r
+package org.openecomp.sdc.ci.tests.pages;\r
+\r
+import com.aventstack.extentreports.Status;\r
+import org.apache.commons.lang.WordUtils;\r
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;\r
+import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;\r
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;\r
+import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;\r
+import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;\r
+import org.openecomp.sdc.ci.tests.utilities.FileHandling;\r
+import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;\r
+import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;\r
+import org.openqa.selenium.By;\r
+import org.openqa.selenium.WebElement;\r
+import org.testng.collections.Lists;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import java.util.stream.Collectors;\r
+\r
+public class DeploymentArtifactPage extends GeneralPageElements {\r
+\r
+ public DeploymentArtifactPage() {\r
+ super();\r
+ }\r
+\r
+ public static ResourceLeftMenu getLeftPanel() {\r
+ return new ResourceLeftMenu();\r
+ }\r
+\r
+ public static UploadArtifactPopup artifactPopup() {\r
+ return new UploadArtifactPopup();\r
+ }\r
+\r
+ protected static void addNewArtifact(ArtifactGroupTypeEnum artifactGroupType) {\r
+ switch (artifactGroupType) {\r
+ case DEPLOYMENT:\r
+ GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPageEnum.ADD_DEPLOYMENT_ARTIFACT.getValue()).click();\r
+ break;\r
+ case INFORMATIONAL:\r
+ GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPageEnum.ADD_INFORMATIONAL_ARTIFACT.getValue()).click();\r
+ break;\r
+ default:\r
+ break;\r
+ }\r
+ }\r
+\r
+ public static void clickAddNewArtifact() {\r
+ addNewArtifact(ArtifactGroupTypeEnum.DEPLOYMENT);\r
+ }\r
+\r
+ public static void clickAddAnotherArtifact() {\r
+ GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.ADD_ANOTHER_ARTIFACT.getValue()).click();\r
+ }\r
+\r
+ public static void clickEditArtifact(String artifactLabel) {\r
+ GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.EDIT_ARTIFACT.getValue() + artifactLabel).click();\r
+ }\r
+ \r
+ public static void clickEditEnvArtifact(String artifactLabel) {\r
+ GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.EDIT_PARAMETERS_OF_ARTIFACT.getValue() + artifactLabel).click();\r
+ }\r
+\r
+ public static void hoverArtifact(String artifactLabel) {\r
+ GeneralUIUtils.hoverOnAreaByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_NAME.getValue() + artifactLabel);\r
+ }\r
+\r
+ public static void clickDeleteArtifact(String artifactLabel) {\r
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Deleting %s Artefact ",artifactLabel));\r
+ GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.DELETE_ARTIFACT.getValue() + artifactLabel).click();\r
+ }\r
+\r
+ public static WebElement clickDownloadArtifact(String artifactLabel) {\r
+ WebElement downloadButton = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT.getValue() + artifactLabel);\r
+\r
+ return downloadButton;\r
+ }\r
+ \r
+ public static void clickDownloadEnvArtifact(String envFileNameToDownload) {\r
+ ExtentTestActions.log(Status.INFO, String.format("Downloading the updated %s artifact for validate parameters with the response after the update...", envFileNameToDownload));\r
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT_ENV.getValue() + envFileNameToDownload);\r
+ ExtentTestActions.log(Status.INFO, String.format("%s Envartifact was downloaded successfully!", envFileNameToDownload));\r
+ }\r
+ \r
+ public static void clickSaveEnvParameters() {\r
+ GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPopup.SAVE.getValue()).click();\r
+ GeneralUIUtils.ultimateWait();\r
+ }\r
+\r
+ public static void clickCloseEnvParameters() {\r
+ GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPopup.CANCEL_BUTTON.getValue()).click();\r
+ GeneralUIUtils.ultimateWait();\r
+ }\r
+ \r
+ public static WebElement getAddOtherArtifactButton(){\r
+ return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.ADD_ANOTHER_ARTIFACT.getValue());\r
+ }\r
+ \r
+ public static void clickOK(){\r
+ SetupCDTest.getExtendTest().log(Status.INFO, "Artifact Page, Clicking OK");\r
+ GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.OK.getValue()).click();\r
+ GeneralUIUtils.getWebElementBy(By.className("flex-container"));\r
+ GeneralUIUtils.waitForAngular();\r
+ }\r
+\r
+ public static String getArtifactDescription(String artifactLabel) throws Exception {\r
+ clickOnArtifactDescription(artifactLabel); // open artifact\r
+ WebElement artifactDescriptionElement = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.GET_DEPLOYMENT_ARTIFACT_DESCRIPTION.getValue());\r
+ String artifactDesc = artifactDescriptionElement.getAttribute("value");\r
+ closeArtifactDescription(artifactLabel); // close artifact\r
+ return artifactDesc;\r
+ }\r
+\r
+ public static void closeArtifactDescription(String artifactLabel) {\r
+ GeneralUIUtils.clickOnElementByTestId("popover-x-button");\r
+ }\r
+\r
+ public static WebElement clickOnArtifactDescription(String artifactLabel) throws Exception {\r
+ try{\r
+ WebElement artifact = GeneralUIUtils.getWebElementByTestID("descriptionIcon_" + artifactLabel);\r
+ artifact.click();\r
+ GeneralUIUtils.waitForLoader();\r
+ return artifact;\r
+ }\r
+ catch(Exception e){\r
+ throw new Exception("Artifact " + artifactLabel + "is not found");\r
+ }\r
+ }\r
+ \r
+ public static boolean checkElementsCountInTable(int expectedElementsCount) {\r
+ return GeneralPageElements.checkElementsCountInTable(expectedElementsCount + 1);\r
+ }\r
+ \r
+ public static String[] verifyArtifactsExistInTable(String filepath, String vnfFile) throws Exception{\r
+ String[] artifactNamesFromZipFile = FileHandling.getArtifactsFromZip(filepath, vnfFile);\r
+ return verifyArtifactsExistInTable(artifactNamesFromZipFile);\r
+ }\r
+ \r
+ public static String[] verifyArtifactsExistInTable(String[] artifactNamesFromZipFile) throws Exception{\r
+ if (artifactNamesFromZipFile != null){\r
+ checkArtifactsDisplayed(artifactNamesFromZipFile);\r
+ checkEnvArtifactsDisplayed();\r
+ }\r
+ \r
+ return artifactNamesFromZipFile;\r
+ }\r
+\r
+ public static void checkArtifactsDisplayed(String[] artifactsFromZipFile) throws Exception {\r
+ SetupCDTest.getExtendTest().log(Status.INFO, "Verifying the artifacts in the table");\r
+ List<String> artifactList = Lists.newArrayList(artifactsFromZipFile).stream().filter(p -> !p.contains(".env")).map(p -> getVisualArtifactName(p)).collect(Collectors.toList());\r
+ try{\r
+// List<WebElement> rows = GeneralUIUtils.getElementsByCSS("div div[data-tests-id^='artifact-item'] span.ng-binding:nth-of-type(2)");\r
+ List<WebElement> rows = GeneralUIUtils.getElementsByCSS("div div[data-tests-id^='artifact-item'] span[data-tests-id^='artifactDisplayName']");\r
+ for (WebElement r : rows){\r
+ String artifactDisplayed = r.getAttribute("textContent").trim();\r
+ if (artifactList.contains(artifactDisplayed)){\r
+ artifactList.remove(artifactDisplayed);\r
+ }\r
+ else if (artifactDisplayed.toLowerCase().contains("license")){\r
+ artifactList.add(artifactDisplayed);\r
+ }\r
+ }\r
+ checkLicenseArtifactsDisplayed(artifactList);\r
+ }\r
+ catch(Exception e){\r
+ throw new Exception("Table problem");\r
+ }\r
+ \r
+ \r
+ if (!artifactList.isEmpty()){\r
+ throw new Exception(String.format("missing the following artifact(s) : %s", artifactList.toString()));\r
+ }\r
+ }\r
+\r
+ public static void checkEnvArtifactsDisplayed() throws Exception {\r
+ List<WebElement> envRows;\r
+ List<WebElement> heatRows;\r
+ List<WebElement> heatNetRows;\r
+ List<WebElement> heatVolRows;\r
+ int envArtifactsSize = 0;\r
+ \r
+ SetupCDTest.getExtendTest().log(Status.INFO, "Verifying the HEAT_ENV artifacts in the table");\r
+ \r
+ try{\r
+ envRows = GeneralUIUtils.getElementsByCSS("div div[data-tests-id='HEAT_ENV']");\r
+ \r
+ heatRows = GeneralUIUtils.getElementsByCSS("div div[tooltip-content='HEAT']");\r
+ heatNetRows = GeneralUIUtils.getElementsByCSS("div div[tooltip-content='HEAT_NET']");\r
+ heatVolRows = GeneralUIUtils.getElementsByCSS("div div[tooltip-content='HEAT_VOL']");\r
+ \r
+ envArtifactsSize = heatRows.size() + heatNetRows.size() + heatVolRows.size();\r
+ }\r
+ catch(Exception e){\r
+ throw new Exception("Table problem");\r
+ }\r
+ \r
+ if (envArtifactsSize !=envRows.size()){\r
+ throw new Exception(String.format("some env artifacts are missing... there is %s instead of %s", envRows.size(), envArtifactsSize)); \r
+ }\r
+ \r
+ }\r
+\r
+ public static void checkLicenseArtifactsDisplayed(List<String> rowsFromTable) throws Exception {\r
+ SetupCDTest.getExtendTest().log(Status.INFO, "Verifying the license artifacts in the table");\r
+ String vfLicense = getPreparedLicense(ArtifactTypeEnum.VF_LICENSE.getType());\r
+ String[] split = vfLicense.split(" ");\r
+ vfLicense = vfLicense.replaceAll(split[0], split[0].toUpperCase());\r
+ if (rowsFromTable.contains(vfLicense)){\r
+ rowsFromTable.remove(vfLicense);\r
+ }\r
+ \r
+ String vendorLicense = getPreparedLicense(ArtifactTypeEnum.VENDOR_LICENSE.getType());\r
+ if (rowsFromTable.contains(vendorLicense)){ \r
+ rowsFromTable.remove(vendorLicense);\r
+ }\r
+\r
+ }\r
+\r
+ public static String getPreparedLicense(String license) {\r
+ return WordUtils.capitalizeFully(license.replaceAll("_", " "));\r
+ }\r
+ \r
+\r
+ private static String getVisualArtifactName(String artifactName) {\r
+ if (artifactName.contains(".")){\r
+ return artifactName.substring(0, artifactName.lastIndexOf("."));\r
+ }\r
+ return artifactName;\r
+ }\r
+ \r
+ public static void updateDescription(String newDescription, ArtifactInfo artefact) throws Exception{\r
+ UploadArtifactPopup artifactPopup = new UploadArtifactPopup(true);\r
+ DeploymentArtifactPage.clickEditArtifact(artefact.getArtifactLabel());\r
+ artifactPopup.insertDescription(newDescription);\r
+ artifactPopup.clickDoneButton();\r
+ }\r
+ \r
+ public static List<String> getDeploymentArtifactsNamesWorkSpace() {\r
+ return GeneralUIUtils.getWebElementListText(GeneralUIUtils.getWebElementsListByContainTestID(DataTestIdEnum.ArtifactPageEnum.ARTIFACT_NAME.getValue()));\r
+ }\r
+ \r
+ //Get Artifact Type by Artifact Name.\r
+ public static String getArtifactType(String artifactName){\r
+ return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.TYPE.getValue()+artifactName).getText();\r
+ }\r
+ \r
+ public static List<String> getHeatParametersInUI(String dataTestId){\r
+ List<WebElement>elements;\r
+ List<String>Names=new ArrayList<>();\r
+ elements=GeneralUIUtils.getWebElementsListByContainTestID(dataTestId);\r
+ for (WebElement webElement : elements) {\r
+ String attributevalue=webElement.getAttribute("data-tests-id");\r
+ Names.add(attributevalue.replace("heatParameterName_", ""));\r
+ }\r
+ return Names;\r
+ }\r
+ \r
+ public static void searchBoxEnv(String parameterName) {\r
+ GeneralUIUtils.getWebElementByContainsClassName("w-sdc-env-search-input").sendKeys(parameterName);\r
+ }\r
+ \r
+ public static void clearSearchBoxEnv() {\r
+ GeneralUIUtils.getWebElementByContainsClassName("w-sdc-env-search-input").clear();\r
+ }\r
+\r
+ public static void editHeatParamValue(String paramName, String value) throws Exception {\r
+ SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + paramName + " parameter on Heat Params modal screen");\r
+ WebElement valueTextbox = GeneralUIUtils.getWebElementByTestID(paramName);\r
+\r
+ clickOnHeatParam(paramName);\r
+ valueTextbox.clear();\r
+ SetupCDTest.getExtendTest().log(Status.INFO, "Editing " + paramName + " value on Heat Params modal screen");\r
+ valueTextbox.sendKeys(value);\r
+ GeneralUIUtils.ultimateWait();\r
+\r
+ }\r
+\r
+ public static void clickOnDeleteHeatParamValue(String paramName) throws Exception {\r
+ SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + paramName + " parameter on Properties screen");\r
+ String value = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.EnvParameterView.ENV_CURRENT_VALUE.getValue() + paramName).getAttribute("value");\r
+ if (value!=null) {\r
+ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPageEnum.DELETE_PARAMETER_OF_ARTIFACT.getValue() + paramName);\r
+ GeneralUIUtils.ultimateWait();\r
+ SetupCDTest.getExtendTest().log(Status.INFO, "Value of " + paramName + " is deleted");\r
+ }\r
+ SetupCDTest.getExtendTest().log(Status.INFO, "Value of " + paramName + " is empty and cannot be deleted");\r
+ }\r
+\r
+ public static void clickOnHeatParam(String paramName)throws Exception {\r
+\r
+ SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on the %s component in Properties", paramName));\r
+ GeneralUIUtils.clickOnElementByTestId(paramName);\r
+ GeneralUIUtils.ultimateWait();\r
+ GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.LIFECYCLE_STATE.getValue());\r
+ }\r
+\r
+}\r