mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-08-20 17:50:04 +02:00
fixed all tests with weird function scoping bug
This commit is contained in:
parent
36161d3406
commit
dd4bec0597
6 changed files with 37 additions and 18 deletions
|
@ -8,7 +8,7 @@ var CasperUtils = {
|
|||
// Unfortunately this is hardcoded for now :*( cant get the path
|
||||
// variable synchronously when running this test, and CasperJS does
|
||||
// not like being started asynchronously.
|
||||
return '/Users/pcottle/Dropbox/wip/learnGitBranching/';
|
||||
return '/Users/pcottle/Dropbox (Personal)/wip/learnGitBranching/';
|
||||
},
|
||||
|
||||
getUrl: function () {
|
||||
|
@ -74,9 +74,6 @@ var CasperUtils = {
|
|||
selectorContainsText: function(selector, text) {
|
||||
return function then() {
|
||||
this.test.assertEvalEquals(function(selector) {
|
||||
__utils__.echo('hellow');
|
||||
__utils__.echo('hellow' + selector);
|
||||
__utils__.echo(document.querySelector(selector).innerText);
|
||||
return document.querySelector(selector).innerText;
|
||||
},
|
||||
text,
|
||||
|
@ -87,6 +84,19 @@ var CasperUtils = {
|
|||
};
|
||||
},
|
||||
|
||||
intlKeyReturns: function(key, text) {
|
||||
return function then() {
|
||||
this.test.assertEvalEquals(function(key) {
|
||||
return debug_Intl_str(key);
|
||||
},
|
||||
text,
|
||||
'Checking that intl key "' + key + '" contains "' +
|
||||
text + '".',
|
||||
{key: key}
|
||||
);
|
||||
};
|
||||
},
|
||||
|
||||
existingIDs: function(existingIDs) {
|
||||
return function then() {
|
||||
existingIDs.forEach(function(id) {
|
||||
|
@ -171,7 +181,7 @@ var CasperUtils = {
|
|||
return document.querySelectorAll('p.commandLine').length > 0;
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
var CasperUtils = require('./casperUtils').CasperUtils;
|
||||
|
||||
casper.start(
|
||||
CasperUtils.getUrlForCommands([
|
||||
'locale fr_FR'
|
||||
]),
|
||||
CasperUtils.getUrlWithQueryParams({
|
||||
locale: 'fr_FR',
|
||||
}),
|
||||
function() {
|
||||
this.test.assertTitle('Learn Git Branching');
|
||||
casper.waitFor(CasperUtils.waits.jsMount)
|
||||
.then(CasperUtils.screenshot.entirePage)
|
||||
.wait(3000)
|
||||
.then(CasperUtils.screenshot.entirePage)
|
||||
.then(CasperUtils.asserts.intlKeyReturns(
|
||||
'learn-git-branching',
|
||||
"Apprenez Git Branching"
|
||||
))
|
||||
.then(CasperUtils.asserts.selectorContainsText(
|
||||
// The title bar on command line history
|
||||
'span[data-intl="learn-git-branching"]',
|
||||
"APRENDÉ A BRANCHEAR EN GIT"
|
||||
"APPRENEZ GIT BRANCHING"
|
||||
))
|
||||
.then(CasperUtils.testDone);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue