Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
panawel opened this issue Mar 20, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@panawel
Copy link

panawel commented Mar 20, 2024

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 panawel added the bug Something isn't working label Mar 20, 2024
@Fishbowler
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants