mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-14 16:44:26 +02:00
objective popping test
This commit is contained in:
parent
17ba5639f6
commit
adbe798b25
2 changed files with 39 additions and 2 deletions
38
src/__tests__/casperjs/level_objective_test.js
Normal file
38
src/__tests__/casperjs/level_objective_test.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
var CasperUtils = require('./casperUtils').CasperUtils;
|
||||
|
||||
casper.start(
|
||||
CasperUtils.getUrlForCommands([
|
||||
'level intro1 --noIntroDialog --noStartCommand',
|
||||
]),
|
||||
function() {
|
||||
casper.waitFor(CasperUtils.waits.jsMount)
|
||||
.waitFor(CasperUtils.waits.allCommandsFinished)
|
||||
.then(CasperUtils.asserts.visibleSelectors([
|
||||
'p.commandLine.finished',
|
||||
'div.levelNameWrapper'
|
||||
]))
|
||||
.then(CasperUtils.screenshot.entirePage)
|
||||
.then(function() {
|
||||
this.mouse.click('#show-objective');
|
||||
})
|
||||
.then(CasperUtils.waits.selectorVisible(
|
||||
'p.commandLine.processing'
|
||||
))
|
||||
.wait(1000)
|
||||
.then(CasperUtils.screenshot.entirePage)
|
||||
.then(CasperUtils.asserts.visibleSelectors([
|
||||
'div.inside',
|
||||
'div.modalTerminal'
|
||||
]))
|
||||
.then(function() {
|
||||
var text = this.evaluate(function() {
|
||||
return document.querySelector('div.inside > div > p').innerText;
|
||||
});
|
||||
this.test.assert(
|
||||
text === "Go ahead and try it out on your own! After this " +
|
||||
"window closes, make two commits to complete the level"
|
||||
);
|
||||
})
|
||||
.then(CasperUtils.testDone);
|
||||
}).run();
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue