From 2cab588d06ec710bd80095835f6eaf0fe0a86fa6 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Wed, 20 Apr 2016 20:37:48 +0200 Subject: [PATCH] Remove the request to SauceLab's broken rest API which seems to explode when you hit it while a job is ongoing --- TestSelenium.js | 37 +++++++------------------------------ 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/TestSelenium.js b/TestSelenium.js index 85a0575f5..2195e9ce6 100644 --- a/TestSelenium.js +++ b/TestSelenium.js @@ -1,6 +1,5 @@ /* global process */ var WebDriver = require("selenium-webdriver"); -var Https = require("https"); var driver; if (process.env.SAUCE_USERNAME !== undefined) { @@ -17,37 +16,15 @@ if (process.env.SAUCE_USERNAME !== undefined) { driver = new WebDriver.Builder().withCapabilities({ browserName: "chrome" }).build(); } -var logSauceLink = function (cb) { - Https.request("https://saucelabs.com/rest/v1.1/" + process.env.SAUCE_USERNAME + - "/jobs?auto_only=true&full=true&limit=50&subaccounts=true", function (resp) { - var str = ''; - resp.on('data', function (chunk) { str += chunk; }); - resp.on('end', function () { - JSON.parse(str).jobs.forEach(function (j) { - var banner = new Array(80).join('='); - if (j.build === process.env.TRAVIS_JOB_NUMBER) { - console.log("\n\n\n" + banner); - console.log("SauceLabs Link: " + j.video_url.replace(/\/video\.flv$/), ''); - console.log(banner + "\n\n\n"); - } - }); - console.log(str); - cb(); - }); - }); -}; - 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(); - logSauceLink(function () { - 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"); - } - }); + 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"); + } });