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

https://github.com/mobile-dev-inc/maestro/pull/2117 #97

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions api-reference/commands/swipe.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,39 @@ Relative start and end coordinates for directional swipe are configured as follo

A common use case for this is to swipe the onboarding pages.

##### Precision with `to:`

You can also use `to:`, allowing a directional swipe to become more precise (such as moving a date/time picker wheel by a single minute):

```yaml
# change minutes picker ahead 1m
- swipe:
from:
id: "one-off-minutes"
to: 0%, 73%

# if at end of picker, change hours picker ahead 1 and move minutes back to beginning of hour
- runFlow:
when:
visible:
id: "one-off-minutes-59"
commands:
- swipe:
from:
id: "one-off-hours"
to: 0%, 73%
- repeat:
while:
notVisible:
id: "one-off-minutes-00"
commands:
- swipe:
from:
id: "one-off-minutes"
to: 0%, 100%
duration: 1
```

#### **Swiping elements**

You can also specify elements as a starting point for swipe commands. It will swipe from the middle of the element in the direction you specify. Example:
Expand Down