.setGeolocation() 建議編輯
設定行動裝置目前的地理位置。
用法
.appium.setGeolocation({latitude, longitude, altitude}, [callback])
範例
module.exports = {
'set geolocation to Tokyo, Japan': function (app) {
app
.appium.setGeolocation({latitude: 35.689487, longitude: 139.691706, altitude: 5});
},
'set geolocation to Tokyo, Japan with ES6 async/await': async function (app) {
await app.appium.setGeolocation({latitude: 35.689487, longitude: 139.691706});
}
};
參數
名稱 | 類型 | 描述 |
---|---|---|
coordinates 選填 |
物件 |
|
callback 選填 |
函式 | 選填的回呼函式,在命令完成時呼叫。 |