Commit c3b5e34b c3b5e34b70c1d87073780649f511d2f6ad69bb45 by Nicolas Perriault

closes #157 - added support for PhantomJS 1.6 WebPage#zoomFactor

1 parent 9228e3a2
CasperJS Changelog
==================
XXXX-XX-XX, v0.6.11
-------------------
XXXX-XX-XX, v1.0
----------------
- fixed [#119](https://github.com/n1k0/casperjs/issues/119) - HTTP status wasn't properly caught
- fixed [#132](https://github.com/n1k0/casperjs/issues/132) - added ability to include js/coffee files using a dedicated option when using the [`casper test` command](http://casperjs.org/testing.html)
......@@ -11,6 +11,7 @@ XXXX-XX-XX, v0.6.11
- fixed [#149](https://github.com/n1k0/casperjs/issues/149) - [`ClientUtils.fill()`](http://casperjs.org/api.html#casper.fill) was searching elements globally
- fixed [#154](https://github.com/n1k0/casperjs/issues/154) - firing the `change` event after a field value has been set
- fixed [#144](https://github.com/n1k0/casperjs/issues/144) - added a [`safeLogs` option](http://casperjs.org/api.html#casper.options) to blur password values in debug logs. **This option is set to `true` by default.**
- fixed [#157](https://github.com/n1k0/casperjs/issues/157) - added support for PhantomJS 1.6 `WebPage#zoomFactor`
- fixed failed test messages didn't expose the subject correctly
- added [`Casper.userAgent()`](http://casperjs.org/api.html#casper.userAgent) to ease a more dynamic setting of user-agent string
- added [`Tester.assertTitleMatch()`](http://casperjs.org/api.html#tester.assertTitleMatch) method
......
Subproject commit ca382764f31f490d2e88983e2f0de46fbc2298ec
Subproject commit 26b6e8aebd0ddeb877963b3f6e3721883b97fab9
......
......@@ -1418,6 +1418,28 @@ Casper.prototype.waitWhileVisible = function waitWhileVisible(selector, then, on
};
/**
* Changes the current page zoom factor.
*
* @param Number factor The zoom factor
* @return Casper
*/
Casper.prototype.zoom = function zoom(factor) {
"use strict";
if (!this.started) {
throw new CasperError("Casper has not been started, can't set zoom factor");
}
if (!utils.isNumber(factor) || factor <= 0) {
throw new CasperError("Invalid zoom factor: " + factor);
}
if ('zoomFactor' in this.page) {
this.page.zoomFactor = factor;
} else {
this.warn("zoom() requires PhantomJS >= 1.6");
}
return this;
};
/**
* Extends Casper's prototype with provided one.
*
* @param Object proto Prototype methods to add to Casper
......