test refactor

This commit is contained in:
Peter Cottle 2015-03-23 09:20:21 -07:00
parent fba7e4bb3d
commit 8709f87b4f
2 changed files with 13 additions and 8 deletions

View file

@ -0,0 +1,48 @@
var CasperUtils = require('./casperUtils').CasperUtils;
var visibleIDs = [
'commandLineHistory',
'terminal',
'interfaceWrapper',
'mainVisSpace',
'commandLineBar'
];
var selectors = [
'div.visBackgroundColor',
'p.commandLine'
];
var doneSelectors = [
'p.finished'
];
casper.start(
CasperUtils.getUrlForCommands([
'git commit',
]),
function() {
this.test.assertTitle('Learn Git Branching');
casper.waitFor(CasperUtils.waits.jsMount, function then() {
visibleIDs.forEach(function(id) {
this.test.assertVisible('#' + id);
}.bind(this));
selectors.forEach(function(selector) {
this.test.assertExists(selector);
}.bind(this));
})
.waitFor(CasperUtils.waits.allCommandsFinished, function then() {
doneSelectors.forEach(function(selector) {
this.test.assertExists(selector);
}.bind(this));
})
.then(function() {
this.test.done();
});
});
casper.run();