Merge pull request #2272 from prtksxna/lang-tests

Update frontend language tests for new keyboard shortcut convention
pull/2276/head^2
John McLear 2014-10-14 14:17:49 +01:00
commit 8c1868f0e9
1 changed files with 22 additions and 22 deletions

View File

@ -11,31 +11,31 @@ describe("Language select and change", function(){
helper.newPad(cb); helper.newPad(cb);
this.timeout(60000); this.timeout(60000);
}); });
// Destroy language cookies // Destroy language cookies
it("makes text german", function(done) { it("makes text german", function(done) {
var inner$ = helper.padInner$; var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$; var chrome$ = helper.padChrome$;
//click on the settings button to make settings visible //click on the settings button to make settings visible
var $settingsButton = chrome$(".buttonicon-settings"); var $settingsButton = chrome$(".buttonicon-settings");
$settingsButton.click(); $settingsButton.click();
//click the language button //click the language button
var $language = chrome$("#languagemenu"); var $language = chrome$("#languagemenu");
var $languageoption = $language.find("[value=de]"); var $languageoption = $language.find("[value=de]");
//select german //select german
$languageoption.attr('selected','selected'); $languageoption.attr('selected','selected');
$language.change(); $language.change();
helper.waitFor(function() { helper.waitFor(function() {
return chrome$(".buttonicon-bold").parent()[0]["title"] == "Fett (Strg-B)"; return chrome$(".buttonicon-bold").parent()[0]["title"] == "Fett (Strg-B)";
}) })
.done(function(){ .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();
//get the title of the bold button //get the title of the bold button
var boldButtonTitle = $boldButton[0]["title"]; var boldButtonTitle = $boldButton[0]["title"];
@ -44,58 +44,58 @@ describe("Language select and change", function(){
done(); done();
}); });
}); });
it("makes text English", function(done) { it("makes text English", function(done) {
var inner$ = helper.padInner$; var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$; var chrome$ = helper.padChrome$;
//click on the settings button to make settings visible //click on the settings button to make settings visible
var $settingsButton = chrome$(".buttonicon-settings"); var $settingsButton = chrome$(".buttonicon-settings");
$settingsButton.click(); $settingsButton.click();
//click the language button //click the language button
var $language = chrome$("#languagemenu"); var $language = chrome$("#languagemenu");
//select english //select english
$language.val("en"); $language.val("en");
$language.change(); $language.change();
//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();
helper.waitFor(function() { return $boldButton[0]["title"] != "Fett (Strg-B)";}) helper.waitFor(function() { return $boldButton[0]["title"] != "Fett (Strg+B)";})
.done(function(){ .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();
//get the title of the bold button //get the title of the bold button
var boldButtonTitle = $boldButton[0]["title"]; var boldButtonTitle = $boldButton[0]["title"];
//check if the language is now English //check if the language is now English
expect(boldButtonTitle).to.be("Bold (Ctrl-B)"); expect(boldButtonTitle).to.be("Bold (Ctrl+B)");
done(); done();
}); });
}); });
it("changes direction when picking an rtl lang", function(done) { it("changes direction when picking an rtl lang", function(done) {
var inner$ = helper.padInner$; var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$; var chrome$ = helper.padChrome$;
//click on the settings button to make settings visible //click on the settings button to make settings visible
var $settingsButton = chrome$(".buttonicon-settings"); var $settingsButton = chrome$(".buttonicon-settings");
$settingsButton.click(); $settingsButton.click();
//click the language button //click the language button
var $language = chrome$("#languagemenu"); var $language = chrome$("#languagemenu");
var $languageoption = $language.find("[value=ar]"); var $languageoption = $language.find("[value=ar]");
//select arabic //select arabic
// $languageoption.attr('selected','selected'); // Breaks the test.. // $languageoption.attr('selected','selected'); // Breaks the test..
$language.val("ar"); $language.val("ar");
$languageoption.change(); $languageoption.change();
helper.waitFor(function() { helper.waitFor(function() {
return chrome$("html")[0]["dir"] != 'ltr'; return chrome$("html")[0]["dir"] != 'ltr';
}) })
.done(function(){ .done(function(){