Skip to main content
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

Automate your Maestro test suite using CI/CD integration

Automate your Maestro test suite on real devices using BrowserStack’s App Automate REST API in CI/CD pipelines

This document shows you how to integrate Maestro tests into your CI/CD workflow, including uploading apps and test suites, executing builds, and fetching results.

Prerequisites

Before starting, ensure you have the following:

  • BrowserStack credentials: Your Username and Access Key, which you can find in your account profile. If you have not created an account yet, you can sign up for a Free Trial.
  • Environment variables: Set the credentials in your CI/CD runner:
    • BROWSERSTACK_USERNAME
    • BROWSERSTACK_ACCESS_KEY
  • Application file: Your .apk (Android) or .ipa (iOS) file.
  • Maestro test suite: A .zip file containing your Maestro .yaml flows.

CI/CD integration steps

Follow the steps below to automate Maestro tests in your CI/CD pipeline:

Upload your app

Upload your mobile app to the BrowserStack servers. This returns an app_url which you will use to trigger the build.

Endpoint: POST https://api-cloud.browserstack.com/app-automate/upload

Terminal
Copy icon Copy

Response:

{"app_url":"bs://<hashed_id>"}

Refer to the Maestro REST API documentation for more details on parameters and options.

Upload your Maestro test suite

Zip your Maestro .yaml flows and upload them. This returns a test_suite_url.

Endpoint: POST https://api-cloud.browserstack.com/app-automate/maestro/v2/test-suite

Terminal
Copy icon Copy

Response:

{"test_suite_url":"bs://<hashed_id>"}

Refer to the Maestro REST API documentation for more details on parameters and options.

Execute the Maestro build

Trigger the actual test execution. You can define devices, OS versions, and even parallelization.

Endpoint: POST https://api-cloud.browserstack.com/app-automate/maestro/v2/build

Terminal
Copy icon Copy

Response:

{"build_id":"<unique_build_id>", "status":"running"}

Refer to the Maestro builds REST API reference documentation for more details on parameters and options.

Get build status and results

In your CI/CD pipeline, you should poll this endpoint until the status is completed, passed, or failed.

Endpoint: GET https://api-cloud.browserstack.com/app-automate/maestro/v2/builds/<build_id>

Terminal
Copy icon Copy

Refer to the Maestro builds REST API reference documentation for more details on parameters and options.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle