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

Manage Maestro tests with config files

Learn how to use flow and workspace configuration files to manage your Maestro test suite’s settings on BrowserStack App Automate.

This document explains the supported parameters for both configuration types and how to use them in your test execution.

Overview of Maestro configurations

Maestro supports two types of configuration files to help you manage and customize your test suites efficiently:

  • Flow configuration: Settings defined at the beginning of an individual flow file (.yaml) that apply only to that specific flow.
  • Workspace configuration: A dedicated config.yaml file that applies settings across your entire test suite, allowing for broader customizations.

Flow configuration

You can define configurations directly within a specific Maestro flow file. These settings apply only to the flow in which they are defined.

Supported flow configuration options include:

Parameter Description Requirement
appId Specifies the application to launch at the beginning of the Flow. Required
name An optional custom name for the Flow, overriding the default filename. Optional
tags A list of associated tags for organizing the Flow. Further details can be found in the documentation. Optional
env A collection of key-value pairs representing environment variables accessible within the Flow. Optional
onFlowStart A hook that executes a series of Maestro commands before each flow begins. Commonly used for setup operations. Optional
onFlowComplete A hook that runs a list of Maestro commands after each flow concludes, irrespective of its success or failure. Often utilized for teardown or cleanup tasks. Optional

Example flow file

Here is an example of a flow file with inline configuration:

Workspace configuration (config.yaml)

For test-suite-level customizations, create a config.yaml file in the root of your Maestro test suite (.maestro directory). This file allows you to control the execution of multiple flows, manage platform-specific settings, and set up notifications.

Note: Support for pr-config.yaml is currently not available.

Supported config.yaml options include:

  • flows
  • includeTags
  • excludeTags
  • executionOrder

Example config.yaml file

Here is an example of a workspace configuration file:

Run tests using a workspace configuration file

To execute your Maestro test suite with a workspace configuration, upload your test suite (as a .zip file) and specify the path to your config.yaml file in the config parameter of the REST API request.

Example REST API request

Here is a sample cURL request to run your tests using a config.yaml file:

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/maestro/v2/android/build" \
-H "Content-Type: application/json" \
-d '{
"app": "bs://<app_id>",
"testSuite": "bs://<test_suite_id>",
"devices": ["Google Pixel 7-13.0"],
"networkLogs": "true",
"deviceLogs": "true",
"config": "path/to/your/config.yaml"
}'
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/maestro/v2/ios/build" \
-H "Content-Type: application/json" \
-d '{
"app": "bs://<app_id>",
"testSuite": "bs://<test_suite_id>",
"devices": ["iPhone 15-17.0"],
"networkLogs": "true",
"deviceLogs": "true",
"config": "path/to/your/config.yaml"
}'

In the request body, the config key points to the location of your config.yaml file within your uploaded test suite.

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