From 512c1b12f4f35771d091c0b60fd3fed982ba77cf Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Thu, 12 Jan 2017 12:03:14 +0100 Subject: [PATCH] Make the selenium test log the content of the /assert report to the console --- TestSelenium.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/TestSelenium.js b/TestSelenium.js index 2195e9ce6..330e62d2e 100644 --- a/TestSelenium.js +++ b/TestSelenium.js @@ -19,12 +19,15 @@ if (process.env.SAUCE_USERNAME !== undefined) { driver.get('http://localhost:3000/assert/'); var report = driver.wait(WebDriver.until.elementLocated(WebDriver.By.className("report")), 5000); report.getAttribute("class").then(function (cls) { - driver.quit(); - if (!cls) { - throw new Error("cls is null"); - } else if (cls.indexOf("failure") !== -1) { - throw new Error("cls contains the word failure"); - } else if (cls.indexOf("success") === -1) { - throw new Error("cls does not contain the word success"); - } + report.getText().then(function (text) { + console.log("\n-----\n" + text + "\n-----"); + driver.quit(); + if (!cls) { + throw new Error("cls is null"); + } else if (cls.indexOf("failure") !== -1) { + throw new Error("cls contains the word failure"); + } else if (cls.indexOf("success") === -1) { + throw new Error("cls does not contain the word success"); + } + }); });