mirror of
https://github.com/appium/appium.git
synced 2026-02-15 06:20:22 -06:00
add test to prove screenshots doesn't crash other commands
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user