objective popping test

This commit is contained in:
Peter Cottle 2015-03-23 20:21:47 -07:00
parent 17ba5639f6
commit adbe798b25
2 changed files with 39 additions and 2 deletions

View 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();

View file

@ -13,7 +13,7 @@ casper.start(
])) ]))
.then(CasperUtils.screenshot.entirePage) .then(CasperUtils.screenshot.entirePage)
.then(function() { .then(function() {
this.mouse.click('#show-goal') this.mouse.click('#show-goal');
}) })
.then(CasperUtils.waits.selectorVisible( .then(CasperUtils.waits.selectorVisible(
'p.helperText' 'p.helperText'
@ -25,7 +25,6 @@ casper.start(
var text = this.evaluate(function() { var text = this.evaluate(function() {
return document.querySelector('p.helperText').innerText; return document.querySelector('p.helperText').innerText;
}); });
casper.echo(text);
this.test.assert( this.test.assert(
text === 'You can hide this window with "hide goal"' text === 'You can hide this window with "hide goal"'
); );