add test to prove screenshots doesn't crash other commands

This commit is contained in:
Jonathan Lipps
2013-06-04 12:52:20 -07:00
parent 6cf2b09ac2
commit d8c3e772ef

View File

@@ -10,7 +10,7 @@ var path = require('path')
, should = require('should');
describeWd('get source', function(h) {
return it('should return the page source', function(done) {
it('should return the page source', function(done) {
h.driver.source(function(err, source){
var obj = JSON.parse(source);
should.not.exist(err);
@@ -20,4 +20,20 @@ describeWd('get source', function(h) {
done();
});
});
it('should return the page source without crashing other commands', function(done) {
h.driver.execute("mobile: find", [[[[7, "Animation"]]]], function(err, el) {
should.not.exist(err);
h.driver.source(function(err, source){
var obj = JSON.parse(source);
should.not.exist(err);
should.ok(obj);
obj.hierarchy.node['@class'].should.equal("android.widget.FrameLayout");
obj.hierarchy.node.node.node[0].node['@class'].should.equal("android.view.View");
h.driver.execute("mobile: find", [[[[7, "Animation"]]]], function(err, el) {
should.not.exist(err);
done();
});
});
});
});
});