.getGeolocation() 編集を提案
モバイルデバイスの現在の位置情報を取得します。
使用方法
.appium.getGeolocation([callback])
例
module.exports = {
'get device geolocation': function (app) {
app
.appium.getGeolocation(function (result) {
console.log('current device geolocation is:', result.value);
});
},
'get device geolocation with ES6 async/await': async function (app) {
const location = await app.appium.getGeolocation();
console.log('current device geolocation is:', location);
}
};
パラメータ
名前 | 型 | 説明 |
---|---|---|
callback オプション |
関数 | 結果値とともに呼び出されるコールバック関数。 |
戻り値
型 | 説明 |
---|---|
オブジェクト | 現在の位置情報: |