mirror of
https://github.com/appium/appium.git
synced 2026-05-04 01:11:11 -05:00
32 lines
1011 B
JavaScript
32 lines
1011 B
JavaScript
"use strict";
|
|
|
|
var setup = require("../../common/setup-base")
|
|
, desired = require("./desired");
|
|
|
|
var desired = {
|
|
app: 'sample-code/apps/gps-demo/bin/GPSTutorial1.apk'
|
|
};
|
|
|
|
// TODO: bring back when new wd is published with setGeoLocation
|
|
describe("apidemo - location", function () {
|
|
var driver;
|
|
setup(this, desired).then(function (d) { driver = d; });
|
|
|
|
it('should set geo location', function (done) {
|
|
var getText = function () { return driver.elementByXPath("//android.widget.TextView[2]").text(); };
|
|
var newLat = "27.17";
|
|
var newLong = "78.04";
|
|
driver
|
|
.resolve(getText()).then(function (text) {
|
|
text.should.not.include("Latitude: " + newLat);
|
|
text.should.not.include("Longitude: " + newLong);
|
|
})
|
|
.setGeoLocation(newLat, newLong)
|
|
.sleep(1000).then(getText).then(function (text) {
|
|
text.should.include("Latitude: " + newLat.substr(0, 4));
|
|
text.should.include("Longitude: " + newLong.substr(0, 4));
|
|
}).nodeify(done);
|
|
});
|
|
});
|
|
|