Commit 03cd587d 03cd587d54fc43369a36e2c12843cd34e03572e7 by Maisons du monde

Added a new "thenClick" step to act as "thenOpen" on clicks

1 parent c4b56950
Showing 1 changed file with 15 additions and 0 deletions
......@@ -225,6 +225,21 @@
},
/**
* Adds a new navigation step for clicking on a provided link.
*
* @param String selector A DOM CSS3 compatible selector
* @param function then Next step function to execute on page loaded (optional)
* @return Casper
* @see Casper#open
*/
thenClick: function(selector, fallbackToHref, then) {
this.then(function(self) {
self.click(selector, fallbackToHref);
});
return typeof then === "function" ? this.then(then) : this;
},
/**
* Logs the HTML code of the current page.
*
* @return Casper
......