fix selendroid command timeout bug and fix test that proves it work

This commit is contained in:
Jonathan Lipps
2014-04-09 13:13:08 -07:00
parent 0d792be080
commit d566b7583f
2 changed files with 7 additions and 6 deletions

View File

@@ -29,6 +29,11 @@ exports.getGlobalBeforeFilter = function (appium) {
logger.debug("Request received with params: " + JSON.stringify(req.body));
}
if (proxy.shouldProxy(req)) {
if (req.appium.commandTimeout) {
// if we're proxying, we never get into the sessionBeforeFilter,
// so let's make sure to reset the timeout on every request still
req.appium.resetTimeout();
}
if (typeof req.device.translatePath !== "undefined") {
req.device.translatePath(req);
}

View File

@@ -113,7 +113,7 @@ describe('selendroid - basic -', function () {
describe('command timeouts', function () {
var driver;
setup(this, _.defaults({newCommandTimeout: 7}, desired))
setup(this, _.defaults({newCommandTimeout: 3}, desired))
.then(function (d) { driver = d; });
it('should not die if commands come in', function (done) {
@@ -126,11 +126,7 @@ describe('selendroid - basic -', function () {
.then(find);
} else return new Q();
};
find().then(function () {
return driver
.sleep(10000)
.elementByName('Animation').should.be.rejected;
}).nodeify(done);
find().nodeify(done);
});
});