Skip to main content

py-maestro-reporter

badge PyPI - Python Version PyPI Downloads coverage

py-maestro-reporter is a lightweight tool that helps you:

  • Run Maestro test seamlessly
  • Parse Maestro JUnit reports
  • Send summarized test results to a Lark/Slack respective group

It can be used either as a CLI tool or a python package into your own test pipelines

Prerequisites

  • Python 3.10 or above
  • Maestro framework installed on your system (version 2.0.0 or above)
  • Device/emulator with the app under test installed
  • Lark/Slack webhook URL (optional)

Installation

For the installation, you can either install the package from PyPI or from source. If you'd like to install from PyPI, you can install it with:

pip install maestro-reporter

Or, using uv:

uv pip install maestro-reporter

Or, if you'd prefer to install from source, you'll need to clone this repository and install it in editable mode:

pip install -e .

Usage

Using as a CLI argument

This package expose a CLI via the reporter module

All you need to do is, ensure you have Maestro installed on your device, example flows which is going to be tested, physical device / emulator and Webhook URL from Lark. Once you have all of these, you can run with :

python -m reporter \
    -c "maestro test examples/facebook-sign-up-flow.yaml --format junit --output tests/report.xml" \
    -r "tests/report.xml" \
    -w "https://webhook.url.com"

Parsing an existing report

Or, if you only want to run and parse the report without testing, you can use --no-run flag

python -m reporter \
    --no-run \
    -r "tests/report.xml" \
    -w "https://webhook.url.com"

You can also overrides the Webhook URL by setting the LARK_URL or SLACK_URL environment variable in your .env file, depending on the provider you choose.

Using the reporter package

Otherwise, if you'd like to run the tests without using the CLI arguments and you need to run the tests with the reporter package, you can follow the example below:

# this will test the Facebook sign-up flow
import os
from dotenv import load_dotenv
from reporter import parse_xml_report, send_report_to_lark, run_maestro_command


load_dotenv()


command = "maestro test examples/facebook-sign-up-flow.yaml --format junit --output build/maestro-results/report.xml"
report_path = run_maestro_command(command=command, cwd="tests")
parsed_result = parse_xml_report(file_path=str(report_path))
report = send_report_to_lark(
    summary=parsed_result,
    title="Maestro Reporter Test",
    color_template="Green",
    webhook_url=os.getenv("LARK_URL"),
)

The parameters of color_template and title are mandatory, if you don't provide them, the default values will be used

Note (v0.8.0): run_maestro_command reads the --output argument from your command, creates the report's parent directory automatically, and returns the resolved report path. When Maestro exits with a non-zero code, the report is still returned if it exists, so failed-test results can be reported. RuntimeError is raised only when no report file is found. run_maestro_command and parse_xml_report raise an exception on failure instead of silently returning None.

All successful tests will be displayed in the log stream handler, for example:

27-11-2025 : 10:51:46 : main : [WARNING] : No color template provided, using default color template or you can set it with `--color` flag
27-11-2025 : 10:51:46 : main : [WARNING] : No title provided, using default title or you can set it with `--title` flag
27-11-2025 : 10:51:46 : main : [INFO] : --no-run flag is set, skipping Maestro tests
27-11-2025 : 10:51:46 : main : [INFO] : Parsing Maestro report file: tests/report.xml
27-11-2025 : 10:51:46 : main : [INFO] : Sending Maestro report to Lark...
27-11-2025 : 10:51:46 : reporter.sender : [INFO] : Lark message sent successfully
27-11-2025 : 10:51:46 : main : [INFO] : Maestro report sent successfully

Once the report is sent successfully, you should be able to see the interactive card message in your Lark group like the following image

Lark Interactive Card Message

Otherwise, if you want to use Slack as a reporting platform, the card message will be displayed as follows

Slack Card Message

CLI arguments

List of available CLI arguments that you can use with this package:

arguments description
-h / --help show this help message and exit
-c / --command Maestro command to run
-r / --report Path to Maestro report, by default it's report.xml but you can configure it by yourself
-w / --webhook Specify a webhook URL to send the report to Lark
-n / --no-run No need to run Maestro tests, just parse the report and send the result to Lark
-t / --title Set a custom title for the interactive card Lark message
-ct / --color Set a custom color template for the interactive card Lark message
-p / --provider Specify the reporting platform (lark or slack). Default is lark

Notes

  • At the moment, this package only supports the parsing of the junit format as follows for the Maestro report
  • In addition, the webhook integration currently supports Lark and Slack
  • The interactive card message is built using the msg_actioncard message type for Lark and Block Kit for Slack

Further references

Metadata

Release files for maestro-reporter 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for maestro-reporter 1.0.0
File Size Uploaded Provenance Actions
maestro_reporter-1.0.0.tar.gz 16.2 kB Without provenance Details for maestro_reporter-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for maestro-reporter 1.0.0
File Interpreter ABI Platform Actions
maestro_reporter-1.0.0-py3-none-any.whl Python 3 none any Details for maestro_reporter-1.0.0-py3-none-any.whl

Total release size: 30.2 kB

Release files / maestro_reporter-1.0.0.tar.gz

Download URL maestro_reporter-1.0.0.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8ded7782d5ef8f44d2a96d6f415337948212474bbfceee413c4f4996ce8317d5
BLAKE2b-256 checksum
How to use checksums
ae6998d1739b830d879251c1fddb32b96f30449daf32130addd664324a4a3174
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / maestro_reporter-1.0.0-py3-none-any.whl

Download URL maestro_reporter-1.0.0-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b788774b79a2ee803e5389f861d52fb1d572d0ca5ec9b62d1b90592ba7aec9fa
BLAKE2b-256 checksum
How to use checksums
14c2e1f6eda8c425a8fb154bc671fd50e93d6e90f96ab689b089b18366ac886f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for maestro-reporter 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page