Skip to content

Commit

Permalink
fix selendroid command timeout bug and fix test that proves it work
Browse files Browse the repository at this point in the history
  • Loading branch information
jlipps committed Apr 9, 2014
1 parent 0d792be commit d566b75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 5 additions & 0 deletions lib/server/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
8 changes: 2 additions & 6 deletions test/functional/selendroid/basic-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
});
});

Expand Down

0 comments on commit d566b75

Please sign in to comment.