Skip to main content

Customized tool to run Maestro tests, parse Maestro report file, and push reports to Lark.

Project description

py-maestro-reporter

badge

Customized tool to run Maestro tests, parse Maestro report file and send the parsed report to Lark respective group. This tool allows you to run Maestro tests seamlessly by providing built-in methods to run the tests and also CLI arguments to directly run the without having to write any code

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 .

Installation dependencies

Other than the Python dependencies, this package also requires the Maestro framework to be installed on your system

Usage

Using as a CLI argument

As you can see, this package also provides a CLI tool to run Maestro tests and parse the report immediately. To do this, all you need to do is, ensure you have Maestro installed on your device, example flows which is going to be tested, physical device or emulator and Webhook URL from Lark. Once you have all of these, you can run with CLI arguments such as:

# this is an example of running the tests normally
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"

# 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 environment variable in your .env file

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()

# this command would be failing if you don't have Facebook installed on your device,
# or you don't executed the flow with the emulator or physical device (ensure you've this in order to correctly run the tests)
command = "maestro test examples/facebook-sign-up-flow.yaml --format junit --output tests/report.xml"
run_maestro_command(command=command, cwd="tests")
parsed_result = parse_xml_report(file_path="report.xml")
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

All successful tests (from execute the Maestro command -> parse the report -> send the report to Lark) 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

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 only supports for Lark. At the meantime, we're working on adding more integrations with other platforms
  • The interactive card message is built using the msg_actioncard message type, which is currently only supported by Lark. Any customizable message types will be added in the future release

Further references

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

maestro_reporter-0.1.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

maestro_reporter-0.1.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file maestro_reporter-0.1.0.tar.gz.

File metadata

  • Download URL: maestro_reporter-0.1.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for maestro_reporter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1c0b8a9e6c88b95a3bb252bcefd81be57654444d4a41bb54eb753a49cb46712d
MD5 3d3c8d228d1abb9bfc64bc144ddf0c07
BLAKE2b-256 2bae83579176d2e304207749cb486f8a46b8fc6e216cbea25fc145bccbed58b8

See more details on using hashes here.

File details

Details for the file maestro_reporter-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for maestro_reporter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ae5efcd44e0e8b048ff4485f000e73e559117829a87fd102d17b23b83e84231
MD5 fe8d2f16ffa13c27cb27342a11b37a77
BLAKE2b-256 a14c07e917955674ec1ab6add9b9a47ddb2d0815747a5efd9ca20b5e1c289a9b

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