2012-11-13 00:23:34 +00:00
|
|
|
describe("Language select and change", function(){
|
|
|
|
//create a new pad before each test run
|
|
|
|
beforeEach(function(cb){
|
|
|
|
helper.newPad(cb);
|
|
|
|
this.timeout(60000);
|
|
|
|
});
|
2012-11-21 18:14:05 +00:00
|
|
|
|
2012-11-13 00:23:34 +00:00
|
|
|
it("makes text german", function(done) {
|
|
|
|
var inner$ = helper.padInner$;
|
|
|
|
var chrome$ = helper.padChrome$;
|
2012-11-21 18:14:05 +00:00
|
|
|
|
2012-11-13 00:23:34 +00:00
|
|
|
//click on the settings button to make settings visible
|
|
|
|
var $settingsButton = chrome$(".buttonicon-settings");
|
|
|
|
$settingsButton.click();
|
2012-11-21 18:14:05 +00:00
|
|
|
|
2012-11-13 00:23:34 +00:00
|
|
|
//click the language button
|
|
|
|
var $language = chrome$("#languagemenu");
|
|
|
|
var $languageoption = $language.find("[value=de]");
|
2012-11-21 18:14:05 +00:00
|
|
|
|
2012-11-13 00:23:34 +00:00
|
|
|
//select german
|
|
|
|
$languageoption.attr('selected','selected');
|
|
|
|
$language.change();
|
2012-11-21 18:14:05 +00:00
|
|
|
|
|
|
|
helper.waitFor(function() { return $language.val() == "de"})
|
2012-11-18 19:11:16 +00:00
|
|
|
.done(function(){
|
2012-11-13 00:23:34 +00:00
|
|
|
//get the value of the bold button
|
|
|
|
var $boldButton = chrome$(".buttonicon-bold").parent();
|
2012-11-21 18:14:05 +00:00
|
|
|
|
2012-11-13 00:23:34 +00:00
|
|
|
//get the title of the bold button
|
|
|
|
var boldButtonTitle = $boldButton[0]["title"];
|
2012-11-21 18:14:05 +00:00
|
|
|
|
2012-11-13 00:23:34 +00:00
|
|
|
//check if the language is now german
|
|
|
|
expect(boldButtonTitle).to.be("Fett (Strg-B)");
|
|
|
|
done();
|
2012-11-18 18:55:13 +00:00
|
|
|
});
|
2012-11-13 00:23:34 +00:00
|
|
|
});
|
2012-11-21 18:14:05 +00:00
|
|
|
|
2012-11-13 00:23:34 +00:00
|
|
|
it("makes text English", function(done) {
|
|
|
|
var inner$ = helper.padInner$;
|
|
|
|
var chrome$ = helper.padChrome$;
|
2012-11-21 18:14:05 +00:00
|
|
|
|
2012-11-13 00:23:34 +00:00
|
|
|
//click on the settings button to make settings visible
|
|
|
|
var $settingsButton = chrome$(".buttonicon-settings");
|
|
|
|
$settingsButton.click();
|
2012-11-21 18:14:05 +00:00
|
|
|
|
2012-11-13 00:23:34 +00:00
|
|
|
//click the language button
|
|
|
|
var $language = chrome$("#languagemenu");
|
|
|
|
var $languageoption = $language.find("[value=en]");
|
2012-11-21 18:14:05 +00:00
|
|
|
|
2012-11-13 00:23:34 +00:00
|
|
|
//select german
|
|
|
|
$languageoption.attr('selected','selected');
|
|
|
|
$language.change();
|
2012-11-21 18:14:05 +00:00
|
|
|
|
|
|
|
helper.waitFor(function() { return $language.val() == "en";})
|
2012-11-18 19:11:16 +00:00
|
|
|
.done(function(){
|
2012-11-21 18:14:05 +00:00
|
|
|
|
2012-11-13 00:23:34 +00:00
|
|
|
//get the value of the bold button
|
|
|
|
var $boldButton = chrome$(".buttonicon-bold").parent();
|
2012-11-21 18:14:05 +00:00
|
|
|
|
2012-11-13 00:23:34 +00:00
|
|
|
//get the title of the bold button
|
|
|
|
var boldButtonTitle = $boldButton[0]["title"];
|
2012-11-21 18:14:05 +00:00
|
|
|
|
2012-11-13 00:23:34 +00:00
|
|
|
//check if the language is now English
|
|
|
|
expect(boldButtonTitle).to.be("Bold (Ctrl-B)");
|
|
|
|
done();
|
2012-11-21 18:14:05 +00:00
|
|
|
|
2012-11-18 18:55:13 +00:00
|
|
|
});
|
2012-11-13 00:23:34 +00:00
|
|
|
});
|
2012-11-21 18:14:05 +00:00
|
|
|
|
|
|
|
});
|