summaryrefslogtreecommitdiffstats
path: root/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup
diff options
context:
space:
mode:
Diffstat (limited to 'ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup')
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ArtifactsCorrelationManager.java72
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/AttFtpClient.java221
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/DriverFactory.java125
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentManager.java169
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestActions.java114
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestManager.java60
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/MobProxy.java103
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/OnboardCSVReport.java63
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ReportAfterTestManager.java129
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/Retry.java44
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java573
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/TestFtp.java94
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WebDriverThread.java164
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WindowTest.java77
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WindowTestManager.java52
15 files changed, 2060 insertions, 0 deletions
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ArtifactsCorrelationManager.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ArtifactsCorrelationManager.java
new file mode 100644
index 0000000000..7f67978aea
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ArtifactsCorrelationManager.java
@@ -0,0 +1,72 @@
+/*-
+ * ============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.setup;
+
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
+
+public class ArtifactsCorrelationManager {
+
+ private static HashMap<String, LinkedList<HeatMetaFirstLevelDefinition>> vNFArtifactsCorrelationMap = new HashMap<String, LinkedList<HeatMetaFirstLevelDefinition>>();
+ private static HashMap<String, Entry<String, LinkedList<HeatMetaFirstLevelDefinition>>> serviceVNFCorrelationMap = new HashMap<String, Entry<String, LinkedList<HeatMetaFirstLevelDefinition>>>();
+
+ public static void addVNFartifactDetails(String vspName,
+ LinkedList<HeatMetaFirstLevelDefinition> deploymentArtifacts) {
+
+ vNFArtifactsCorrelationMap.put(vspName, deploymentArtifacts);
+
+
+ }
+
+ public static Entry<String, LinkedList<HeatMetaFirstLevelDefinition>> getVNFartifactDetails(String vnfName){
+
+
+ Set<Entry<String, LinkedList<HeatMetaFirstLevelDefinition>>> entrySet = vNFArtifactsCorrelationMap.entrySet();
+ for (Entry<String, LinkedList<HeatMetaFirstLevelDefinition>> entry : entrySet) {
+ String key = entry.getKey();
+ if (key.equals(vnfName)) {
+ return entry;
+ }
+
+ }
+ return null;
+
+ }
+
+
+ public static void addVNFtoServiceArtifactCorrelation(String service, String vnfName){
+
+ serviceVNFCorrelationMap.put(service, getVNFartifactDetails(vnfName));
+
+ }
+
+ public static Set<Entry<String, Entry<String, LinkedList<HeatMetaFirstLevelDefinition>>>> getServiceArtifactCorrelationMap(String service){
+
+ return serviceVNFCorrelationMap.entrySet();
+
+ }
+
+}
+
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/AttFtpClient.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/AttFtpClient.java
new file mode 100644
index 0000000000..1d7c4ae554
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/AttFtpClient.java
@@ -0,0 +1,221 @@
+/*-
+ * ============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.setup;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.apache.commons.io.output.ByteArrayOutputStream;
+import org.apache.commons.net.ftp.FTP;
+import org.apache.commons.net.ftp.FTPClient;
+import org.apache.commons.net.ftp.FTPFile;
+import org.apache.commons.net.ftp.FTPReply;
+
+public class AttFtpClient {
+
+ private static final AttFtpClient instance = new AttFtpClient();
+
+ public static AttFtpClient getInstance() {
+ return instance;
+ }
+
+ private FTPClient apacheFtpClient;
+
+ private AttFtpClient() {
+ apacheFtpClient = new FTPClient();
+ };
+
+
+ public void init(String server, int port, String user, String pass) {
+
+ try {
+ apacheFtpClient.connect(server, port);
+ showServerReply(apacheFtpClient);
+
+
+ int replyCode = apacheFtpClient.getReplyCode();
+ if (!FTPReply.isPositiveCompletion(replyCode)) {
+ System.out.println("Connect failed");
+ return;
+ }
+
+ boolean success = apacheFtpClient.login(user, pass);
+ showServerReply(apacheFtpClient);
+
+ if (!success) {
+ System.out.println("Could not login to the server");
+ return;
+ }
+
+// else{
+// apacheFtpClient.enterLocalPassiveMode();
+// apacheFtpClient.setFileType(FTP.BINARY_FILE_TYPE);
+// }
+ } catch (IOException ex) {
+ System.out.println("Oops! Something wrong happened");
+ ex.printStackTrace();
+ }
+
+ }
+
+ public File retrieveLastModifiedFileFromFTP() throws IOException {
+ FTPFile[] files1 = retrieveListOfFile();
+
+ // sort list by TimeStamp
+ List<FTPFile> sorted = Arrays.asList(files1).stream()
+ .sorted((e1, e2) -> e1.getTimestamp().compareTo(e2.getTimestamp())).collect(Collectors.toList());
+ printFileDetailsList(sorted);
+
+ // retrieve file from FTP
+ FTPFile ftpFile = sorted.get(sorted.size() - 1);
+
+ return retrieveFileFromFTP(ftpFile);
+
+ }
+
+ public FTPFile[] retrieveListOfFile() throws IOException {
+ // Lists files and directories
+ FTPFile[] files = apacheFtpClient.listFiles("");
+
+ printNames(files);
+ return files;
+ }
+
+ public File retrieveFileFromFTP(FTPFile ftpFile) throws IOException {
+
+ File downloadFile1 = new File("tmp");
+ OutputStream outputStream1 = new BufferedOutputStream(new FileOutputStream(downloadFile1));
+ boolean success = apacheFtpClient.retrieveFile(ftpFile.getName(), outputStream1);
+ outputStream1.close();
+
+ if (success) {
+ System.out.println("File #1 has been downloaded successfully.");
+ }
+
+
+ return downloadFile1;
+
+ }
+
+ public void deleteFilesFromFTPserver() throws IOException {
+ FTPFile[] files = retrieveListOfFile();
+ deleteFiles(files);
+ }
+
+ public void terminateClient() throws IOException {
+
+ String status = apacheFtpClient.getStatus();
+
+ // logs out and disconnects from server
+ try {
+ if (apacheFtpClient.isConnected()) {
+ apacheFtpClient.logout();
+ apacheFtpClient.disconnect();
+ }
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ private void printFileDetailsList(List<FTPFile> list) {
+ DateFormat dateFormater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+ for (FTPFile ftpFile : list) {
+
+ String details = ftpFile.getName();
+ if (ftpFile.isDirectory()) {
+ details = "[" + details + "]";
+ }
+ details += "\t\t" + ftpFile.getSize();
+ details += "\t\t" + dateFormater.format(ftpFile.getTimestamp().getTime());
+
+ System.out.println(details);
+ }
+ }
+
+ private void printNames(FTPFile[] files) {
+ if (files != null && files.length > 0) {
+ for (FTPFile aFile : files) {
+ System.out.println(aFile);
+ }
+ }
+ }
+
+ private void showServerReply(FTPClient ftpClient) {
+ String[] replies = ftpClient.getReplyStrings();
+ if (replies != null && replies.length > 0) {
+ for (String aReply : replies) {
+ System.out.println("SERVER: " + aReply);
+ }
+ }
+ }
+
+ public class LastModifiedComparator implements Comparator<FTPFile> {
+
+ public int compare(FTPFile f1, FTPFile f2) {
+ return f1.getTimestamp().compareTo(f2.getTimestamp());
+ }
+ }
+
+ public FTPFile getMaxLastModified(FTPFile[] ftpFiles) {
+ return Collections.max(Arrays.asList(ftpFiles), new LastModifiedComparator());
+ }
+
+ public static void displayFiles(File[] files) {
+ for (File file : files) {
+ System.out.printf("File: %-20s Last Modified:" + new Date(file.lastModified()) + "\n", file.getName());
+ }
+ }
+
+ public void deleteFiles(FTPFile[] files) {
+
+ for (FTPFile file : files) {
+
+ boolean deleted = false;
+ try {
+ deleted = apacheFtpClient.deleteFile(file.getName());
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ if (deleted) {
+ System.out.println("The file was deleted successfully.");
+ } else {
+ System.out.println("Could not delete theĀ  file, it may not exist.");
+ }
+ }
+
+ }
+
+}
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
new file mode 100644
index 0000000000..7d0d77acfa
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/DriverFactory.java
@@ -0,0 +1,125 @@
+/*-
+ * ============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.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;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.firefox.FirefoxProfile;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+
+
+public class DriverFactory {
+
+ private static ThreadLocal<WebDriverThread> driverThread;
+ private static List<WebDriverThread> webDriverThreadPool = Collections.synchronizedList(new ArrayList<WebDriverThread>());
+ private static Config config;
+
+ public DriverFactory() {
+ try {
+ config = Utils.getConfig();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @BeforeSuite(alwaysRun = true)
+ public static void instantiateDriverObject() {
+
+
+ File basePath = new File(FileHandling.getBasePath());
+ File[] listFiles = basePath.listFiles(new FilenameFilter() {
+
+ @Override
+ public boolean accept(File basePath, String name) {
+ return name.startsWith(WebDriverThread.AUTOMATION_DOWNLOAD_DIR);
+ }
+ });
+ Arrays.asList(listFiles).forEach(e -> FileHandling.deleteDirectory(e.getAbsolutePath()));
+
+
+
+ driverThread = new ThreadLocal<WebDriverThread>() {
+ @Override
+ protected WebDriverThread initialValue() {
+ WebDriverThread webDriverThread = new WebDriverThread(config);
+ webDriverThreadPool.add(webDriverThread);
+ return webDriverThread;
+ }
+ };
+ }
+
+ public static WebDriver getDriver() throws Exception {
+ return driverThread.get().getDriver();
+ }
+
+ public static FirefoxProfile getDriverFirefoxProfile() throws Exception {
+ return driverThread.get().getFirefoxProfile();
+ }
+
+ @AfterSuite(alwaysRun = true)
+ public static void quitDriverAfterSuite() throws Exception {
+ for (WebDriverThread webDriverThread : webDriverThreadPool) {
+ if (webDriverThread.getDriver() != null)
+ webDriverThread.quitDriver();
+ }
+ deleteDownloadDirs();
+ }
+
+ private static void deleteDownloadDirs() throws IOException {
+// System.gc();
+ HashMap<Long,WindowTest> windowMap = WindowTestManager.getWholeMap();
+ for (WindowTest win : windowMap.values()){
+ String downloadDirectory = win.getDownloadDirectory();
+ FileUtils.deleteDirectory(new File(downloadDirectory));
+ }
+ }
+
+ public static void quitDriver() throws Exception{
+ driverThread.get().quitDriver();
+ driverThread.remove();
+ WindowTestManager.removeWindowTest();
+ }
+
+ public static Config getConfig() {
+ return config;
+ }
+
+ public static void setConfig(Config config) {
+ DriverFactory.config = config;
+ }
+
+
+}
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
new file mode 100644
index 0000000000..09dcad7c36
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentManager.java
@@ -0,0 +1,169 @@
+/*-
+ * ============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.setup;
+
+import java.io.File;
+
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.utilities.FileHandling;
+import org.openecomp.sdc.ci.tests.utilities.RestCDUtils;
+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;
+
+public class ExtentManager {
+
+ private static final String VERSIONS_INFO_FILE_NAME = "versions.info";
+ private static ExtentReports extent;
+ private static ExtentHtmlReporter htmlReporter;
+ private static ExtentXReporter extentxReporter;
+ private static final String icon = "$(document).ready(function() {" +"\n"+
+ "$('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Pj4+Pj4+Pj4+PzSuP/AzE1e5ONHe7vAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE1LTEyLTIzVDIwOjA0OjMxKzAwOjAwHarZDQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNS0xMi0yM1QyMDowNDozMSswMDowMGz3YbEAAABNdEVYdHNvZnR3YXJlAEltYWdlTWFnaWNrIDYuOS4yLTcgUTE2IHg4Nl82NCAyMDE1LTEyLTAyIGh0dHA6Ly93d3cuaW1hZ2VtYWdpY2sub3Jnbo4WPwAAAEp0RVh0c3ZnOmJhc2UtdXJpAGZpbGU6Ly8vdG1wL3ZpZ25ldHRlL2MxZDQ0ZGY2LWM1ZDYtNDkwMC04ZDBhLWQ0OWVmMzBiZGE3MS5zdmd90CehAAAAGHRFWHRUaHVtYjo6RG9jdW1lbnQ6OlBhZ2VzADGn/7svAAAAGHRFWHRUaHVtYjo6SW1hZ2U6OkhlaWdodAAyNjLFg9PDAAAAF3RFWHRUaHVtYjo6SW1hZ2U6OldpZHRoADU3Mz0hlMwAAAAZdEVYdFRodW1iOjpNaW1ldHlwZQBpbWFnZS9zdme/73BOAAAAF3RFWHRUaHVtYjo6TVRpbWUAMTQ1MDkwMTA3McPsyX0AAAAPdEVYdFRodW1iOjpTaXplADBCQpSiPuwAAABIdEVYdFRodW1iOjpVUkkAZmlsZTovLy90bXAvdmlnbmV0dGUvYzFkNDRkZjYtYzVkNi00OTAwLThkMGEtZDQ5ZWYzMGJkYTcxLnN2Z4N+SbEAAAAASUVORK5CYII=' style='display: block; margin-left: auto; margin-right: auto; margin-top: 7px; width: 89px;'/></span>\").width(\"120px\").css(\"float\",\"left\").css(\"padding-left\",\"0\");$('.report-name').css(\"font-weight\",\"bold\");"+"\n"+
+// "$('.logo-content' ).remove();"+"\n"+
+// "$('#slide-out li:first-child').on('click', function(){ $('#charts-row').hide() }) ; $('#slide-out li:last-child').on('click', function(){ $('#charts-row').show() });"+"\n"+
+// "$('.charts div:nth-child(2)').remove();"+"\n"+
+ "})";
+
+ public enum suiteNameXml {
+
+ TESTNG_FAILED_XML_NAME("testng-failed.xml");
+
+ suiteNameXml(String value) {
+ this.value = value;
+ }
+
+ private String value;
+
+ public String getValue() {
+ return value;
+ }
+
+ }
+
+ public synchronized static ExtentReports setReporter(String filePath, String htmlFile, Boolean isAppend) throws Exception {
+ String dbIp = DriverFactory.getConfig().getReportDBhost();
+ int dbPort = DriverFactory.getConfig().getReportDBport();
+
+ if (extent == null) {
+ extentxReporter = new ExtentXReporter(dbIp, dbPort);
+ extent = new ExtentReports();
+ initAndSetExtentHtmlReporter(filePath, htmlFile, isAppend);
+
+ if(extentxReporter.config().getReportObjectId() != null){
+ setExtentXReporter(isAppend);
+ }else{
+ extentxReporter.stop();
+ }
+ }
+ return extent;
+ }
+
+ public synchronized static void setExtentXReporter(Boolean isAppend){
+ extentxReporter.setAppendExisting(isAppend);
+ extent.attachReporter(extentxReporter);
+ }
+
+ public synchronized static void initAndSetExtentHtmlReporter(String filePath, String htmlFile, Boolean isAppend) throws Exception{
+ htmlReporter = new ExtentHtmlReporter(filePath + htmlFile);
+ setConfiguration(htmlReporter);
+ htmlReporter.setAppendExisting(isAppend);
+ extent.attachReporter(htmlReporter);
+ }
+
+ public synchronized static ExtentReports getReporter() {
+ return extent;
+ }
+
+ public static void initReporter(String filepath, String htmlFile, ITestContext context) throws Exception {
+
+ String onboardVersion = AutomationUtils.getOnboardVersion();
+ String osVersion = AutomationUtils.getOSVersion();
+ Config config = Utils.getConfig();
+ String envData = config.getUrl();
+ String suiteName = getSuiteName(context);
+
+ if(suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue())){
+ if (config.getUseBrowserMobProxy())
+ setTrafficCaptue(config);
+
+ setReporter(filepath, htmlFile, true);
+ String suiteNameFromVersionInfoFile = FileHandling.getKeyByValueFromPropertyFormatFile(filepath + VERSIONS_INFO_FILE_NAME, "suiteName");
+ reporterDataDefinition(onboardVersion, osVersion, envData, suiteNameFromVersionInfoFile);
+ }else{
+ FileHandling.deleteDirectory(SetupCDTest.getReportFolder());
+ FileHandling.createDirectory(filepath);
+ setReporter(filepath, htmlFile, false);
+ reporterDataDefinition(onboardVersion, osVersion, envData, suiteName);
+ AutomationUtils.createVersionsInfoFile(filepath + VERSIONS_INFO_FILE_NAME, onboardVersion, osVersion, envData, suiteName);
+ }
+
+ }
+
+ public static void reporterDataDefinition(String onboardVersion, String osVersion, String envData, String suiteNameFromVersionInfoFile) throws Exception {
+ extent.setSystemInfo("Onboard Version", onboardVersion);
+ extent.setSystemInfo("OS Version", osVersion);
+ extent.setSystemInfo("Host Name Address", RestCDUtils.getExecutionHostAddress());
+ extent.setSystemInfo("ExecutedOn", envData);
+ extent.setSystemInfo("SuiteName", suiteNameFromVersionInfoFile);
+ }
+
+ public static String getSuiteName(ITestContext context) {
+ String suitePath = context.getSuite().getXmlSuite().getFileName();
+ if(suitePath != null){
+ File file = new File(suitePath);
+ String suiteName = file.getName();
+ return suiteName;
+ }
+ return null;
+ }
+
+ public synchronized static ExtentHtmlReporter setConfiguration(ExtentHtmlReporter htmlReporter) throws Exception {
+
+ htmlReporter.config().setTheme(Theme.STANDARD);
+ htmlReporter.config().setEncoding("UTF-8");
+ htmlReporter.config().setProtocol(Protocol.HTTPS);
+ htmlReporter.config().setDocumentTitle("SDC Automation Report");
+ htmlReporter.config().setChartVisibilityOnOpen(true);
+// htmlReporter.config().setReportName(AutomationUtils.getATTVersion());
+ htmlReporter.config().setReportName("SDC Automation Report");
+ htmlReporter.config().setChartVisibilityOnOpen(false);
+ htmlReporter.config().setJS(icon);
+ return htmlReporter;
+ }
+
+ public static void closeReporter(){
+ extent.flush();
+ }
+
+ public static void setTrafficCaptue(Config config) {
+ boolean mobProxyStatus = config.getUseBrowserMobProxy();
+ if (mobProxyStatus){
+ config.setCaptureTraffic(true);;
+ }
+ }
+}
+
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestActions.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestActions.java
new file mode 100644
index 0000000000..0523647c16
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestActions.java
@@ -0,0 +1,114 @@
+/*-
+ * ============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.setup;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.UUID;
+
+import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
+
+import com.aventstack.extentreports.ExtentTest;
+import com.aventstack.extentreports.MediaEntityBuilder;
+import com.aventstack.extentreports.Status;
+import com.aventstack.extentreports.markuputils.ExtentColor;
+import com.aventstack.extentreports.markuputils.Markup;
+import com.aventstack.extentreports.markuputils.MarkupHelper;
+
+public class ExtentTestActions {
+
+ public static void log(Status logStatus, Markup mark){
+ ExtentTest test = ExtentTestManager.getTest();
+ test.log(logStatus, mark);
+ }
+
+ public static void log(Status logStatus, String message){
+ ExtentTest test = ExtentTestManager.getTest();
+ test.log(logStatus, message);
+ }
+
+ public static void log(Status logStatus, String message, String duration){
+ log(logStatus, message + addDurationTag(duration));
+ }
+
+ public static void log(Status logStatus, Throwable throwabel){
+ ExtentTest test = ExtentTestManager.getTest();
+ test.log(logStatus, throwabel);
+ }
+
+ public static void addTag(Status logStatus, String message){
+ Markup m = null;
+ switch(logStatus){
+ case PASS:
+ m = MarkupHelper.createLabel(message, ExtentColor.GREEN);
+ break;
+ case FAIL:
+ m = MarkupHelper.createLabel(message, ExtentColor.RED);
+ break;
+ case SKIP:
+ m = MarkupHelper.createLabel(message, ExtentColor.BLUE);
+ break;
+ case FATAL:
+ m = MarkupHelper.createLabel(message, ExtentColor.BROWN);
+ break;
+ default:
+ break;
+ }
+
+ if (m != null){
+ log(logStatus, m);
+ }
+ }
+
+ public static String addScreenshot(Status logStatus, String screenshotName, String message) throws IOException{
+ String imageFilePath = null;
+ String uuid = UUID.randomUUID().toString();
+ String[] stringArray = uuid.split("-");
+ screenshotName = screenshotName + "-" + stringArray[stringArray.length - 1];
+ try {
+ File imageFile = GeneralUIUtils.takeScreenshot(screenshotName, SetupCDTest.getScreenshotFolder());
+ imageFilePath = new File(SetupCDTest.getReportFolder()).toURI().relativize(imageFile.toURI()).getPath();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ ExtentTest test = ExtentTestManager.getTest();
+ test.log(logStatus, message, MediaEntityBuilder.createScreenCaptureFromPath(imageFilePath).build());
+ return imageFilePath;
+ }
+
+ private static String addDurationTag(String duration){
+ return "<td width=\"80px\">" + duration + "</td>";
+ }
+
+ public static String addLinkTag(String fileName, String pathToFile){
+ return String.format("<a download=\"%s\" href=\"%s\">HAR file</a>", fileName, pathToFile);
+ }
+
+ public static void addFileToReportAsLink(File harFile, String pathToFileFromReportDirectory, String message) {
+ log(Status.INFO, message, addLinkTag(harFile.getName(), pathToFileFromReportDirectory));
+ }
+
+
+
+
+
+}
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
new file mode 100644
index 0000000000..b5ed1ea498
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestManager.java
@@ -0,0 +1,60 @@
+/*-
+ * ============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.setup;
+
+import java.util.HashMap;
+
+import com.aventstack.extentreports.ExtentReports;
+import com.aventstack.extentreports.ExtentTest;
+
+public class ExtentTestManager {
+
+ private static HashMap<Long, ExtentTest> extentTestMap = new HashMap<Long, ExtentTest>();
+ private static ExtentReports extent = ExtentManager.getReporter();
+
+ public static synchronized ExtentTest getTest() {
+ return extentTestMap.get(Thread.currentThread().getId());
+ }
+
+ public static synchronized void endTest() {
+// extent.endTest(extentTestMap.get(Thread.currentThread().getId()));
+ extent.flush();
+ }
+
+ public static synchronized ExtentTest startTest(String testName) {
+ return startTest(testName, "");
+ }
+
+ public static synchronized ExtentTest startTest(String testName, String desc) {
+ ExtentTest test = extent.createTest(testName, desc);
+ extentTestMap.put(Thread.currentThread().getId(), test);
+
+ return test;
+ }
+
+ public static synchronized <T> void assignCategory(Class<T> clazz){
+ String[] parts = clazz.getName().split("\\.");
+ String lastOne1 = parts[parts.length-1];
+ String lastOne2 = parts[parts.length-2];
+ getTest().assignCategory(lastOne2 + "-" + lastOne1);
+ }
+}
+
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/MobProxy.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/MobProxy.java
new file mode 100644
index 0000000000..78cf2709af
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/MobProxy.java
@@ -0,0 +1,103 @@
+package org.openecomp.sdc.ci.tests.execute.setup;
+
+import java.net.InetSocketAddress;
+import java.net.Proxy;
+import java.net.ProxySelector;
+import java.net.SocketAddress;
+import java.net.URI;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.slf4j.LoggerFactory;
+
+import com.aventstack.extentreports.ExtentTest;
+import com.github.markusbernhardt.proxy.ProxySearch;
+import com.github.markusbernhardt.proxy.ProxySearch.Strategy;
+import com.github.markusbernhardt.proxy.util.PlatformUtil;
+import com.github.markusbernhardt.proxy.util.PlatformUtil.Platform;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.Logger;
+import ch.qos.logback.classic.LoggerContext;
+import net.lightbody.bmp.BrowserMobProxyServer;
+
+public class MobProxy {
+
+ private static HashMap<Long, BrowserMobProxyServer> mobProxyServerMap = new HashMap<Long, BrowserMobProxyServer>();
+ public static InetSocketAddress localProxyAddress = getProxy();
+
+ public static InetSocketAddress getProxy(){
+ setLogger();
+
+ ProxySearch proxySearch = new ProxySearch();
+// proxySearch.addStrategy(Strategy.JAVA);
+// proxySearch.addStrategy(Strategy.BROWSER);
+// proxySearch.addStrategy(Strategy.OS_DEFAULT);
+// proxySearch.addStrategy(Strategy.ENV_VAR);
+ if (PlatformUtil.getCurrentPlattform() == Platform.WIN) {
+ proxySearch.addStrategy(Strategy.IE);
+ proxySearch.addStrategy(Strategy.FIREFOX);
+ proxySearch.addStrategy(Strategy.JAVA);
+ } else if (PlatformUtil.getCurrentPlattform() == Platform.LINUX) {
+ proxySearch.addStrategy(Strategy.GNOME);
+ proxySearch.addStrategy(Strategy.KDE);
+ proxySearch.addStrategy(Strategy.FIREFOX);
+ proxySearch.addStrategy(Strategy.ENV_VAR);
+ return null;
+ } else {
+ proxySearch.addStrategy(Strategy.OS_DEFAULT);
+ }
+ ProxySelector proxySelector = proxySearch.getProxySelector();
+
+ ProxySelector.setDefault(proxySelector);
+ URI home = URI.create("http://www.google.com");
+ System.out.println("ProxySelector: " + proxySelector);
+ System.out.println("URI: " + home);
+ List<Proxy> proxyList = proxySelector.select(home);
+ String host = null;
+ String port = null;
+ if (proxyList != null && !proxyList.isEmpty()) {
+ for (Proxy proxy : proxyList) {
+ System.out.println(proxy);
+ SocketAddress address = proxy.address();
+ if (address instanceof InetSocketAddress) {
+ host = ((InetSocketAddress) address).getHostName();
+ port = Integer.toString(((InetSocketAddress) address).getPort());
+ System.setProperty("http.proxyHost", host);
+ System.setProperty("http.proxyPort", port);
+ }
+ }
+ }
+ InetSocketAddress address = new InetSocketAddress(host, Integer.parseInt(port));
+ return address;
+ }
+
+ // set logger for all classes connected to MobProxy
+ public static void setLogger() {
+ LoggerContext lc = (LoggerContext) LoggerFactory. getILoggerFactory();
+// lc.getLogger("ROOT").setLevel(Level.DEBUG);
+ for(Logger logger:lc.getLoggerList()){
+ logger.setLevel(Level.INFO);
+ }
+ }
+
+ public static synchronized void setProxyServer() {
+ BrowserMobProxyServer server = new BrowserMobProxyServer();
+ server.setTrustAllServers(true);
+ if (localProxyAddress != null){
+ server.setChainedProxy(localProxyAddress);
+ server.start();
+ } else {
+ server.start();
+ // filter firefox requests to mozilla when system proxy is absent
+ server.blacklistRequests(".*mozilla.*", 200);
+ }
+ mobProxyServerMap.put(Thread.currentThread().getId(), server);
+ }
+
+ public static synchronized BrowserMobProxyServer getPoxyServer() {
+ return mobProxyServerMap.get(Thread.currentThread().getId());
+ }
+
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/OnboardCSVReport.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/OnboardCSVReport.java
new file mode 100644
index 0000000000..03c9b0281f
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/OnboardCSVReport.java
@@ -0,0 +1,63 @@
+/*-
+ * ============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.setup;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.PrintWriter;
+
+public class OnboardCSVReport {
+
+ private StringBuilder sb;
+ private PrintWriter pw;
+
+ public OnboardCSVReport(String filepath, String filename) {
+ sb = new StringBuilder();
+ try {
+ File csvFile = new File(filepath + filename);
+ pw = new PrintWriter(csvFile);
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ public StringBuilder appendStringToFile(String content) {
+ return sb.append(content + ",");
+ }
+
+ public void openNewRow() {
+ sb.append("\n");
+ }
+
+ public void writeRow(String... content) {
+ for (String str : content) {
+ appendStringToFile(str);
+ }
+ openNewRow();
+ }
+
+ public void closeFile() {
+ pw.write(sb.toString());
+ pw.close();
+ }
+
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ReportAfterTestManager.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ReportAfterTestManager.java
new file mode 100644
index 0000000000..ad923d5a1a
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ReportAfterTestManager.java
@@ -0,0 +1,129 @@
+/*-
+ * ============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.setup;
+
+import java.io.IOException;
+
+import org.openecomp.sdc.ci.tests.execute.setup.ExtentManager.suiteNameXml;
+import org.testng.ITestContext;
+import org.testng.ITestResult;
+
+import com.aventstack.extentreports.Status;
+
+public class ReportAfterTestManager extends ExtentTestActions {
+
+ private static String testName;
+ private static Throwable throwable;
+ private static int status;
+
+ private static void logSuccessAfterTest(){
+ final Status logStatus = Status.PASS;
+ addTag(logStatus, "Success");
+ try{
+ String message = "Finished the test with the following screenshot : ";
+ addScreenshotToReport(logStatus, testName, message);
+ }catch(Exception e){
+ log(logStatus, "SUCCESS - The following exepction occured : " + e.getMessage());
+ }
+ }
+
+ private static void logFailAfterTest(){
+ addTag(Status.FAIL, "Failure");
+ try{
+ log(Status.ERROR, "ERROR - The following exepction occured : ");
+ log(Status.ERROR, throwable);
+ String message = "Failure is described in the following screenshot : ";
+ addScreenshotToReport(Status.FAIL, testName, message);
+ }catch(Exception e){
+ log(Status.ERROR, "ERROR - The following exepction occured : " + e.getMessage());
+ }
+ }
+
+ private static void logSkipAfterTest(){
+ final Status logStatus = Status.SKIP;
+ addTag(logStatus, "Skipped");
+ try{
+ log(logStatus, "SKIP - The following exepction occured : ");
+ log(logStatus, throwable);
+ String message = "Skip is described in the following screenshot : ";
+ addScreenshotToReport(logStatus, testName, message);
+ }catch(Exception e){
+ log(logStatus, "SKIP - The following exepction occured : " + e.getMessage());
+ }
+ }
+ private static void logFatalAfterTest(){
+ final Status logStatus = Status.FATAL;
+ addTag(logStatus, "Fatal");
+ try{
+ log(logStatus, "FATAL - The following exepction occured : ");
+ log(logStatus, throwable);
+ String message = "Fatal is described in the following screenshot : ";
+ addScreenshotToReport(logStatus, testName, message);
+ }catch(Exception e){
+ log(logStatus, "FATAL - The following exepction occured : " + e.getMessage());
+ }
+ }
+
+ private static String addScreenshotToReport(Status logStatus, String testName, String message) throws IOException{
+
+ String addedValueFromDataProvider = WindowTestManager.getWindowMap().getAddedValueFromDataProvider();
+ if (addedValueFromDataProvider != null){
+ addedValueFromDataProvider = addedValueFromDataProvider.replace(":", "-");
+ testName = testName + "...." + addedValueFromDataProvider;
+ }
+
+ return addScreenshot(logStatus, testName, message);
+ }
+
+ public static void report(ITestResult result, ITestContext context){
+
+ testName = result.getName();
+ throwable = result.getThrowable();
+ status = result.getStatus();
+
+ String suiteName = ExtentManager.getSuiteName(context);
+
+ switch(status){
+ case ITestResult.SUCCESS:
+ logSuccessAfterTest();
+ break;
+
+ case ITestResult.FAILURE:
+
+ if (suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue())) {
+ logFatalAfterTest();
+ }else{
+ logFailAfterTest();
+ }
+ break;
+
+ case ITestResult.SKIP:
+ logSkipAfterTest();
+ break;
+
+ default:
+ break;
+ }
+
+ }
+
+}
+
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/Retry.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/Retry.java
new file mode 100644
index 0000000000..0a01da06c3
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/Retry.java
@@ -0,0 +1,44 @@
+/*-
+ * ============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.setup;
+
+import org.testng.Assert;
+import org.testng.IRetryAnalyzer;
+import org.testng.ITestResult;
+import org.testng.annotations.Test;
+
+public class Retry implements IRetryAnalyzer {
+ private int retryCount = 0;
+ private int maxRetryCount = 1;
+
+ public boolean retry(ITestResult result) {
+
+ if (retryCount < maxRetryCount) {
+ retryCount++;
+ return true;
+ }
+ return false;
+ }
+
+
+
+
+}
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
new file mode 100644
index 0000000000..1838d3969d
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java
@@ -0,0 +1,573 @@
+/*-
+ * ============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.setup;
+
+import java.io.File;
+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.littleshoot.proxy.impl.ClientToProxyConnection;
+import org.littleshoot.proxy.impl.ProxyToServerConnection;
+import org.openecomp.sdc.be.model.User;
+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.setup.ExtentManager.suiteNameXml;
+import org.openecomp.sdc.ci.tests.pages.HomePage;
+import org.openecomp.sdc.ci.tests.run.StartTest;
+import org.openecomp.sdc.ci.tests.utilities.FileHandling;
+import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
+import org.openecomp.sdc.ci.tests.utilities.RestCDUtils;
+import org.openqa.selenium.By;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.ITestContext;
+import org.testng.ITestResult;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+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 {
+
+// private static final String RE_RUN = "ReRun - ";
+ private static final String RE_RUN = "<html><font color=\"red\">ReRun - </font></html>";
+ private static final String WEB_SEAL_PASSWORD = "123123a";
+
+ public SetupCDTest() {
+ LoggerContext lc = (LoggerContext) LoggerFactory. getILoggerFactory();
+ lc.getLogger("org.apache").setLevel(Level.INFO);
+ }
+
+ /**************** CONSTANTS ****************/
+ private static final String CREDENTIALS_FILE = "credentials.yaml";
+ private static final String REPORT_FILE_NAME = "SDC_UI_Extent_Report.html";
+ protected static final String REPORT_FOLDER = "." + File.separator + "ExtentReport" + File.separator;
+ protected static final String SCREENSHOT_FOLDER = REPORT_FOLDER + "screenshots" + File.separator;
+ protected static final String HAR_FILES_FOLDER_NAME = "har_files";
+ protected static final String HAR_FILES_FOLDER = REPORT_FOLDER + HAR_FILES_FOLDER_NAME + File.separator;
+
+
+ private static final String SHORT_CSV_REPORT_FILE_NAME = "ShortReport.csv";
+ private static final int NUM_OF_ATTEMPTS_TO_REFTRESH = 2;
+
+
+ /**************** PRIVATES ****************/
+ private static String url;
+ private static boolean localEnv = true;
+ private static OnboardCSVReport csvReport;
+ private static Map<?, ?> credentials;
+
+ protected static ITestContext myContext;
+
+
+ /**************** METHODS ****************/
+ public static ExtentTest getExtendTest() {
+ return ExtentTestManager.getTest();
+ }
+ public static WindowTest getWindowTest(){
+ return WindowTestManager.getWindowMap();
+ }
+
+ public OnboardCSVReport getCsvReport() {
+ return csvReport;
+ }
+
+ public static String getReportFolder() {
+ return REPORT_FOLDER;
+ }
+
+ public static String getScreenshotFolder() {
+ return SCREENSHOT_FOLDER;
+ }
+
+ public static String getHarFilesFolder() {
+ return HAR_FILES_FOLDER;
+ }
+
+
+ protected abstract UserRoleEnum getRole();
+
+ /**************** BEFORE ****************/
+
+ @BeforeSuite(alwaysRun = true)
+ public void setupBeforeSuite(ITestContext context) throws Exception {
+ RestCDUtils.deleteOnDemand();
+ myContext=context;
+ setErrorConfigurationFile();
+ setUrl();
+ ExtentManager.initReporter(getReportFolder(), REPORT_FILE_NAME, context);
+ csvReport = new OnboardCSVReport(getReportFolder(), SHORT_CSV_REPORT_FILE_NAME);
+ }
+
+ private static void setErrorConfigurationFile() {
+ if (!System.getProperty("os.name").contains("Windows")){
+ String errorConfigurationFilename = getConfig().getErrorConfigurationFile();
+ errorConfigurationFilename = errorConfigurationFilename.substring(errorConfigurationFilename.lastIndexOf("/") + 1, errorConfigurationFilename.length());
+ getConfig().setErrorConfigurationFile(FileHandling.getBasePath() + File.separator + "conf" + File.separator + errorConfigurationFilename);
+ if (new File(getConfig().getErrorConfigurationFile()).exists()){
+ System.out.println("Found error-configuration.yaml in : " + getConfig().getErrorConfigurationFile());
+ }
+ }
+ }
+
+ @BeforeMethod(alwaysRun = true )
+ public void setBrowserBeforeTest(java.lang.reflect.Method method, ITestContext context) throws Exception {
+
+ boolean emptyDataProvider = method.getAnnotation(Test.class).dataProvider().isEmpty();
+ if (emptyDataProvider) {
+ System.out.println("ExtentReport instance started from BeforeMethod...");
+ String suiteName = ExtentManager.getSuiteName(context);
+ if (suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue())) {
+ ExtentTestManager.startTest(RE_RUN + method.getName());
+ }else{
+ ExtentTestManager.startTest(method.getName());
+ }
+
+ ExtentTestManager.assignCategory(this.getClass());
+ setBrowserBeforeTest(getRole());
+ } else {
+ System.out.println("ExtentReport instance started from Test...");
+ }
+
+ getConfig().setWindowsDownloadDirectory(getWindowTest().getDownloadDirectory());
+
+ if (getConfig().getCaptureTraffic()){
+ try{
+ MobProxy.getPoxyServer().newHar(method.getName() + ".har");
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /**************** AFTER ****************/
+ @AfterMethod(alwaysRun = true)
+ public void quitAfterTest(ITestResult result, ITestContext context) throws Exception {
+
+ try{
+ ReportAfterTestManager.report(result, context);
+ GeneralUIUtils.closeErrorMessage();
+ }
+ finally{
+ try {
+ if (getConfig().getCaptureTraffic()){
+ addTrafficFileToReport(result);
+ }
+
+ if (result.getInstanceName().equals(Onboard.class.getName()) && result.getStatus() == ITestResult.FAILURE){
+ System.out.println("Onboarding test failed, closign browser....");
+ getExtendTest().log(Status.INFO, "Onboarding test failed, closign browser....");
+ quitDriver();
+ }
+ else if (!getUser().getRole().toLowerCase().equals(UserRoleEnum.ADMIN.name().toLowerCase())){
+ boolean navigateToHomePageSuccess = HomePage.navigateToHomePage();
+ if (!navigateToHomePageSuccess){
+ System.out.println("Navigating to homepage failed, reopening driver....");
+ getExtendTest().log(Status.INFO, "Navigating to homepage failed, reopening driver....");
+ quitDriver();
+ }
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ getExtendTest().log(Status.ERROR, "Exception:"+ e.toString());
+ }
+
+
+
+ ExtentTestManager.endTest();
+ addResultToCSV(result, context);
+// ExtentManager.closeReporter();
+ FileHandling.cleanCurrentDownloadDir();
+ }
+
+ }
+ public void addResultToCSV(ITestResult result, ITestContext context) {
+ String suiteName = ExtentManager.getSuiteName(context);
+ ExtentTest test = ExtentTestManager.getTest();
+ 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)) {
+ getCsvReport().writeRow(result.getInstanceName(), name.replace(RE_RUN,""), status);
+ }
+ }
+
+ @AfterSuite(alwaysRun = true)
+ public void afterSuite() throws Exception {
+
+ if (getConfig().getUseBrowserMobProxy()){
+ MobProxy.getPoxyServer().stop();
+ }
+
+ csvReport.closeFile();
+ RestCDUtils.deleteOnDemand();
+ }
+
+ protected static String setUrl() {
+ url = getConfig().getUrl();
+ if (url == null) {
+ String message = "no URL found";
+ System.out.println(message);
+ Assert.fail(message);
+ } else if (!url.contains("localhost") && !url.contains("127.0.0.1")) {
+ localEnv = false;
+ }
+ return url;
+ }
+
+ public static void loadCredentialsFile() throws Exception {
+ if (credentials != null){
+ return;
+ }
+ File credentialsFileRemote = new File(FileHandling.getBasePath() + File.separator + "conf" + File.separator + CREDENTIALS_FILE);
+ File credentialsFileLocal = new File(FileHandling.getConfFilesPath() + CREDENTIALS_FILE);
+ File[] credentialFiles = {credentialsFileRemote, credentialsFileLocal};
+ for (File credentialsFile : credentialFiles){
+ if (credentialsFile.exists()){
+ credentials = FileHandling.parseYamlFile(credentialsFile.getAbsolutePath());
+ break;
+ }
+ }
+ }
+
+ private UserCredentials getUserCredentialsFromFile(String userRole) throws Exception {
+ @SuppressWarnings("unchecked")
+ Map<String, String> credentialsMap = (Map<String, String>) credentials.get(userRole);
+ String user = (String) credentialsMap.get("username");
+ String password = (String) credentialsMap.get("password");
+ String firstname = (String) credentialsMap.get("firstname");
+ String lastname = (String) credentialsMap.get("lastname");
+
+ return new UserCredentials(user, password, firstname, lastname, userRole);
+ }
+
+
+ public static void navigateToUrl(String url) throws Exception {
+ try {
+ System.out.println("Deleting cookies...");
+ deleteCookies();
+
+ System.out.println("Navigating to URL : " + url);
+ getDriver().navigate().to(url);
+ GeneralUIUtils.waitForLoader();
+
+ System.out.println("Zooming out...");
+ GeneralUIUtils.windowZoomOutUltimate();
+
+ }
+ catch (Exception e) {
+ String msg = "Browser is unreachable";
+ System.out.println(msg);
+ getExtendTest().log(Status.ERROR, msg);
+ Assert.fail(msg);
+ }
+ }
+ private static void deleteCookies() throws Exception {
+ getDriver().manage().deleteAllCookies();
+ Thread.sleep(1000);
+
+ int attempts = 0;
+ final int max_attempts = 3;
+
+ while (!getDriver().manage().getCookies().isEmpty() && attempts < max_attempts){
+ getExtendTest().log(Status.INFO, "Trying to delete cookies one more time - " + (attempts + 1) + "/" + max_attempts + "attempts");
+ String deleteCookiesJS = "document.cookie.split(';').forEach(function(c) { document.cookie = c.replace(/^ +/, '').replace(/=.*/, '=;expires=' + new Date().toUTCString() + ';path=/'); });";
+ ((JavascriptExecutor) getDriver()).executeScript(deleteCookiesJS);
+ attempts++;
+
+ if (attempts == max_attempts){
+ String msg = "Did not delete cookies, can't login as user " + WindowTestManager.getWindowMap().getUser().getRole();
+ System.out.println(msg);
+ getExtendTest().log(Status.ERROR, msg);
+ Assert.fail(msg);
+ }
+ }
+ }
+
+ protected void loginToSystem(UserRoleEnum role) throws Exception {
+ UserCredentials credentials;
+ if (localEnv){
+ loginToSimulator(role);
+ credentials = new UserCredentials(role.getUserId(), WEB_SEAL_PASSWORD, role.getFirstName(), role.getLastName(), role.name());
+ }
+ else{
+ credentials = getUserFromFileByRole(role);
+ sendUserAndPasswordKeys(credentials);
+ WebElement submitButton = GeneralUIUtils.getWebElementBy(By.name("btnSubmit"), 30);
+ submitButton.click();
+ WebElement buttonOK = GeneralUIUtils.getWebElementBy(By.name("successOK"), 30);
+ Assert.assertTrue(buttonOK.isDisplayed(), "OK button is not displayed.");
+ buttonOK.click();
+ }
+ GeneralUIUtils.ultimateWait();
+ getWindowTest().setUser(credentials);
+ }
+ protected UserCredentials getUserFromFileByRole(UserRoleEnum role) throws Exception {
+ loadCredentialsFile();
+ return getUserCredentialsFromFile(role.name().toLowerCase());
+ }
+ private void goToHomePage(UserRoleEnum role) throws Exception {
+ try {
+ getWindowTest().setRefreshAttempts(getWindowTest().getRefreshAttempts() == 0 ? NUM_OF_ATTEMPTS_TO_REFTRESH : getWindowTest().getRefreshAttempts());
+ if (!role.equals(UserRoleEnum.ADMIN)) {
+
+ WebElement closeButton = GeneralUIUtils.getClickableButtonBy(By.className("sdc-welcome-close"), 10);
+ if (closeButton != null){
+ closeButton.click();
+ }
+
+ if (!GeneralUIUtils.isElementVisibleByTestId(DataTestIdEnum.MainMenuButtons.HOME_BUTTON.getValue()))
+ {
+ restartBrowser(role);
+ }
+ }
+ }
+ catch (Exception e) {
+ restartBrowser(role);
+ }
+ }
+ private void restartBrowser(UserRoleEnum role) throws Exception {
+ getWindowTest().setRefreshAttempts(getWindowTest().getRefreshAttempts() - 1);
+ if (getWindowTest().getRefreshAttempts() <= 0) {
+ System.out.println("ERR : Something is wrong with browser!");
+ Assert.fail("ERR : Something is wrong with browser!");
+ }
+ System.out.println("Trying again...");
+ getExtendTest().log(Status.INFO, "Trying again...");
+ getExtendTest().log(Status.INFO, String.format("%s attempt(s) left", getWindowTest().getRefreshAttempts() ));
+ System.out.println(String.format("%s attempt(s) left", getWindowTest().getRefreshAttempts() ));
+
+ reloginWithNewRole(role);
+ }
+
+ public void loginToSimulator(UserRoleEnum role){
+ WebDriver driver = GeneralUIUtils.getDriver();
+ WebDriverWait wait = new WebDriverWait(driver, 30);
+
+ wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//*[@method='" + "post" + "']"))));
+
+ WebElement userIdTextbox = GeneralUIUtils.getWebElementBy(By.name("userId"));
+ userIdTextbox.sendKeys(role.getUserId());
+ WebElement passwordTextbox = GeneralUIUtils.getWebElementBy(By.name("password"));
+ passwordTextbox.sendKeys(WEB_SEAL_PASSWORD);
+
+ wait.until(ExpectedConditions.elementToBeClickable(driver.findElement(By.xpath("//*[@value='" + "Login" + "']")))).click();
+ }
+
+ private void sendUserAndPasswordKeys(UserCredentials userId) {
+ System.out.println("Login as user : " + userId.getUserId());
+ WebElement userNameTextbox = GeneralUIUtils.getWebElementBy(By.name("userid"));
+ userNameTextbox.sendKeys(userId.getUserId());
+ WebElement passwordTextbox = GeneralUIUtils.getWebElementBy(By.name("password"));
+ passwordTextbox.sendKeys(userId.getPassword());
+ }
+
+ public void loginWithUser(UserRoleEnum role) {
+ try {
+ getExtendTest().log(Status.INFO, String.format("Login as user %s", role.name().toUpperCase()));
+ loginToSystem(role);
+ goToHomePage(role);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ finally{
+ getWindowTest().setPreviousRole(getWindowTest().getUser().getRole());
+ }
+ }
+
+ private void setUser(UserRoleEnum role) {
+ User user = new User();
+ user.setUserId(role.getUserId());
+ user.setFirstName(role.getFirstName());
+ user.setRole(role.name());
+ user.setLastName(role.getLastName());
+
+ getWindowTest().setUser(user);
+ }
+
+ public User getUser() {
+ return getWindowTest().getUser();
+ }
+
+ private void setBrowserBeforeTest(UserRoleEnum role) {
+ System.out.println(String.format("Setup before test as %s.", role.toString().toUpperCase() ));
+ try {
+ System.out.println("Previous role is : " + getWindowTest().getPreviousRole() + " ; Current role is : " + role.name());
+ if (!getWindowTest().getPreviousRole().toLowerCase().equals(role.name().toLowerCase())){
+ System.out.println("Roles are different, navigate and login");
+ navigateAndLogin(role);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void navigateAndLogin(UserRoleEnum role) throws Exception {
+ getWindowTest().setRefreshAttempts(getWindowTest().getRefreshAttempts() != 0 ? getWindowTest().getRefreshAttempts() : 0);
+ setUser(role);
+ navigateToUrl(url);
+ loginWithUser(role);
+ GeneralUIUtils.ultimateWait();
+ }
+
+ public User getUser(UserRoleEnum role) {
+ User user = new User();
+ user.setUserId(role.getUserId());
+ user.setFirstName(role.getFirstName());
+ user.setLastName(role.getLastName());
+ user.setRole(role.name());
+ return user;
+ }
+
+ protected void reloginWithNewRole(UserRoleEnum role) throws Exception {
+ System.out.println(String.format("Setup before relogin as %s", role.toString().toUpperCase()));
+ navigateAndLogin(role);
+ }
+
+ public static void setLocalUrl(UserRoleEnum role) {
+ switch (role) {
+ case ADMIN: {
+ url = "http://localhost:8181/sdc1/proxy-admin1#/dashboard";
+ break;
+ }
+ case DESIGNER: {
+ url = "http://localhost:8181/sdc1/proxy-designer1#/dashboard";
+ break;
+ }
+ case GOVERNOR: {
+ url = "http://localhost:8181/sdc1/proxy-governor1#/dashboard";
+ break;
+ }
+ case OPS: {
+ url = "http://localhost:8181/sdc1/proxy-ops1#/dashboard";
+ break;
+ }
+ case TESTER: {
+ url = "http://localhost:8181/sdc1/proxy-tester1#/dashboard";
+ break;
+ }
+ case PRODUCT_MANAGER1: {
+ url = "http://localhost:8181/sdc1/proxy-pm1#/dashboard";
+ break;
+ }
+ case PRODUCT_MANAGER2: {
+ url = "http://localhost:8181/sdc1/proxy-pm2#/dashboard";
+ break;
+ }
+ case PRODUCT_STRATEGIST1: {
+ url = "http://localhost:8181/sdc1/proxy-ps1#/dashboard";
+ break;
+ }
+ case PRODUCT_STRATEGIST2: {
+ url = "http://localhost:8181/sdc1/proxy-ps2#/dashboard";
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ }
+
+ public void addTrafficFileToReport(ITestResult result) {
+ try {
+ // Get the HAR data
+ Har har = MobProxy.getPoxyServer().getHar();
+ String shortUUID = UUID.randomUUID().toString().split("-")[0];
+ File harFile = new File(getHarFilesFolder() + result.getName() + shortUUID + ".har");
+ new File(getHarFilesFolder()).mkdirs();
+
+ har.writeTo(harFile);
+
+ String pathToFileFromReportDirectory = HAR_FILES_FOLDER_NAME + File.separator + harFile.getName();
+ ExtentTestActions.addFileToReportAsLink(harFile, pathToFileFromReportDirectory, "File with captured traffic");
+ } catch (IOException ioe) {
+ ioe.printStackTrace();
+ }
+ }
+
+ /*
+ * * Start section of test in ExtentReport with DataProvider parameters,
+ * should be started from test method, see example in onboardVNFTest
+ */
+ public void setLog(String fromDataProvider) {
+
+ String suiteName = ExtentManager.getSuiteName(myContext);
+ if (suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue())) {
+ ExtentTestManager.startTest(RE_RUN +Thread.currentThread().getStackTrace()[2].getMethodName() + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + fromDataProvider);
+ }else{
+ ExtentTestManager.startTest(Thread.currentThread().getStackTrace()[2].getMethodName() + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + fromDataProvider);
+ }
+
+
+
+ getWindowTest().setAddedValueFromDataProvider(fromDataProvider);
+ ExtentTestManager.assignCategory(this.getClass());
+ setBrowserBeforeTest(getRole());
+ }
+
+
+
+ /**************** MAIN ****************/
+ public static void main(String[] args) {
+ System.out.println("---------------------");
+ System.out.println("running test from CLI");
+ System.out.println("---------------------");
+
+ String attsdcFilePath = FileHandling.getBasePath() + File.separator + "conf" + File.separator + "attsdc.yaml";
+ System.setProperty("config.resource", attsdcFilePath);
+ System.out.println("attsdc.yaml file path is : " + attsdcFilePath);
+
+ String filepath = FileHandling.getBasePath() + File.separator + "Files" + File.separator;
+ System.setProperty("filepath", filepath);
+ System.out.println("filepath is : " + System.getProperty("filepath"));
+
+ Object[] testSuitsList = FileHandling.filterFileNamesFromFolder(FileHandling.getBasePath() + File.separator + "testSuites", ".xml");
+ if (testSuitsList != null) {
+ System.out.println(String.format("Found %s testSuite(s)", testSuitsList.length));
+ args = Arrays.copyOf(testSuitsList, testSuitsList.length, String[].class);
+ StartTest.main(args);
+ }
+ }
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/TestFtp.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/TestFtp.java
new file mode 100644
index 0000000000..0268c69f59
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/TestFtp.java
@@ -0,0 +1,94 @@
+/*-
+ * ============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.setup;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+import org.openqa.selenium.remote.internal.ApacheHttpClient;
+
+public class TestFtp {
+
+ public static void main(String[] args) throws IOException {
+ // TODO Auto-generated method stub
+ AttFtpClient instance = AttFtpClient.getInstance();
+
+ String server = "135.177.130.113";
+ int port = 2121;
+ String user = "admin";
+ String pass = "admin";
+ AttFtpClient.getInstance().init(server, port, user, pass);
+
+ try {
+ AttFtpClient.getInstance().retrieveListOfFile();
+
+ File retrieveLastModifiedFileFromFTP = instance.retrieveLastModifiedFileFromFTP();
+ String content = new String(Files.readAllBytes(Paths.get(retrieveLastModifiedFileFromFTP.getPath())), StandardCharsets.UTF_8);
+// instance.deleteFilesFromFTPserver();
+ System.out.println(content);
+ readFile(retrieveLastModifiedFileFromFTP);
+
+ } finally {
+ instance.terminateClient();
+ }
+
+
+
+
+
+
+
+ }
+ public static void readFile(File retrieveLastModifiedFileFromFTP) {
+
+ StringBuilder sb = new StringBuilder();
+ BufferedReader br = null;
+ try {
+ br = new BufferedReader(new FileReader(retrieveLastModifiedFileFromFTP.getPath()));
+ String line;
+ while ((line = br.readLine()) != null) {
+ if (sb.length() > 0) {
+ sb.append("\n");
+ }
+ sb.append(line);
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ if (br != null) {
+ br.close();
+ }
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ }
+ String contents = sb.toString();
+ System.out.println(contents);
+
+ }
+
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WebDriverThread.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WebDriverThread.java
new file mode 100644
index 0000000000..5a95df39f8
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WebDriverThread.java
@@ -0,0 +1,164 @@
+/*-
+ * ============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.setup;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.UUID;
+
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.utilities.FileHandling;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openqa.selenium.Platform;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.firefox.FirefoxDriver;
+import org.openqa.selenium.firefox.FirefoxProfile;
+import org.openqa.selenium.remote.CapabilityType;
+import org.openqa.selenium.remote.DesiredCapabilities;
+import org.openqa.selenium.remote.LocalFileDetector;
+import org.openqa.selenium.remote.RemoteWebDriver;
+
+import net.lightbody.bmp.BrowserMobProxyServer;
+import net.lightbody.bmp.client.ClientUtil;
+import net.lightbody.bmp.proxy.CaptureType;
+
+public class WebDriverThread {
+
+ public static final String AUTOMATION_DOWNLOAD_DIR = "automationDownloadDir";
+ private WebDriver webdriver;
+ private FirefoxProfile firefoxProfile;
+ public static final String SELENIUM_NODE_URL = "http://%s:%s/wd/hub";
+
+ public WebDriverThread(Config config) {
+ initDriver(config);
+ webdriver.manage().window().maximize();
+ }
+
+ public WebDriver getDriver() throws Exception {
+ return webdriver;
+ }
+
+ public void quitDriver() {
+ if (webdriver != null) {
+ webdriver.quit();
+ webdriver = null;
+ }
+ }
+
+
+ public void initDriver(Config config){
+ try {
+ boolean remoteTesting = config.isRemoteTesting();
+ if (!remoteTesting) {
+ boolean mobProxyStatus = config.getUseBrowserMobProxy();
+ if (mobProxyStatus){
+ setWebDriverWithMobProxy();
+ } else {
+ System.out.println("Opening LOCAL browser");
+ DesiredCapabilities cap = new DesiredCapabilities();
+
+ cap = DesiredCapabilities.firefox();
+ cap.setBrowserName("firefox");
+ cap.setCapability(FirefoxDriver.PROFILE, initFirefoxProfile());
+
+ firefoxProfile.setPreference("network.proxy.type", 2);
+ firefoxProfile.setPreference("network.proxy.autoconfig_url", "http://emea-auto.proxy.att.com:8001/");
+ firefoxProfile.setPreference("network.proxy.no_proxies_on", "localhost");
+
+ webdriver = new FirefoxDriver(cap);
+ }
+ } else {
+ System.out.println("Opening REMOTE browser");
+ String remoteEnvIP = config.getRemoteTestingMachineIP();
+ String remoteEnvPort = config.getRemoteTestingMachinePort();
+
+ DesiredCapabilities cap = new DesiredCapabilities();
+ cap = DesiredCapabilities.firefox();
+ cap.setPlatform(Platform.ANY);
+ cap.setBrowserName("firefox");
+
+ String remoteNodeUrl = String.format(SELENIUM_NODE_URL, remoteEnvIP, remoteEnvPort);
+ RemoteWebDriver remoteWebDriver = new RemoteWebDriver(new URL(remoteNodeUrl), cap);
+ remoteWebDriver.setFileDetector(new LocalFileDetector());
+ webdriver = remoteWebDriver;
+ }
+
+
+ } catch (MalformedURLException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private FirefoxProfile initFirefoxProfile() {
+ firefoxProfile = new FirefoxProfile();
+ firefoxProfile.setPreference("browser.download.folderList",2);
+ firefoxProfile.setPreference("browser.download.manager.showWhenStarting",false);
+ firefoxProfile.setPreference("browser.download.dir", getDownloadDirectory());
+ firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk","application/octet-stream, application/xml, text/plain, text/xml, image/jpeg");
+ return firefoxProfile;
+ }
+
+ private String getDownloadDirectory() {
+ String downloadDirectory = FileHandling.getBasePath() + File.separator + AUTOMATION_DOWNLOAD_DIR + UUID.randomUUID().toString().split("-")[0] + File.separator;
+ File dir = new File(downloadDirectory);
+ if(!dir.exists()) {
+ dir.mkdirs();
+ }
+ return dir.getAbsolutePath();
+ }
+
+ public FirefoxProfile getFirefoxProfile() {
+ return firefoxProfile;
+ }
+
+ private void setWebDriverWithMobProxy(){
+ WebDriver driver = null;
+ MobProxy.setProxyServer();
+ BrowserMobProxyServer proxyServer = MobProxy.getPoxyServer();
+
+ firefoxProfile = new FirefoxProfile();
+ firefoxProfile.setPreference("browser.download.folderList",2);
+ firefoxProfile.setPreference("browser.download.manager.showWhenStarting",false);
+ firefoxProfile.setPreference("browser.download.dir", getDownloadDirectory());
+ firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk","application/octet-stream, application/xml, text/plain, text/xml, image/jpeg");
+ firefoxProfile.setAcceptUntrustedCertificates(true);
+ firefoxProfile.setAssumeUntrustedCertificateIssuer(true);
+// firefoxProfile.setPreference("network.proxy.http", "localhost");
+// firefoxProfile.setPreference("network.proxy.http_port", proxyServer.getPort());
+// firefoxProfile.setPreference("network.proxy.ssl", "localhost");
+// firefoxProfile.setPreference("network.proxy.ssl_port", proxyServer.getPort());
+// firefoxProfile.setPreference("network.proxy.type", 1);
+// firefoxProfile.setPreference("network.proxy.no_proxies_on", "");
+
+ DesiredCapabilities capabilities = new DesiredCapabilities();
+
+ capabilities.setCapability(FirefoxDriver.PROFILE, firefoxProfile);
+ capabilities.setCapability(CapabilityType.PROXY, ClientUtil.createSeleniumProxy(proxyServer));
+ capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
+
+ webdriver = new FirefoxDriver(capabilities);
+ proxyServer.enableHarCaptureTypes(CaptureType.REQUEST_CONTENT, CaptureType.RESPONSE_CONTENT, CaptureType.REQUEST_COOKIES, CaptureType.REQUEST_BINARY_CONTENT,
+ CaptureType.REQUEST_HEADERS, CaptureType.RESPONSE_COOKIES, CaptureType.RESPONSE_HEADERS, CaptureType.RESPONSE_BINARY_CONTENT);
+ }
+
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WindowTest.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WindowTest.java
new file mode 100644
index 0000000000..8df3c596fe
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WindowTest.java
@@ -0,0 +1,77 @@
+/*-
+ * ============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.setup;
+
+import java.io.File;
+
+import org.openecomp.sdc.be.model.User;
+
+public class WindowTest {
+
+ public WindowTest(){
+ refreshAttempts = 0;
+ previousRole = "";
+ addedValueFromDataProvider = null;
+ try {
+ downloadDirectory = DriverFactory.getDriverFirefoxProfile().getStringPreference("browser.download.dir", null) + File.separator;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private int refreshAttempts;
+ private String previousRole;
+ private User user;
+ private String addedValueFromDataProvider;
+ private String downloadDirectory;
+
+ public int getRefreshAttempts() {
+ return refreshAttempts;
+ }
+ public void setRefreshAttempts(int refreshAttempts) {
+ this.refreshAttempts = refreshAttempts;
+ }
+ public String getPreviousRole() {
+ return previousRole;
+ }
+ public void setPreviousRole(String previousRole) {
+ this.previousRole = previousRole;
+ }
+ public User getUser() {
+ return user;
+ }
+ public void setUser(User user) {
+ this.user = user;
+ }
+ public synchronized String getAddedValueFromDataProvider() {
+ return addedValueFromDataProvider;
+ }
+ public synchronized void setAddedValueFromDataProvider(String addedValueFromDataProvider) {
+ this.addedValueFromDataProvider = addedValueFromDataProvider;
+ }
+ public String getDownloadDirectory() {
+ return downloadDirectory;
+ }
+ public void setDownloadDirectory(String downloadDirectory) {
+ this.downloadDirectory = downloadDirectory;
+ }
+
+}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WindowTestManager.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WindowTestManager.java
new file mode 100644
index 0000000000..5e5ddc4fbd
--- /dev/null
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WindowTestManager.java
@@ -0,0 +1,52 @@
+/*-
+ * ============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.setup;
+
+import java.util.HashMap;
+
+import com.aventstack.extentreports.ExtentTest;
+
+public class WindowTestManager {
+
+ private static HashMap<Long, WindowTest> windowMap = new HashMap<Long, WindowTest>();
+
+ public static synchronized WindowTest getWindowMap() {
+ Long currentThreadId = Thread.currentThread().getId();
+ boolean containsKey = windowMap.containsKey(currentThreadId);
+ if (!containsKey){
+ setWindowMap(currentThreadId);
+ }
+ return windowMap.get(currentThreadId);
+ }
+
+ private static synchronized void setWindowMap(Long currentThreadId) {
+ WindowTestManager.windowMap.put(currentThreadId, new WindowTest());
+ }
+
+ public static synchronized void removeWindowTest(){
+ windowMap.remove(Thread.currentThread().getId());
+ }
+
+ public static synchronized HashMap<Long, WindowTest> getWholeMap(){
+ return windowMap;
+ }
+
+}