robot.reporting package
Implements report, log, output XML, and xUnit file generation.
The public API of this package is the ResultWriter
class. It
can write result files based on XML output files on the file system,
as well as based on the result objects returned by
the ExecutionResult()
factory method or
an executed TestSuite
.
It is highly recommended to use the public API via the robot.api
package.
This package is considered stable.
Submodules
robot.reporting.expandkeywordmatcher module
robot.reporting.jsbuildingcontext module
robot.reporting.jsexecutionresult module
robot.reporting.jsmodelbuilders module
- class robot.reporting.jsmodelbuilders.JsModelBuilder(log_path=None, split_log=False, expand_keywords=None, prune_input_to_save_memory=False)[source]
Bases:
object
- class robot.reporting.jsmodelbuilders.Builder(context: JsBuildingContext)[source]
Bases:
object
- robot_note = re.compile('<span class="robot-note">(.*)</span>')
- class robot.reporting.jsmodelbuilders.MessageBuilder(context: JsBuildingContext)[source]
Bases:
Builder
- class robot.reporting.jsmodelbuilders.ErrorMessageBuilder(context: JsBuildingContext)[source]
Bases:
MessageBuilder
robot.reporting.jswriter module
- class robot.reporting.jswriter.JsResultWriter(output, start_block='<script type="text/javascript">\n', end_block='</script>\n', split_threshold=9500)[source]
Bases:
object
robot.reporting.logreportwriters module
- class robot.reporting.logreportwriters.LogWriter(js_model)[source]
Bases:
_LogReportWriter
- usage = 'log'
- class robot.reporting.logreportwriters.ReportWriter(js_model)[source]
Bases:
_LogReportWriter
- usage = 'report'
- class robot.reporting.logreportwriters.RobotModelWriter(output, model, config)[source]
Bases:
ModelWriter
robot.reporting.outputwriter module
- class robot.reporting.outputwriter.OutputWriter(output, rpa=False, suite_only=False)[source]
Bases:
XmlLogger
- class robot.reporting.outputwriter.LegacyOutputWriter(output, rpa=False)[source]
Bases:
LegacyXmlLogger
robot.reporting.resultwriter module
- class robot.reporting.resultwriter.ResultWriter(*sources)[source]
Bases:
object
A class to create log, report, output XML and xUnit files.
- Parameters:
sources – Either one
Result
object, or one or more paths to existing output XML files.
By default writes
report.html
andlog.html
, but no output XML or xUnit files. Custom file names can be given and results disabled or enabled usingsettings
oroptions
passed to thewrite_results()
method. The latter is typically more convenient:writer = ResultWriter(result) writer.write_results(report='custom.html', log=None, xunit='xunit.xml')
- write_results(settings=None, **options)[source]
Writes results based on the given
settings
oroptions
.- Parameters:
settings –
RebotSettings
object to configure result writing.options – Used to construct new
RebotSettings
object ifsettings
are not given.
robot.reporting.stringcache module
robot.reporting.xunitwriter module
- class robot.reporting.xunitwriter.XUnitFileWriter(xml_writer)[source]
Bases:
ResultVisitor
Provides an xUnit-compatible result file.
Attempts to adhere to the de facto schema guessed by Peter Reilly, see: http://marc.info/?l=ant-dev&m=123551933508682
- start_suite(suite: TestSuite)[source]
Called when a suite starts. Default implementation does nothing.
Can return explicit
False
to stop visiting.
- visit_test(test: TestCase)[source]
Implements traversing through tests.
Can be overridden to allow modifying the passed in
test
without callingstart_test()
orend_test()
nor visiting the body of the test.