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.jsbuildingcontext module¶
robot.reporting.jsexecutionresult module¶
robot.reporting.jsmodelbuilders module¶
-
class
robot.reporting.jsmodelbuilders.JsModelBuilder(log_path=None, split_log=False, prune_input_to_save_memory=False)[source]¶ Bases:
object
-
class
robot.reporting.jsmodelbuilders.SuiteBuilder(context)[source]¶ Bases:
robot.reporting.jsmodelbuilders._Builder
-
class
robot.reporting.jsmodelbuilders.TestBuilder(context)[source]¶ Bases:
robot.reporting.jsmodelbuilders._Builder
-
class
robot.reporting.jsmodelbuilders.KeywordBuilder(context)[source]¶ Bases:
robot.reporting.jsmodelbuilders._Builder
-
class
robot.reporting.jsmodelbuilders.MessageBuilder(context)[source]¶ Bases:
robot.reporting.jsmodelbuilders._Builder
-
class
robot.reporting.jsmodelbuilders.ErrorsBuilder(context)[source]¶ Bases:
robot.reporting.jsmodelbuilders._Builder
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:
robot.reporting.logreportwriters._LogReportWriter
robot.reporting.outputwriter module¶
-
class
robot.reporting.outputwriter.OutputWriter(output, rpa=False)[source]¶ Bases:
robot.output.xmllogger.XmlLogger-
start_message(msg)[source]¶ Called when message starts. Default implementation does nothing.
Can return explicit
Falseto stop visiting.
-
visit_keyword(kw)[source]¶ Implements traversing through the keyword and its child keywords.
Can be overridden to allow modifying the passed in
kwwithout callingstart_keyword()orend_keyword()nor visiting child keywords.
-
end_errors(errors=None)¶
-
end_keyword(kw)¶ Called when keyword ends. Default implementation does nothing.
-
end_message(msg)¶ Called when message ends. Default implementation does nothing.
-
end_stat(stat)¶
-
end_statistics(stats)¶
-
end_suite(suite)¶ Called when suite ends. Default implementation does nothing.
-
end_suite_statistics(tag_stats)¶
-
end_tag_statistics(tag_stats)¶
-
end_test(test)¶ Called when test ends. Default implementation does nothing.
-
end_total_statistics(total_stats)¶
-
log_message(msg)¶
-
message(msg)¶
-
set_log_level(level)¶
-
start_errors(errors=None)¶
-
start_keyword(kw)¶ Called when keyword starts. Default implementation does nothing.
Can return explicit
Falseto stop visiting.
-
start_result(result)¶
-
start_stat(stat)¶
-
start_statistics(stats)¶
-
start_suite(suite)¶ Called when suite starts. Default implementation does nothing.
Can return explicit
Falseto stop visiting.
-
start_suite_statistics(tag_stats)¶
-
start_tag_statistics(tag_stats)¶
-
start_test(test)¶ Called when test starts. Default implementation does nothing.
Can return explicit
Falseto stop visiting.
-
start_total_statistics(total_stats)¶
-
visit_errors(errors)¶
-
visit_message(msg)¶ Implements visiting the message.
Can be overridden to allow modifying the passed in
msgwithout callingstart_message()orend_message().
-
visit_result(result)¶
-
visit_stat(stat)¶
-
visit_statistics(stats)¶
-
visit_suite(suite)¶ Implements traversing through the suite and its direct children.
Can be overridden to allow modifying the passed in
suitewithout callingstart_suite()orend_suite()nor visiting child suites, tests or keywords (setup and teardown) at all.
-
visit_suite_statistics(stats)¶
-
visit_tag_statistics(stats)¶
-
visit_test(test)¶ Implements traversing through the test and its keywords.
Can be overridden to allow modifying the passed in
testwithout callingstart_test()orend_test()nor visiting keywords.
-
visit_total_statistics(stats)¶
-
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.
- settings –
-
robot.reporting.stringcache module¶
-
class
robot.reporting.stringcache.StringIndex[source]¶ Bases:
int-
bit_length() → int¶ Number of bits necessary to represent self in binary. >>> bin(37) ‘0b100101’ >>> (37).bit_length() 6
-
conjugate()¶ Returns self, the complex conjugate of any int.
-
denominator¶ the denominator of a rational number in lowest terms
-
imag¶ the imaginary part of a complex number
-
numerator¶ the numerator of a rational number in lowest terms
-
real¶ the real part of a complex number
-
robot.reporting.xunitwriter module¶
-
class
robot.reporting.xunitwriter.XUnitWriter(execution_result, skip_noncritical)[source]¶ Bases:
object
-
class
robot.reporting.xunitwriter.XUnitFileWriter(xml_writer, skip_noncritical=False)[source]¶ Bases:
robot.result.visitor.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)[source]¶ Called when suite starts. Default implementation does nothing.
Can return explicit
Falseto stop visiting.
-
visit_test(test)[source]¶ Implements traversing through the test and its keywords.
Can be overridden to allow modifying the passed in
testwithout callingstart_test()orend_test()nor visiting keywords.
-
visit_keyword(kw)[source]¶ Implements traversing through the keyword and its child keywords.
Can be overridden to allow modifying the passed in
kwwithout callingstart_keyword()orend_keyword()nor visiting child keywords.
-
end_errors(errors)¶
-
end_keyword(keyword)¶ Called when keyword ends. Default implementation does nothing.
-
end_message(msg)¶ Called when message ends. Default implementation does nothing.
-
end_stat(stat)¶
-
end_statistics(stats)¶
-
end_suite_statistics(suite_stats)¶
-
end_tag_statistics(stats)¶
-
end_test(test)¶ Called when test ends. Default implementation does nothing.
-
end_total_statistics(stats)¶
-
start_errors(errors)¶
-
start_keyword(keyword)¶ Called when keyword starts. Default implementation does nothing.
Can return explicit
Falseto stop visiting.
-
start_message(msg)¶ Called when message starts. Default implementation does nothing.
Can return explicit
Falseto stop visiting.
-
start_result(result)¶
-
start_stat(stat)¶
-
start_statistics(stats)¶
-
start_suite_statistics(stats)¶
-
start_tag_statistics(stats)¶
-
start_test(test)¶ Called when test starts. Default implementation does nothing.
Can return explicit
Falseto stop visiting.
-
start_total_statistics(stats)¶
-
visit_message(msg)¶ Implements visiting the message.
Can be overridden to allow modifying the passed in
msgwithout callingstart_message()orend_message().
-
visit_result(result)¶
-
visit_stat(stat)¶
-
visit_suite(suite)¶ Implements traversing through the suite and its direct children.
Can be overridden to allow modifying the passed in
suitewithout callingstart_suite()orend_suite()nor visiting child suites, tests or keywords (setup and teardown) at all.
-
visit_suite_statistics(stats)¶
-
visit_tag_statistics(stats)¶
-
visit_total_statistics(stats)¶
-