This repository demonstrates multiple approaches towards reporting and monitoring of Robot Framework test results.
It will be used to demonstrate the following:
- Using the Results Package of the Robot Framework API to generate custom reports
- Creating a Markdown report for GitHub Actions
- Publishing Test Results to a PosgreSQL database and visualizing the results using Grafana
- Using a Listener to capture test results and publish them to InfluxDB and visualize the results using Grafana
- Using Allure to generate a visually appealing report
- Sending notifications to Slack and MS Teams using Apprise
- Using ReportPortal to publish test results and visualize them
Try it out in Gitpod
Try it out in CoLab
The repository is structured as follows:
The repository is structured into the following sections:
-
01_resultmodel:
This section demonstrates how to use theExecutionResult
andResultVisitor
of the Robot Framework API to generate custom reports.- Run some Robot Framework tests and produce an
output.xml
- Run
python 01_resultmodel/report-results.py <PathToOutput.xml> <PathToMarkdownFile>
to generate a markdown report
- Run some Robot Framework tests and produce an
-
02_report_to_postgres:
This section demonstrates how to publish test results to a PostgreSQL database and visualize the results using Grafana.- Start the docker scripts (from project root)
create_network.sh
start_postgres.sh
start_grafana.sh
cd 02_report_to_postgres
- Run
send_results.sh
to send multiple test results to postgres - Open
localhost:3000
to login to Grafana and check thePostgreSQL
Dashboard
- Start the docker scripts (from project root)
-
03_allure:
This section demonstrates how to use Allure to generate a visually appealing report. -
04_listener_influxdb:
This section demonstrates how to use a Listener to monitor test execution in realtime and publish them to InfluxDB and visualize the results using Grafana.- Start the docker scripts (from project root)
create_network.sh
(if not already done)start_influxdb.sh
start_grafana.sh
(if not already done)
- Run
04_listener_influxdb/run_with_listener.sh
from project root to execute tests and send results in real-time - Open
localhost:3000
to login to Grafana and check theInfluxDB
Dashboard
- Start the docker scripts (from project root)
-
05_notifications:
This section demonstrates how to send notifications to Slack and MS Teams using Apprise.- Set up Webhook for MS Teams or Slack Channel
- Run some Robot Framework tests and produce an
output.xml
- Adjust the
05_notifications/report_to_msteams.py
and05_notifications/report_to_slack.py
to your needs (output.xml
path the Webhook data is current hardcoded) - Run
05_notifications/report_to_msteams.py
or05_notifications/report_to_slack.py
and try send notifications to your Teams/Slack Channel
-
06_reportportal:
This section demonstrates how to publish test results to ReportPortal and visualize them.- Run your own Report Portal instance using the
06_reportportal/docker-compose.yml
cd 06_reportportal docker-compose -p reportportal up -d --force-recreate
or register for a trial at Report Portal
2. Set up a user, a project (e.g.robocon-io
) and generate an API Token for your user 3. Adjust and Run06_reportportal/run_and_publish.sh
from project root to run tests and publish them to Report Portal - Run your own Report Portal instance using the
For the examples in folders 02_report_to_postgres
and 04_listener_influxdb
to work, you need to have PostgreSQL, InfluxDB and Grafana running.
You can find starter scripts to run PostgreSQL, InfluxDB and Grafana in Docker containers in the docker
directory.
create_network.sh
creates a Docker network with the namerobot
This is necessary to allow the containers to communicate with each other.start_postgres.sh
starts a PostgreSQL container with the namepostgres
- User:
postgres
- Password:
robotframework
- User:
start_influxdb.sh
starts an InfluxDB container with the nameinfluxdb
- User:
admin
- Password:
my-password
- Organization:
robotframework
- Bucket:
results
- User:
start_grafana.sh
starts a Grafana container with the namegrafana
Datasources for PostgreSQL and InfluxDB are created automatically.- User:
admin
- Password:
robocon
- User: