Skip to main content

Robot Framework prerebotmodifiers for tabular test results

Project description

Robot Framework Tabular Report

Upload Python Package

Overview

Robot Framework Tabular Report is a small extension for Robot Framework that generates tabular test reports alongside the regular output files, for easier overview and to make them more accessible. The tabular test report can be generated in different formats, currently CSV and Excel.

Features

  • Generates test results in a tabular format
  • Supports multiple file formats: CSV, XLSX
  • Easy integration with Robot Framework
  • Customizable columns and report content
  • Customizable formatting (only XLSX)

Installation

pip install robotframework-tabular-report

Usage

Basic Example

The Writers provided by this library can easily be utilized using the --prerebotmodifier option (see "3.6.9 Programmatic modification of results" in Documentation) either directly during the test execution

robot --prerebotmodifier CsvWriter:myfile my_tests

or afterwards using existing test results:

rebot --prerebotmodifier XlsWriter:workbook output.xml

Configuration

You can customize the columns and formatting in the command line. All writers support the following parameters:

  • output_filename: Name for the output file without extension (mandatory argument)
  • format_specifier: Select test result properties for the output (See Format Specifiers)
  • docs_max_len: When writing Test/Suite documentation to output, limit length (default: 100)

CsvWriter

Additionally this Writer support the following arguments:

  • delim: Delimeter (one character) to use in CSV file, use special value "TAB" to generate a Tab-separated file (default: ,)

XlsWriter

Additionally this Writer support the following arguments:

  • colored_status: Use conditional formatting to color red/green in test status column (Truthy/Falsy, default: True)
  • colored_rows: Color complete test case row read/green depending on test status (Truthy/Falsy, default: False)

Note: The formatting based on test status is only supported, when the status field is present in the output.$

Details

The arguments need to be provided in order, following the modifier name and separated by :, all parameters other then the filename are optional. When needing to set a letter parameter, whil leaving a earlier on at its default value the value can be skipped (empty assignment, i.e. ::).

Example:

robot --prerebotmodifier CsvWriter:myfile:name,status,parent.metadata,tags::TAB my_tests

This would create a Tab-separated file myfile.csv, with the provided fields and the default doc length.

Example 2:

robot --prerebotmodifier XlsWriter:workbook::::Yes my_tests

This would create a Excel file workbook.xlsx, with the default fields and formatting (red/green) applied to each row depending on the test status.

Format Specifiers

The format specifiers are expected to be one of the properties of the TestCase result model or the TestSuite result model, accessible via the parent field. This includes, but might not be limited to:

Fields Comments
(parent.)doc Test Case/Suite Documentation
(parent.)elapsedtime Time spent in Test Case/Suite as String
(parent.)endtime Timestamp of Test Case/Suite end
(parent.)failed Representation of "FAIL" status as Bool
(parent.)full_name Normally "Suite Name.Test Name"
(parent.)has_setup If Test Case/Suite has a setup defined
(parent.)has_teardown If Test Case/Suite has a teardown defined
(parent.)id Automatically set Id
(parent.)message Test Message of Test Case/Suite if set
(parent.)name Name of the Test Case/Suite
(parent.)not_run Representation of "NOT RUN" status as Bool
(parent.)passed Representation of "PASS" status as Bool
(parent.)setup Keyword name for Test Case/Suite setup if set
(parent.)skipped Representation of "SKIP" status as Bool
(parent.)source Path to source file of Test Case/Suite
(parent.)starttime Timestamp of Test Case/Suite start
(parent.)status Test Case/Suite result
(parent.)teardown Keyword name for Test Case/Suite teardown if set
body Test Case content as parsed from source file
lineno Line number to Test Case definition in source file
parent.all_tests List of all Test Cases in Suite
parent.full_message Combination of message and stat_message
parent.has_tests If Test Suite is empty
parent.metadata Free suite metadata if set (list of tuples)
parent.stat_message Test Suite statistics as String
parent.test_count Number of all Test Cases in Suite
tags Test Case Tags
timeout Test Case Timeout

The Default format would be equivalent to the following specifier: full_name,doc,tags,status,message,elapsedtime,starttime,endtime

When using the special value LONG for the format_specifier argument, this library provides another pre-configured format, which is equivalent to: id,parent.name,name,parent.metadata,doc,tags,status,message,elapsedtime,starttime,endtime,timeout,source,lineno

Just did some quick testing on all other parameters listed here and found no issues. With members that aren't not listed your kilometerage may vary. Accessing grandparent members is not possible currently.

Examples files as well as my basis for testing can be found in the test folder.

Contact

For questions or support, please open an issue.


No AI was harmed in the making of this Readme.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robotframework_tabular_report-0.2.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file robotframework_tabular_report-0.2.0.tar.gz.

File metadata

File hashes

Hashes for robotframework_tabular_report-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ec4902587b3936c03a0bb8d6318c98a528c00fc6ac2232b190f317c56fb4648b
MD5 5a7d342cb8e89352a3f5f1945a3e8af1
BLAKE2b-256 e7b2397a4cc6c611485d87a56a87343413d261a4e6e63d90f65f3095efeedaae

See more details on using hashes here.

Provenance

The following attestation bundles were made for robotframework_tabular_report-0.2.0.tar.gz:

Publisher: python-publish.yml on p-zander/robotframework-tabular-report

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file robotframework_tabular_report-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for robotframework_tabular_report-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4b833a18034df91f32fff5d15c5209903b4e352eb0ee5aa5a1c4295ff741767
MD5 927ab864fecdb1173da7e4c179a3d547
BLAKE2b-256 fce4ff34a6a0252f0a5d9b331e160b6f35d3cb577fbcf8c6f545bed175fb1b63

See more details on using hashes here.

Provenance

The following attestation bundles were made for robotframework_tabular_report-0.2.0-py3-none-any.whl:

Publisher: python-publish.yml on p-zander/robotframework-tabular-report

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page