2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.ci.tests.api;
23 import org.openecomp.sdc.ci.tests.utils.rest.AutomationUtils;
25 import com.aventstack.extentreports.ExtentReports;
26 import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
27 import com.aventstack.extentreports.reporter.ExtentXReporter;
28 import com.aventstack.extentreports.reporter.configuration.Protocol;
29 import com.aventstack.extentreports.reporter.configuration.Theme;
31 public class ExtentManager {
33 private static ExtentReports extent;
35 public synchronized static ExtentReports getReporter(String filePath) {
37 // initialize the HtmlReporter
38 ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(filePath);
40 // initialize ExtentReports and attach the HtmlReporter
41 extent = new ExtentReports();
43 // attach all reporters
44 extent.attachReporter(htmlReporter);
52 public synchronized static ExtentHtmlReporter setConfiguration(ExtentHtmlReporter htmlReporter) {
53 htmlReporter.config().setTheme(Theme.STANDARD);
55 htmlReporter.config().setEncoding("UTF-8");
57 htmlReporter.config().setProtocol(Protocol.HTTPS);
59 htmlReporter.config().setDocumentTitle("ASDC Automation Report");
61 htmlReporter.config().setChartVisibilityOnOpen(true);
63 htmlReporter.config().setReportName(AutomationUtils.getOSVersion());
68 public synchronized static ExtentReports getReporter() {