allow capturing logcat for selendroid

This commit is contained in:
Jonathan Lipps
2013-08-13 15:50:06 -07:00
parent c086845b7f
commit 7bd555bea3
5 changed files with 78 additions and 46 deletions
+37 -19
View File
@@ -9,26 +9,44 @@ var path = require('path')
, describeWd = driverBlock.describeForApp(appPath, "selendroid", appPkg, appAct)
, should = require('should');
describeWd('basic', function(h) {
it('should find and click an element', function(done) {
// selendroid appears to have some issues with implicit waits
// hence the timeouts
setTimeout(function() {
h.driver.elementByName('App', function(err, el) {
describeWd('basic', function(h) {
it('should find and click an element', function(done) {
// selendroid appears to have some issues with implicit waits
// hence the timeouts
setTimeout(function() {
h.driver.elementByName('App', function(err, el) {
should.not.exist(err);
should.exist(el);
el.click(function(err) {
should.not.exist(err);
should.exist(el);
el.click(function(err) {
should.not.exist(err);
setTimeout(function() {
h.driver.elementByLinkText("Action Bar", function(err, el) {
should.not.exist(err);
should.exist(el);
done();
});
}, 1000);
});
setTimeout(function() {
h.driver.elementByLinkText("Action Bar", function(err, el) {
should.not.exist(err);
should.exist(el);
done();
});
}, 1000);
});
}, 1000);
});
});
}, 1000);
});
it('should be able to get logcat log type', function(done) {
h.driver.logTypes(function(err, logTypes) {
should.not.exist(err);
logTypes.should.include('logcat');
done();
});
});
it('should be able to get logcat logs', function(done) {
h.driver.log('logcat', 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();
});
});
});