.isPortrait()
Returns whether the device is in a portrait or landscape orientation.
Usage
device.isPortrait()
Returns
Promise (Boolean): A promise that resolves with the orientation status.
Support
| Platform | Supported |
|---|---|
| iOS | Yes |
| Android | Yes |
| Web | Unknown |
Examples
Check if the device is in a portrait orientation:
const { device, expect } = require("appdriver");
(async () => {
const portrait = await device.isPortrait();
return expect(portrait).toBeTruthy();
})();