Robot Framework prerebotmodifiers for tabular test results
Project description
Robot Framework Tabular Report
Overview
Robot Framework Tabular Report is an extension for Robot Framework that generates tabular test reports for easier overview and to make them more accessible. The report can be converted into various 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 here) 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)
Details
Note: The formatting based on test status is only supported, when the status field is present in the output.
The arguments need to be provided in order, following the Modifier name and separated by :, all parameters other then the filename are optional. An argument setting can be skipped (empty assignment, i.e. ::), when needing to set a latter parameter.
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 test 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
Limited testing was done on all the other fields seen here. Your kilometerage may vary.
Examples files can be found here (myfile.csv and myfile.xlsx) as well as my basis for testing.
Contact
For questions or support, please open an issue.
No AI was harmed in the making of this Readme.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file robotframework_tabular_report-0.1.0.tar.gz.
File metadata
- Download URL: robotframework_tabular_report-0.1.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8072ad6704dc7a2573b1c54ff535e2f5366969912628047d59b0218ce0b3b0a8
|
|
| MD5 |
b18291ff395c8bb14b6fa36cfc49a490
|
|
| BLAKE2b-256 |
68ba1fdec05b6efde07cf2cd5ba0cc15ed3e0d70cfb9ad6987471a602e7f4362
|
Provenance
The following attestation bundles were made for robotframework_tabular_report-0.1.0.tar.gz:
Publisher:
python-publish.yml on p-zander/robotframework-tabular-report
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
robotframework_tabular_report-0.1.0.tar.gz -
Subject digest:
8072ad6704dc7a2573b1c54ff535e2f5366969912628047d59b0218ce0b3b0a8 - Sigstore transparency entry: 341810385
- Sigstore integration time:
-
Permalink:
p-zander/robotframework-tabular-report@e356309b410c207b6004b627c10fd2665ad74582 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/p-zander
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@e356309b410c207b6004b627c10fd2665ad74582 -
Trigger Event:
release
-
Statement type:
File details
Details for the file robotframework_tabular_report-0.1.0-py3-none-any.whl.
File metadata
- Download URL: robotframework_tabular_report-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65c2c8567420ffa802be9161d233f564965689afc6af5b425021c1d58387c5d0
|
|
| MD5 |
65c584292b8a1f441e14ea98a7ea6bcb
|
|
| BLAKE2b-256 |
d1e0c41ab34efb3de605aa00e549cbb4d816866f93f38ea8616892e0ed2eb4e9
|
Provenance
The following attestation bundles were made for robotframework_tabular_report-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on p-zander/robotframework-tabular-report
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
robotframework_tabular_report-0.1.0-py3-none-any.whl -
Subject digest:
65c2c8567420ffa802be9161d233f564965689afc6af5b425021c1d58387c5d0 - Sigstore transparency entry: 341810405
- Sigstore integration time:
-
Permalink:
p-zander/robotframework-tabular-report@e356309b410c207b6004b627c10fd2665ad74582 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/p-zander
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@e356309b410c207b6004b627c10fd2665ad74582 -
Trigger Event:
release
-
Statement type: