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
robot.reporting.resultwriter module
- class robot.reporting.resultwriter.ResultWriter(*sources)[source]
Bases:
objectA class to create log, report, output XML and xUnit files.
- Parameters:
sources – Either one
Resultobject, or one or more paths to existing output XML files.
By default writes
report.htmlandlog.html, but no output XML or xUnit files. Custom file names can be given and results disabled or enabled usingsettingsoroptionspassed 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
settingsoroptions.- Parameters:
settings –
RebotSettingsobject to configure result writing.options – Used to construct new
RebotSettingsobject ifsettingsare not given.
robot.reporting.stringcache module
robot.reporting.xunitwriter module
- class robot.reporting.xunitwriter.XUnitFileWriter(xml_writer: XmlWriter)[source]
Bases:
ResultVisitorProvides 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
Falseto stop visiting.
- visit_test(test: TestCase)[source]
Implements traversing through tests.
Can be overridden to allow modifying the passed in
testwithout callingstart_test()orend_test()nor visiting the body of the test.