mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-07 05:04:30 +02:00
test refactor
This commit is contained in:
parent
fba7e4bb3d
commit
8709f87b4f
2 changed files with 13 additions and 8 deletions
48
src/__tests__/casperjs/pageload_test.js
Normal file
48
src/__tests__/casperjs/pageload_test.js
Normal 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();
|
Loading…
Add table
Add a link
Reference in a new issue