現在のデバイスの向きを取得します。

使用方法

                    .appium.getOrientation([callback])
                

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);
  }
};

パラメータ

名前 説明
callback 関数

結果値とともに呼び出されるコールバック関数。

戻り値

説明
文字列

現在のデバイスの向き: `LANDSCAPE` または `PORTRAIT`。

参照