Skip to content

Commit

Permalink
make this scrollTo test work on canonical test device
Browse files Browse the repository at this point in the history
  • Loading branch information
jlipps authored and AmitKumar5 committed Jul 23, 2013
1 parent 3bdd3dc commit 3268384
Showing 1 changed file with 13 additions and 24 deletions.
37 changes: 13 additions & 24 deletions test/functional/apidemos/gestures.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,34 +119,23 @@ describeWd('gestures', function(h) {
});
});
});

describeWd('scroll to element', function(h) {
it('should bring the element into view', function(done) {
h.driver.elementsByTagName('textView', function(err, els) {
should.not.exist(err);
var el = els[els.length-1];
el.click(function(err) {
h.driver.elementByName("Views", function(err) {
should.exist(err);
h.driver.elementByTagName("listView", function(err, el) {
should.not.exist(err);
h.driver.elementByTagName('listView', function(err, el) {
var scrollOpts = {
element: el.value
, text: 'Views'
};
h.driver.execute("mobile: scrollTo", [scrollOpts], function(err) {
should.not.exist(err);
var scrollOpts = {
element: el.value
, text: 'Switches'
};
var next = function() {
h.driver.execute("mobile: scrollTo", [scrollOpts], function(err) {
should.not.exist(err);
h.driver.elementByName('Switches', function(err, el) {
should.not.exist(err);
el.getAttribute('name', function(err, text) {
should.not.exist(err);
text.should.equal("Switches");
done();
});
});
});
};
setTimeout(next, 3000);
h.driver.elementByName("Views", function(err) {
should.not.exist(err);
done();
});
});
});
});
Expand Down

0 comments on commit 3268384

Please sign in to comment.