mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-08-07 11:34:35 +02:00
First CasperJS test -- woohoo
This commit is contained in:
parent
6ac9ed298d
commit
65480b4ed1
4 changed files with 94 additions and 11 deletions
46
src/__tests__/casperjs/sanity.js
Normal file
46
src/__tests__/casperjs/sanity.js
Normal file
|
@ -0,0 +1,46 @@
|
|||
var CasperHelp = require('./casperHelp').CasperHelp;
|
||||
|
||||
var visibleIDs = [
|
||||
'commandLineHistory',
|
||||
'terminal',
|
||||
'interfaceWrapper',
|
||||
'mainVisSpace',
|
||||
'commandLineBar'
|
||||
];
|
||||
|
||||
var selectors = [
|
||||
'div.visBackgroundColor',
|
||||
'p.commandLine'
|
||||
];
|
||||
|
||||
var doneSelectors = [
|
||||
'p.finished'
|
||||
];
|
||||
|
||||
casper.start(
|
||||
CasperHelp.getUrlForCommands([
|
||||
'git commit',
|
||||
]),
|
||||
function() {
|
||||
this.test.assertTitle('Learn Git Branching');
|
||||
|
||||
casper.waitFor(CasperHelp.waits.jsMount, function then() {
|
||||
visibleIDs.forEach(function(id) {
|
||||
this.test.assertVisible('#' + id);
|
||||
}.bind(this));
|
||||
|
||||
selectors.forEach(function(selector) {
|
||||
this.test.assertExists(selector);
|
||||
}.bind(this));
|
||||
|
||||
this.test.done();
|
||||
})
|
||||
.waitFor(CasperHelp.waits.allCommandsFinished, function then() {
|
||||
doneSelectors.forEach(function(selector) {
|
||||
this.test.assertExists(selector);
|
||||
}.bind(this));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
casper.run();
|
Loading…
Add table
Add a link
Reference in a new issue