airtest.report.report module

nl2br(eval_ctx, value)[source]
timefmt(timestamp)[source]

Formatting of timestamp in Jinja2 templates :param timestamp: timestamp of steps :return: “%Y-%m-%d %H:%M:%S”

class LogToHtml(script_root, log_root='', static_root='', export_dir=None, script_name='', logfile=None, lang='en', plugins=None)[source]

Bases: object

Convert log to html display

scale = 0.5
static init_plugin_modules(plugins)[source]
classmethod get_thumbnail(path)[source]

compress screenshot

classmethod get_small_name(filename)[source]
static div_rect(r)[source]

count rect for js use

is_pos(v)[source]
copy_tree(src, dst, ignore=None)[source]
get_relative_log(output_file)[source]

Try to get the relative path of log.txt :param output_file: output file: log.html :return: ./log.txt or “”

get_console(output_file)[source]
readFile(filename, code='utf-8')[source]
report_data(output_file=None, record_list=None)[source]

Generate data for the report page

Parameters:
  • output_file – The file name or full path of the output file, default HTML_FILE

  • record_list – List of screen recording files

Returns:

report(template_name='log_template.html', output_file='log.html', record_list=None)[source]

Generate the report page, you can add custom data and overload it if needed

Parameters:
  • template_name – default is HTML_TPL

  • output_file – The file name or full path of the output file, default HTML_FILE

  • record_list – List of screen recording files

Returns:

simple_report(filepath, logpath=True, logfile=None, output='log.html')[source]
get_parger(ap)[source]
main(args)[source]