Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
* [setAirplaneMode](api-reference/commands/setairplanemode.md)
* [setLocation](api-reference/commands/setlocation.md)
* [setOrientation](api-reference/commands/setorientation.md)
* [sleep](api-reference/commands/sleep.md)
* [startRecording](api-reference/commands/startrecording.md)
* [stopApp](api-reference/commands/stopapp.md)
* [stopRecording](api-reference/commands/stoprecording.md)
Expand Down
14 changes: 14 additions & 0 deletions api-reference/commands/sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# sleep

`sleep` pauses the flow execution for a specified duration.

```yaml
- sleep: 100 # Sleeps for 100ms (default unit is ms)
- sleep: 1000ms # Sleeps for 1000ms
- sleep: 1s # Sleeps for 1 second
- sleep:
time: 2000
label: Pause for two seconds
```

Note: This command shouldn't be necessary in most situations. Use [assertVisible](./assertvisible.md) or [extendedWaitUntil](./extendedwaituntil.md) to wait for something to appear. This command should be used in situations where an external system is performing a task that you cannot see the effect of (e.g. server-side transaction processing), or a splash animation that cannot be represented in the Maestro hierarchy that needs to be awaited.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rasyid7 Are you happy with this edit I've made?

2 changes: 2 additions & 0 deletions api-reference/commands/waitforanimationtoend.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ Can have an optional timeout (in milliseconds) after which, if the animation is
- waitForAnimationToEnd:
timeout: 5000
```

If you're looking to add a fixed delay, use [sleep](./sleep.md) instead.