maestro icon indicating copy to clipboard operation
maestro copied to clipboard

Selector properties don't function properly inside the "runFlow" method

Open panawel opened this issue 11 months ago • 1 comments

Selector properties don't function properly inside the "runFlow" method. it will always get 'enabled: true' and execute the command even if 'enabled' is actually 'false'

it does work in assert like this: - assertNotVisible: text: "My Button" enabled: true

but NOT like this:

  - runFlow:
      when:
        visible:
            id: "appId:id/switch_wid"
            index: 0
            **enabled: true**
      commands:
          - tapOn: "read receipts."
          - back

This prevents me from performing a commends depending on the state of the switch. because it's always got through no matter the actual state.

To Reproduce

  1. connect real android device via USB.
  2. Run 'maestro test' file with that flow:
  • runFlow: when: visible: id: "appId:id/switch_wid" # it's just an example. index: 0 enabled: true commands: - tapOn: "read receipts." # it's just an example. - back
  1. The Flow will always pass and the commands will always perform even if the Switch status is enabled: false

Expected behavior When: Switch 'id' and 'index' is 'visible' in 'enabled' status as 'true' - perform the actions in the 'commands' section.

Screenshots Screenshot_20240320-153104_Whispers

Environment information (please complete the following information):

  • Maestro version [v1.36.0]
  • Platform: [Android 13.0]
  • Framework: [Native Android]
  • Device model and OS version: [Pixel 6 pro, LineageOS 13]
  • physical device
  • Host [Mac Intel Core i5, macOS Monterey 12.7.4]

panawel avatar Mar 20 '24 13:03 panawel

Given you've provided the flow, is the app also something publically available? I fancied trying to investigate this, but didn't want to try writing an app that exposed the enabled flag just to get started.

Fishbowler avatar May 28 '24 20:05 Fishbowler