githubEdit

Conditions

Use conditions in Maestro flows to run commands based on visibility, platform, or JavaScript expressions.

circle-exclamation

runFlow conditionally

- runFlow:
    when:
      visible: 'Some Text'
    file: folder/some-flow.yaml
Nested Flowschevron-right

Or, if you don't wish to extract your commands into a separate flow file, you can run the commands inline like this:

- runFlow:
    when:
      visible: 'Some Text'
    commands:
        - tapOn: 'Some Text'
runFlowchevron-right

runScript conditionally

- runScript:
    when:
      visible: 'Some Text'
    file: some-script.js
runScriptchevron-right

Multiple conditions

Note that multiple conditions are applied as AND conditions.

Conditions

Supported conditions include:

All of the normal element matchers are supported, e.g.

Selectorschevron-right

JavaScript

Usage of JavaScript conditions is possible via true condition:

It's also possible to do platform detection in JavaScript:

Using JavaScript in Maestrochevron-right

Last updated

Was this helpful?