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 theExecutionResultandResultVisitorof 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.shstart_postgres.shstart_grafana.sh
cd 02_report_to_postgres- Run
send_results.shto send multiple test results to postgres - Open
localhost:3000to login to Grafana and check thePostgreSQLDashboard
- 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.shstart_grafana.sh(if not already done)
- Run
04_listener_influxdb/run_with_listener.shfrom project root to execute tests and send results in real-time - Open
localhost:3000to login to Grafana and check theInfluxDBDashboard
- 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.pyand05_notifications/report_to_slack.pyto your needs (output.xmlpath the Webhook data is current hardcoded) - Run
05_notifications/report_to_msteams.pyor05_notifications/report_to_slack.pyand 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-recreateor 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.shfrom 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.shcreates a Docker network with the namerobot
This is necessary to allow the containers to communicate with each other.start_postgres.shstarts a PostgreSQL container with the namepostgres- User:
postgres - Password:
robotframework
- User:
start_influxdb.shstarts an InfluxDB container with the nameinfluxdb- User:
admin - Password:
my-password - Organization:
robotframework - Bucket:
results
- User:
start_grafana.shstarts a Grafana container with the namegrafana
Datasources for PostgreSQL and InfluxDB are created automatically.- User:
admin - Password:
robocon
- User: