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

Fix timeout unit in ScrollUntilVisibleCommand #2112

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

vibin
Copy link

@vibin vibin commented Oct 23, 2024

Proposed changes

The timeout in ScrollUntilVisibleCommand should be interpreted as milliseconds: https://maestro.mobile.dev/api-reference/commands/scrolluntilvisible

This was broken by #2023.

Testing

Updated and ran tests

Issues fixed

Fixes #2108

The `timeout` in ScrollUntilVisibleCommand should be interpreted as milliseconds: https://maestro.mobile.dev/api-reference/commands/scrolluntilvisible

Fixes mobile-dev-inc#2108.
This was broken by mobile-dev-inc#2023.
@Fishbowler
Copy link
Contributor

Fishbowler commented Oct 25, 2024

Works for me.

I ran this on main and on this branch:

appId: com.example.example
name: 'Test scrollUntilVisible timeout (#2108)'
---
- launchApp
- evalScript: ${maestro.startTime = new Date()}
- scrollUntilVisible:
    element: 'NON-EXISTENT'
    timeout: 1000
    optional: true
- evalScript: ${maestro.endTime = new Date()}
- evalScript: ${console.log(maestro.endTime - maestro.startTime)}
- assertTrue: ${maestro.endTime - maestro.startTime < 5000} # Far less than the 20000 default, but enough to allow for processing time

On main, you don't get past the scrollUntilVisible.
On this branch, it passes.

@Fishbowler
Copy link
Contributor

Hey @vibin - I don't suppose you'd mind adding this as e2e/workspaces/demo_app/scrollUntilVisible_timeout.yaml ?

@Fishbowler Fishbowler added bug Something isn't working maestro cli Related to the command-line Maestro tool labels Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working maestro cli Related to the command-line Maestro tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timeout not working in scrollUntilVisible
2 participants