LogoLogo
🚀 Run Maestro tests in the cloud →
  • Home
  • Star us on GitHub
  • Getting Started
    • What is Maestro?
    • Installing Maestro
      • macOS
      • Windows
      • Linux
    • Build and Install your App
      • Android
      • iOS
    • Run a Sample Flow
    • Writing Your First Flow
    • Maestro Studio
    • Running Flows on CI
  • Cloud
    • Run Maestro tests in the cloud
    • Cloud Quickstart
    • CI Integration
      • GitHub Actions
        • Maestro GitHub Action for Android
        • Maestro GitHub Action for iOS
        • Maestro GitHub Action for Flutter
      • Bitrise
      • Bitbucket Pipelines
      • CircleCI
      • Integration with any CI platform
    • Pull Request Integration
    • Cloud Reference
      • Build your app for the cloud
      • Configuring OS Version
      • Configuring device locale
      • Device timezones
      • Email Notifications
      • Slack Notifications
      • Webhook Integration
      • Managing Secrets
      • Limits
      • Reusing App Binary
      • IP Allowlist
      • System Status
  • Platform Support
    • Supported Platforms
    • Android - Views
    • Android - Jetpack Compose
    • iOS - UIKit
    • iOS - SwiftUI
    • React Native
    • Flutter
    • Web Views
    • Web (Desktop Browser)
  • Examples
    • Android contacts flow automation
    • Facebook signup flow automation
    • Advanced: Wikipedia Android
    • Page Object Model
  • CLI
    • Cloud
    • Test Suites & Reports
    • Tags
    • Record Your Flow
    • Continuous Mode
    • View Hierarchy
    • Start Device
  • API Reference
    • Commands
      • addMedia
      • assertVisible
      • assertNotVisible
      • assertTrue
      • assertWithAI
      • assertNoDefectsWithAi
      • back
      • clearKeychain
      • clearState
      • copyTextFrom
      • evalScript
      • eraseText
      • extendedWaitUntil
      • extractTextWithAI
      • hideKeyboard
      • inputText
      • killApp
      • launchApp
      • openLink
      • pressKey
      • pasteText
      • repeat
      • retry
      • runFlow
      • runScript
      • scroll
      • scrollUntilVisible
      • setAirplaneMode
      • setLocation
      • startRecording
      • stopApp
      • stopRecording
      • swipe
      • takeScreenshot
      • toggleAirplaneMode
      • tapOn
      • doubleTapOn
      • longPressOn
      • travel
      • waitForAnimationToEnd
    • Common command arguments
    • Selectors
    • Configuration
      • Workspace configuration
      • Flow configuration
      • AI configuration
  • Advanced
    • Nested Flows
    • Wait
    • Loops
    • Conditions
    • Parameters & Constants
    • JavaScript
      • Run JavaScript
      • Outputs
      • Logging
      • Access element text
      • Make HTTP requests
      • GraalJS support
      • JavaScript announcement blog
    • Specify a Device
    • Configure Permissions
    • Detect Maestro in your app
    • Configure Maestro driver timeout
    • onFlowStart / onFlowComplete hooks
    • Test in different locales
    • Structuring your test suite
  • Troubleshooting
    • Known Issues
    • Frequently Asked Questions
    • Bug Report
    • Rollback Maestro
    • Debug Output
    • HOWTOs
      • Arrange your repository for Maestro tests
      • scrollUntilVisible for fragments
  • Community
    • Contributions
    • Articles & Tutorials
    • Case Studies
    • Resources
Powered by GitBook

Read to wire into CI or scale up your testing?

  • Run Maestro tests in the cloud →
On this page
  • Adding Tags
  • Filtering
  • Global tags

Was this helpful?

Edit on GitHub
  1. CLI

Tags

You can add tags to your Flows files to later filter them in maestro cloud and maestro test commands. There is a couple of different use cases for this, but this is especially useful when you want to run some Flows at Pull Request time, and other Flows before a version release, for example.

Adding Tags

You can provide a list of tags in the tags field at the root of your Flow file. Like this:

appId: com.example.App
tags:
  - nightly-build
  - pull-request
---
- launchApp

Filtering

In maestro cloud and maestro test commands, you can specify either --include-tags or --exclude-tags parameters to filter them.

The --include-tags will look for all flows containing the provided tag; it doesn't matter if those Flows also have other tags. On the other hand, the --exclude-tags parameter will remove from the list of Flows run any Flow that contains the provided tags. These options can be used together and they perform an AND operation.

Example

Let's say a user has two flows:

# flowA.yaml
appId: com.example.app
tags: 
  - dev
  - pull-request
# flowB.yaml
appId: com.example.app
tags: 
  - dev

In the scenario above:

  • If they use --include-tags=dev , flowA and flowB will run.

  • If they use --include-tags=dev,pull-request , both flows will run.

  • If they use --exclude-tags=pull-request , only flowB will run.

  • If they use --exclude-tags=dev none Flow will run.

  • If they use --include-tags=dev --exclude-tags=pull-request , only flowB will run.

Global tags

Instead of passing tags with each test or cloud command, you can also define default tags to be applied to each run. To do so, add the following to your config.yaml file (or create it if it is missing):

includeTags:
  - tagNameToInclude
excludeTags:
  - tagNameToExclude

Now, whenever you run a test folder the following will happen:

  • Only flows with a tagNameToInclude are going to run

  • Flows with a tagNameToExclude are not going to run (even if they have tagNameToInclude assigned to them)

When used in combination with --include-tags and --exclude-tags, global tags behaving as a union and will not be overwritten. Consider the following example:

maestro test --include-tags=tagA --exclude-tags=tagB workspaceFolder/

The following behaviour should be expected:

  • Only flows that have both tagA and tagNameToInclude are going to run

  • Flows that have either tagB or tagNameToExclude are not going to run (regardless of whether they have both tagA and tagNameToInclude)

PreviousTest Suites & ReportsNextRecord Your Flow

Last updated 5 months ago

Was this helpful?