Skip to content

Commit

Permalink
add tests for appium#1413, also fix jsonwp misinterpretation
Browse files Browse the repository at this point in the history
logTypes should return array of types, not array of objects
cc @ecomrobotics
  • Loading branch information
jlipps committed Nov 5, 2013
1 parent 6137e13 commit 199d7e4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/devices/android/android-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ androidController.getLog = function(logType, cb) {
androidController.getLogTypes = function(cb) {
return cb(null, {
status: status.codes.Success.code
, value: logTypesSupported
, value: _.keys(logTypesSupported)
});
};

Expand Down
2 changes: 1 addition & 1 deletion lib/devices/ios/ios-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,7 @@ iOSController.getCurrentActivity= function(cb) {
iOSController.getLogTypes = function(cb) {
return cb(null, {
status: status.codes.Success.code
, value: logTypesSupported
, value: _.keys(logTypesSupported)
});
};

Expand Down
19 changes: 19 additions & 0 deletions test/functional/testapp/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,23 @@ describeWd('calc app', function(h) {
done();
});
});

it('should be able to get syslog log type', function(done) {
h.driver.logTypes(function(err, logTypes) {
should.not.exist(err);
logTypes.should.include('syslog');
logTypes.should.not.include('logcat');
done();
});
});
it('should be able to get syslog logs', function(done) {
h.driver.log('syslog', function(err, logs) {
should.not.exist(err);
logs.length.should.be.above(0);
logs[0].message.should.not.include("\n");
logs[0].level.should.equal("ALL");
should.exist(logs[0].timestamp);
done();
});
});
});

0 comments on commit 199d7e4

Please sign in to comment.