Display current URL when redirection step fails in integration tests

This commit is contained in:
Clement Michaud 2017-10-14 15:16:14 +02:00
parent 8cf58d7b31
commit c02d9b4a6e

View File

@ -56,7 +56,15 @@ function CustomWorld() {
};
this.waitUntilUrlContains = function(url: string) {
return this.driver.wait(seleniumWebdriver.until.urlIs(url), 15000);
const that = this;
return this.driver.wait(seleniumWebdriver.until.urlIs(url), 15000)
.then(function() {}, function(err: Error) {
that.driver.getCurrentUrl()
.then(function(current: string) {
console.error("====> Error due to: %s (current) != %s (expected)", current, url);
});
return BluebirdPromise.reject(err);
});
};
this.loginWithUserPassword = function (username: string, password: string) {