mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-10 22:54:24 +02:00
test refactor
This commit is contained in:
parent
fba7e4bb3d
commit
8709f87b4f
2 changed files with 13 additions and 8 deletions
39
src/__tests__/casperjs/casperUtils.js
Normal file
39
src/__tests__/casperjs/casperUtils.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
var CasperUtils = {
|
||||
|
||||
getRoot: function() {
|
||||
// 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/';
|
||||
},
|
||||
|
||||
getUrl: function () {
|
||||
return 'file://localhost/' + this.getRoot() + '/index.html?NODEMO';
|
||||
},
|
||||
|
||||
getUrlForCommands: function(commands) {
|
||||
return this.getUrl() + '&command=' + commands.join(';');
|
||||
},
|
||||
|
||||
waits: {
|
||||
jsMount: function() {
|
||||
return this.evaluate(function() {
|
||||
var hasHelper = document.querySelectorAll('div.BaseHelperBar').length > 0;
|
||||
if (hasHelper) {
|
||||
__utils__.echo('<<< JS mounted >>>');
|
||||
}
|
||||
return hasHelper;
|
||||
});
|
||||
},
|
||||
|
||||
allCommandsFinished: function () {
|
||||
return this.evaluate(function() {
|
||||
return document.querySelectorAll('p.commandLine').length ===
|
||||
document.querySelectorAll('p.finished').length;
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
exports.CasperUtils = CasperUtils;
|
Loading…
Add table
Add a link
Reference in a new issue