Merge pull request #1178 from marcelklehr/fix/tests

Fix/tests
This commit is contained in:
John McLear 2012-11-17 07:31:03 -08:00
commit 73eafb92c2
2 changed files with 8 additions and 19 deletions

View file

@ -1,5 +1,6 @@
var path = require("path"); var path = require("path")
var fs = require("fs"); , npm = require("npm")
, fs = require("fs");
exports.expressCreateServer = function (hook_name, args, cb) { exports.expressCreateServer = function (hook_name, args, cb) {
args.app.get('/tests/frontend/specs_list.js', function(req, res){ 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]; subPath = subPath.split("?")[0];
var filePath = path.normalize(__dirname + "/../../../../tests/frontend/") var filePath = path.normalize(npm.root + "/../tests/frontend/")
filePath += subPath.replace("..", ""); filePath += subPath.replace("..", "");
return filePath; return filePath;
} }

View file

@ -21,13 +21,7 @@ describe("Language select and change", function(){
$languageoption.attr('selected','selected'); $languageoption.attr('selected','selected');
$language.change(); $language.change();
helper.waitFor(function(){ setTimeout(function(){
var $boldButton = chrome$(".buttonicon-bold").parent();
//get the title of the bold button
var boldButtonTitle = $boldButton[0]["title"];
return boldButtonTitle !== undefined;
}).done(function(){
//get the value of the bold button //get the value of the bold button
var $boldButton = chrome$(".buttonicon-bold").parent(); var $boldButton = chrome$(".buttonicon-bold").parent();
@ -39,7 +33,7 @@ describe("Language select and change", function(){
expect(boldButtonTitle).to.be("Fett (Strg-B)"); expect(boldButtonTitle).to.be("Fett (Strg-B)");
done(); done();
}); }, 1000);
}); });
it("makes text English", function(done) { it("makes text English", function(done) {
@ -58,13 +52,7 @@ describe("Language select and change", function(){
$languageoption.attr('selected','selected'); $languageoption.attr('selected','selected');
$language.change(); $language.change();
helper.waitFor(function(){ setTimeout(function(){
var $boldButton = chrome$(".buttonicon-bold").parent();
//get the title of the bold button
var boldButtonTitle = $boldButton[0]["title"];
return boldButtonTitle !== undefined;
}).done(function(){
//get the value of the bold button //get the value of the bold button
var $boldButton = chrome$(".buttonicon-bold").parent(); var $boldButton = chrome$(".buttonicon-bold").parent();
@ -76,7 +64,7 @@ describe("Language select and change", function(){
expect(boldButtonTitle).to.be("Bold (Ctrl-B)"); expect(boldButtonTitle).to.be("Bold (Ctrl-B)");
done(); done();
}); }, 1000);
}); });
}); });