XML Stylesheet Templates

XML files in their natural format are not very readable, because tags and delimiters hide the real data. There are also no colors to emphasize important data, font is the same for complete file, ...
Since conversion of XML to something more human readable is a common task, a special standard is defined by W3C, called XSL Transformations. These transformations are described in XML files, and define how to convert XML file to something else, for example XHTML.

XSLTs are used by testIDEA to display test reports, which are stored in XML format, in web browser. You can use built-in XSLTs, or write your own.

When built-in template is used, it is automatically copied to the same folder as XML test report.

CSS

Sometimes we want to show test report in the same form, but with other colors. For example, printing on black-and-white printer may require different colors than viewing on a color monitor. To avoid creation of new XSLT file for each color set, the built-in XSLTs use external CSS (Cascading Style Sheets) files. This is also configurable in dialog for saving test reports.

Custom XSLT and CSS files

When we want to customize the test reports, we can take the built-in XSLT and CSS file and modify them according to our needs.

Embedding XSLT and CSS files

To get complete test report in one XML file, instead of in three files (XML for data, XSLT for transformation, CSS for colors and other HTML style properties), it is possible to configure testIDEA to embed XSLT and CSS files into XML report file (Test | Configure Test Report ...). This creates larger file, and makes sense if there are not many report files. Otherwise, if XSLT and CSS are reused by several XML report files, it is better to keep them as standalone files.

Browser compatibility

Not all browsers may show standalone and embedded versions of report properly. While Internet Explorer has problems with single file (XSLT and CSS embedded), Chrome does not show report when XSLT is stored to separate file. Firefox properly shows report in both cases.