Get the current device orientation.

Usage

                    .appium.getOrientation([callback])
                

Example

module.exports = {
  'get current device orientation': function (app) {
    app
      .appium.getOrientation(function (result) {
        console.log('current device orientation is:', result.value);
      });
  },

  'get current device orientation with ES6 async/await': async function (app) {
    const orientation = await app.appium.getOrientation();
    console.log('current device orientation is:', orientation);
  }
};

Parameters

Name Type description
callback function

Callback function which is called with the result value.

Returns

Type description
string

The current device orientation: LANDSCAPE or PORTRAIT.

See also