From c02d9b4a6e1d73c44e9304f7f934798134dc942c Mon Sep 17 00:00:00 2001 From: Clement Michaud Date: Sat, 14 Oct 2017 15:16:14 +0200 Subject: [PATCH] Display current URL when redirection step fails in integration tests --- test/features/support/world.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/features/support/world.ts b/test/features/support/world.ts index e3302fda..2bed9556 100644 --- a/test/features/support/world.ts +++ b/test/features/support/world.ts @@ -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) {