Commit 52a67cb5 52a67cb5a21b03c05870755c276be80777c931e0 by Nicolas Perriault

fixed no error was raised if Casper.viewport() was called before casper having been started

1 parent 063ddf76
......@@ -881,6 +881,9 @@
* @return Casper
*/
viewport: function(width, height) {
if (!this.started) {
throw new Error("Casper must be started in order to set viewport at runtime");
}
if (!isType(width, "number") || !isType(height, "number") || width <= 0 || height <= 0) {
throw new Error("Invalid viewport width/height set: " + width + 'x' + height);
}
......