Permalink
Browse files

test hardening

  • Loading branch information...
1 parent 42dc179 commit 0c3bc133bd8bca119018c19a63863c09374a20f5 @jlipps jlipps committed Mar 21, 2013
Showing with 14 additions and 4 deletions.
  1. +14 −4 test/helpers/webview.js
View
@@ -35,7 +35,17 @@ module.exports.loadWebView = function(webviewType, driver, cb) {
handles.length.should.be.above(0);
driver.window(handles[0], function(err) {
should.not.exist(err);
- module.exports.spinTitle(title, driver, cb);
+ driver.url(function(err, url) {
+ should.not.exist(err);
+ if (url != guinea) {
+ driver.get(guinea, function(err) {
+ should.not.exist(err);
+ module.exports.spinTitle(title, driver, cb);
+ });
+ } else {
+ module.exports.spinTitle(title, driver, cb);
+ }
+ });
});
});
}
@@ -322,7 +332,7 @@ module.exports.buildTests = function(webviewType) {
el.getLocation(function(err, loc) {
should.not.exist(err);
loc.x.should.equal(10);
- loc.y.should.equal(480);
+ [480, 387].should.include(loc.y);
done();
});
});
@@ -353,8 +363,8 @@ module.exports.buildTests = function(webviewType) {
loadWebView(h.driver, function() {
h.driver.getWindowSize(function(err, size) {
should.not.exist(err);
- // iphone and ipad
- [356, 928, 788].should.include(size.height);
+ // iphone and ipad, webview.app and mobile safari
+ [356, 928, 788, 752].should.include(size.height);
[320, 768, 414].should.include(size.width);
done();
});

0 comments on commit 0c3bc13

Please sign in to comment.