intl change locale tested

This commit is contained in:
Peter Cottle 2015-03-23 20:30:41 -07:00
parent adbe798b25
commit d45651aad2
2 changed files with 44 additions and 2 deletions

View file

@ -0,0 +1,42 @@
var CasperUtils = require('./casperUtils').CasperUtils;
casper.start(
CasperUtils.getUrl(),
function() {
casper.waitFor(CasperUtils.waits.jsMount)
.then(CasperUtils.asserts.visibleSelectors([
'a.intl',
'a.commands',
'a.fb',
'div.helperBar'
]))
.then(CasperUtils.screenshot.entirePage)
.then(function() {
this.mouse.click('a.intl');
})
.then(CasperUtils.waits.selectorVisible(
'a.english'
))
.wait(1000)
.then(CasperUtils.screenshot.entirePage)
.then(CasperUtils.asserts.visibleSelectors([
'a.english',
'a.korean',
'a.japanese',
'a.simpchinese'
]))
.then(function() {
this.mouse.click('a.japanese');
})
.wait(500)
.then(function() {
var locale = this.evaluate(function() {
return debug_Intl_getLocale();
});
// Successfully changed locale
this.test.assert(locale === 'ja');
})
.then(CasperUtils.testDone);
}).run();

View file

@ -30,9 +30,9 @@ var toGlobalize = {
Intl: require('../intl') Intl: require('../intl')
}; };
_.each(toGlobalize, function(module) { _.each(toGlobalize, function(module, moduleName) {
for (var key in module) { for (var key in module) {
window['debug_' + key] = module[key]; window['debug_' + moduleName + '_' + key] = module[key];
} }
}); });