Skip to content

Commit

Permalink
Publish docs version 20.x
Browse files Browse the repository at this point in the history
  • Loading branch information
mobileoss committed Nov 14, 2024
1 parent c97e583 commit a89a282
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions website/versioned_docs/version-20.x/api/device.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,51 @@ if (device.getPlatform() === 'ios') {
}
```
### `device.tap(point, shouldIgnoreStatusBar)`
Perform a tap at arbitrary coordinates on the device's screen.
#### tap parameters
- `point` — Coordinates in the element's coordinate space (default value: `{x: 100, y: 100}`, platforms: Android & IOS) <br/>
- `shouldIgnoreStatusBar` — Coordinates will be measured starting from under the status bar (default value: `true`, platform: Android) <br/>
#### tap examples
```js

await device.tap();
await device.tap({ x: 100, y: 150 }, false);
await device.tap({ x: 100, y: 150 });
await device.tap(false);

```
### `device.longPress(point, duration, shouldIgnoreStatusBar)`
Perform a long press at arbitrary coordinates on the device's screen. Custom press duration if needed.
#### longPress parameters
- `point` — Coordinates in the element's coordinate space (default value: `{x: 100, y: 100}`, platforms: Android & IOS) <br/>
- `duration` — Custom press duration time, in milliseconds. (default values: Android: Standard long-press duration. IOS: 1000 milliseconds, platforms: Android & IOS) <br/>
- `shouldIgnoreStatusBar` — Coordinates will be measured starting from under the status bar (default value: `true`, platform: Android) <br/>
#### longPress examples
```js

await device.longPress();
await device.longPress({ x: 100, y: 150 }, 2000, false);
await device.longPress({ x: 100, y: 150 }, 2000);
await device.longPress(2000, false);
await device.longPress({ x: 100, y: 150 }, false);
await device.longPress({ x: 100, y: 150 });
await device.longPress(2000);
await device.longPress(false);

```
### `device.takeScreenshot([name])`
Takes a screenshot of the device. For full details on taking screenshots with Detox, refer to the [screen-shots guide](../guide/taking-screenshots.md).
Expand Down

0 comments on commit a89a282

Please sign in to comment.