Commit 86b650c0 86b650c085ae25f21912fb047b724d5481301e68 by Nicolas Perriault

added Casper.reload()

1 parent 9910b9dd
...@@ -17,6 +17,7 @@ XXXX-XX-XX, v1.0 ...@@ -17,6 +17,7 @@ XXXX-XX-XX, v1.0
17 - added [`Casper.userAgent()`](http://casperjs.org/api.html#casper.userAgent) to ease a more dynamic setting of user-agent string 17 - added [`Casper.userAgent()`](http://casperjs.org/api.html#casper.userAgent) to ease a more dynamic setting of user-agent string
18 - added [`Tester.assertTitleMatch()`](http://casperjs.org/api.html#tester.assertTitleMatch) method 18 - added [`Tester.assertTitleMatch()`](http://casperjs.org/api.html#tester.assertTitleMatch) method
19 - added [`utils.getPropertyPath()`](http://casperjs.org/api.html#utils.getPropertyPath) 19 - added [`utils.getPropertyPath()`](http://casperjs.org/api.html#utils.getPropertyPath)
20 - added [`Casper.reload()`](http://casperjs.org/api.html#casper.reload)
20 - added experimental support of custom headers sending in outgoing request (refs [#137](https://github.com/n1k0/casperjs/issues/137) - PhantomJS 1.6 required) 21 - added experimental support of custom headers sending in outgoing request (refs [#137](https://github.com/n1k0/casperjs/issues/137) - PhantomJS 1.6 required)
21 - switched to more standard `.textContent` property to get a node text; this allows a better compatibility of the clientutils bookmarklet with non-webkit browsers 22 - switched to more standard `.textContent` property to get a node text; this allows a better compatibility of the clientutils bookmarklet with non-webkit browsers
22 - casper modules now all use [javascript strict mode](http://www.nczonline.net/blog/2012/03/13/its-time-to-start-using-javascript-strict-mode/) 23 - casper modules now all use [javascript strict mode](http://www.nczonline.net/blog/2012/03/13/its-time-to-start-using-javascript-strict-mode/)
......
1 Subproject commit 26b6e8aebd0ddeb877963b3f6e3721883b97fab9 1 Subproject commit dd54a24e01c379ad5b34dfb2ec11323a95a7e25f
......
...@@ -884,6 +884,26 @@ Casper.prototype.open = function open(location, settings) { ...@@ -884,6 +884,26 @@ Casper.prototype.open = function open(location, settings) {
884 }; 884 };
885 885
886 /** 886 /**
887 * Reloads current page.
888 *
889 * @param Function then a next step function
890 * @return Casper
891 */
892 Casper.prototype.reload = function reload(then) {
893 "use strict";
894 if (!this.started) {
895 throw new CasperError("Casper not started, can't reload()");
896 }
897 this.evaluate(function() {
898 window.location.reload();
899 });
900 if (then && utils.isFunction(then)) {
901 this.then(this.createStep(then));
902 }
903 return this;
904 };
905
906 /**
887 * Repeats a step a given number of times. 907 * Repeats a step a given number of times.
888 * 908 *
889 * @param Number times Number of times to repeat step 909 * @param Number times Number of times to repeat step
......