closes #157 - added support for PhantomJS 1.6 WebPage#zoomFactor
Showing
3 changed files
with
26 additions
and
3 deletions
1 | CasperJS Changelog | 1 | CasperJS Changelog |
2 | ================== | 2 | ================== |
3 | 3 | ||
4 | XXXX-XX-XX, v0.6.11 | 4 | XXXX-XX-XX, v1.0 |
5 | ------------------- | 5 | ---------------- |
6 | 6 | ||
7 | - fixed [#119](https://github.com/n1k0/casperjs/issues/119) - HTTP status wasn't properly caught | 7 | - fixed [#119](https://github.com/n1k0/casperjs/issues/119) - HTTP status wasn't properly caught |
8 | - 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) | 8 | - 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 | ... | @@ -11,6 +11,7 @@ XXXX-XX-XX, v0.6.11 |
11 | - fixed [#149](https://github.com/n1k0/casperjs/issues/149) - [`ClientUtils.fill()`](http://casperjs.org/api.html#casper.fill) was searching elements globally | 11 | - fixed [#149](https://github.com/n1k0/casperjs/issues/149) - [`ClientUtils.fill()`](http://casperjs.org/api.html#casper.fill) was searching elements globally |
12 | - fixed [#154](https://github.com/n1k0/casperjs/issues/154) - firing the `change` event after a field value has been set | 12 | - fixed [#154](https://github.com/n1k0/casperjs/issues/154) - firing the `change` event after a field value has been set |
13 | - 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.** | 13 | - 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.** |
14 | - fixed [#157](https://github.com/n1k0/casperjs/issues/157) - added support for PhantomJS 1.6 `WebPage#zoomFactor` | ||
14 | - fixed failed test messages didn't expose the subject correctly | 15 | - fixed failed test messages didn't expose the subject correctly |
15 | - added [`Casper.userAgent()`](http://casperjs.org/api.html#casper.userAgent) to ease a more dynamic setting of user-agent string | 16 | - added [`Casper.userAgent()`](http://casperjs.org/api.html#casper.userAgent) to ease a more dynamic setting of user-agent string |
16 | - added [`Tester.assertTitleMatch()`](http://casperjs.org/api.html#tester.assertTitleMatch) method | 17 | - added [`Tester.assertTitleMatch()`](http://casperjs.org/api.html#tester.assertTitleMatch) method | ... | ... |
... | @@ -1418,6 +1418,28 @@ Casper.prototype.waitWhileVisible = function waitWhileVisible(selector, then, on | ... | @@ -1418,6 +1418,28 @@ Casper.prototype.waitWhileVisible = function waitWhileVisible(selector, then, on |
1418 | }; | 1418 | }; |
1419 | 1419 | ||
1420 | /** | 1420 | /** |
1421 | * Changes the current page zoom factor. | ||
1422 | * | ||
1423 | * @param Number factor The zoom factor | ||
1424 | * @return Casper | ||
1425 | */ | ||
1426 | Casper.prototype.zoom = function zoom(factor) { | ||
1427 | "use strict"; | ||
1428 | if (!this.started) { | ||
1429 | throw new CasperError("Casper has not been started, can't set zoom factor"); | ||
1430 | } | ||
1431 | if (!utils.isNumber(factor) || factor <= 0) { | ||
1432 | throw new CasperError("Invalid zoom factor: " + factor); | ||
1433 | } | ||
1434 | if ('zoomFactor' in this.page) { | ||
1435 | this.page.zoomFactor = factor; | ||
1436 | } else { | ||
1437 | this.warn("zoom() requires PhantomJS >= 1.6"); | ||
1438 | } | ||
1439 | return this; | ||
1440 | }; | ||
1441 | |||
1442 | /** | ||
1421 | * Extends Casper's prototype with provided one. | 1443 | * Extends Casper's prototype with provided one. |
1422 | * | 1444 | * |
1423 | * @param Object proto Prototype methods to add to Casper | 1445 | * @param Object proto Prototype methods to add to Casper | ... | ... |
-
Please register or sign in to post a comment