Not built-in, but you can write your own quite easily:
casper.waitForUrlChange = function(then, onTimeout, timeout){
var oldUrl;
this.then(function(){
oldUrl = this.getCurrentUrl();
}).waitFor(function check(){
return oldUrl === this.getCurrentUrl();
}, then, onTimeout, timeout);
return this;
};
This is the correct extension of the function because it has the same semantics as other functions wait*(the arguments are optional, and it waits), and it supports the builder pattern (also called the promise pattern by some).
, , , waitForUrlChange CasperJS , CasperJS API
if (!casper.waitForUrlChange) {
casper.waitForUrlChange = function(){
var oldUrl;
Array.prototype.unshift.call(arguments, function check(){
return oldUrl === this.getCurrentUrl();
});
this.then(function(){
oldUrl = this.getCurrentUrl();
});
this.waitFor.apply(this, arguments);
return this;
};
}