From 364e6928b566f5a1c1384a9e0c8ef0d95fdf43f5 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 17 Nov 2012 16:28:54 +0100 Subject: [PATCH 1/2] Make tests work on windows --- src/node/hooks/express/tests.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/node/hooks/express/tests.js b/src/node/hooks/express/tests.js index 7921da5af..94cd5fb62 100644 --- a/src/node/hooks/express/tests.js +++ b/src/node/hooks/express/tests.js @@ -1,5 +1,6 @@ -var path = require("path"); -var fs = require("fs"); +var path = require("path") + , npm = require("npm") + , fs = require("fs"); exports.expressCreateServer = function (hook_name, args, cb) { args.app.get('/tests/frontend/specs_list.js', function(req, res){ @@ -17,7 +18,7 @@ exports.expressCreateServer = function (hook_name, args, cb) { } subPath = subPath.split("?")[0]; - var filePath = path.normalize(__dirname + "/../../../../tests/frontend/") + var filePath = path.normalize(npm.root + "/../tests/frontend/") filePath += subPath.replace("..", ""); return filePath; } From ff0c9bb4a0c3c814c5f6373a38025b22fab26414 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 17 Nov 2012 16:29:11 +0100 Subject: [PATCH 2/2] Make language frontend test pass --- tests/frontend/specs/language.js | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/tests/frontend/specs/language.js b/tests/frontend/specs/language.js index 254493c46..377e4a7f8 100644 --- a/tests/frontend/specs/language.js +++ b/tests/frontend/specs/language.js @@ -21,13 +21,7 @@ describe("Language select and change", function(){ $languageoption.attr('selected','selected'); $language.change(); - helper.waitFor(function(){ - - var $boldButton = chrome$(".buttonicon-bold").parent(); - //get the title of the bold button - var boldButtonTitle = $boldButton[0]["title"]; - return boldButtonTitle !== undefined; - }).done(function(){ + setTimeout(function(){ //get the value of the bold button var $boldButton = chrome$(".buttonicon-bold").parent(); @@ -39,7 +33,7 @@ describe("Language select and change", function(){ expect(boldButtonTitle).to.be("Fett (Strg-B)"); done(); - }); + }, 1000); }); it("makes text English", function(done) { @@ -58,13 +52,7 @@ describe("Language select and change", function(){ $languageoption.attr('selected','selected'); $language.change(); - helper.waitFor(function(){ - - var $boldButton = chrome$(".buttonicon-bold").parent(); - //get the title of the bold button - var boldButtonTitle = $boldButton[0]["title"]; - return boldButtonTitle !== undefined; - }).done(function(){ + setTimeout(function(){ //get the value of the bold button var $boldButton = chrome$(".buttonicon-bold").parent(); @@ -76,7 +64,7 @@ describe("Language select and change", function(){ expect(boldButtonTitle).to.be("Bold (Ctrl-B)"); done(); - }); + }, 1000); }); });