org.testng.reporters.jq.Main Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of testng Show documentation
Show all versions of testng Show documentation
Testing framework for Java
package org.testng.reporters.jq;
import static org.testng.reporters.jq.BasePanel.C;
import static org.testng.reporters.jq.BasePanel.D;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.List;
import org.testng.IReporter;
import org.testng.ISuite;
import org.testng.internal.Utils;
import org.testng.log4testng.Logger;
import org.testng.reporters.Files;
import org.testng.reporters.XMLStringBuffer;
import org.testng.xml.XmlSuite;
public class Main implements IReporter {
private static final String TESTNG_RESOURCE_PREFIX = "/org/testng/";
private static final String[] RESOURCES =
new String[] {
"jquery-3.6.0.min.js",
"testng-reports.css",
"testng-reports.js",
"testng-reports1.css",
"testng-reports2.js",
"passed.png",
"failed.png",
"skipped.png",
"navigator-bullet.png",
"bullet_point.png",
"collapseall.gif"
};
public static final String REPORT_HEADER_FILE = "header";
@Override
public void generateReport(
List xmlSuites, List suites, String outputDirectory) {
Model m_model = new Model(suites);
XMLStringBuffer xsb = new XMLStringBuffer(" ");
// Generate the top banner
new BannerPanel(m_model).generate(xsb);
// All the panels selectable from the navigator
List panels =
Arrays.asList(
new TestNgXmlPanel(m_model),
new TestPanel(m_model),
new GroupPanel(m_model),
new TimesPanel(m_model),
new ReporterPanel(m_model),
new IgnoredMethodsPanel(m_model),
new ChronologicalPanel(m_model));
// Generate the navigator on the left hand side
new NavigatorPanel(m_model, panels).generate(xsb);
xsb.push(D, C, "wrapper");
xsb.push(D, "class", "main-panel-root");
//
// Generate the main suite panel
//
new SuitePanel(m_model).generate(xsb);
// Generate all the navigator panels
for (INavigatorPanel panel : panels) {
panel.generate(xsb);
}
xsb.pop(D); // main-panel-root
xsb.pop(D); // wrapper
xsb.addString("