Skip to content

[BUG] inputText not properly parsing env var fallback on -inputText #49

@trenslow

Description

@trenslow

Description

When using Maestro env var substitution with default value, according to the docs, maestro-runner fails to parse the default value.

Steps to Reproduce

  1. Use a flow similar to the subflow in the link
  2. Run the flow

Expected Behavior

Env var should fall back to default value if it isn't set on runtime.

Actual Behavior

maestro-runner inserts as the -inputText value the whole conditional, e.g. ${USER_ID || "test_user_1"}

Environment

  • OS: macOS 26.3
  • Go version: go version go1.26.2 darwin/arm64
  • maestro-runner version: 1.1.1
  • Executor: UIAutomator2
  • Device/Simulator: Pixel 7 pro emulator

Flow File

# subflows/login.yaml
appId: com.example.app
env:
    # Use the passed value, or default to a test account
    USER_ID: ${USER_ID || "test_user_1"}
---
- tapOn: "User ID"
- inputText: ${USER_ID}

Error Output

tapOn: text="blabla" (7.0s)
          ╰─ context deadline exceeded: no such element: An element could not be located on the page using the given search parameters

Additional Context

the error message is related to the step after the -insertText command which fails to properly insert text

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions