Skip to main content

Simple github action summary report for robotframework

Project description

robotframework-ghareports

This project enables robot framework to generate Github Job Summary for a testrun. You can either use it as listener or standalone command line tool. When executed, it checks if environment variable GITHUB_STEP_SUMMARY exists and if it does, it exposes test results to a PR - example output looks something like this

Main purpose for standalone tool is that with it, you can use pabot or rerun failed test cases once you have combined the logs to a single output.xml, you can use ghareports to generate the summary.

Installation

python -mpip install robotframework-ghareports

Usage as listener

robot --listener GHAReports .

Usage as standalone tool

python -mGHARerports -r path/to/robot/output.xml

Help that shows all available arguments

ghareports --help

Additional

If you want to limit the width of the tables in the summary, you can provide an argument to the listener like this:

robot --listener GHAReports:35 .

or

python -mGHAReports -r output.xml --width=35

This will split each cell with string content at every 35 characters into a new line.

And if you want to generate the summary even if a) you are not running in Github or you want to generate extra summary file independent of Github actions, pass report_file argument to the listener like this:

robot --listener GHAReports:report_file=extra_summary.md

or

robot --listener GHAReports:34:extra_summary.md

or via standalone tool:

ghareports -r output.xml -m example_step_summary.md

In some cases one would want to log environment variables to the summary page. For example, if same test assets are executed against different environments and env value is coming off from action's input. This can be archived by setting each input as env variable in job's env section like this:

jobs:
  build:
    env:
      ENVIRONMENT: ${{ inputs.TEST_ENV }}
      BROWSER: ${{ inputs.DEFAULT_BROWSER }}
      RERUN_FAILED: ${{ inputs.RERUN_FAILED }}

and then passing a list of comma separated list to listener or standalone tool like this:

# listener
robot --listener GHAReports:env_variables=ENVIRONMENT,BROWSER,RERUN_FAILED
  ghareports -r output.xml -e ENVIRONMENT,BROWSER,RERUN_FAILED

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_ghareports-0.9.1.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

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

robotframework_ghareports-0.9.1-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file robotframework_ghareports-0.9.1.tar.gz.

File metadata

File hashes

Hashes for robotframework_ghareports-0.9.1.tar.gz
Algorithm Hash digest
SHA256 838b778588fd6b5e0cd7e81992af15ea170a80c66cb0fd4735ef81473152639b
MD5 1aa2bbfbec5daf80a5f3cd1e546265c5
BLAKE2b-256 262bb6eed1c40e3059abf00ef38436fe3abceab725ebab1942cb208489456cd5

See more details on using hashes here.

File details

Details for the file robotframework_ghareports-0.9.1-py3-none-any.whl.

File metadata

File hashes

Hashes for robotframework_ghareports-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c1ec9547eb3edb9741746324f87acf02b647464c33288611ccae51bdb441c670
MD5 ed1e6abaf5a229331c5b88819afeb21e
BLAKE2b-256 a7b79cbf7552b0f3e0c5ee223e637cfda62a10901cb0ec2cdaac7e9265025780

See more details on using hashes here.

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