level solved test

This commit is contained in:
Peter Cottle 2015-03-29 22:06:06 -07:00
parent 095c52cec3
commit 28078779ba
2 changed files with 11 additions and 12 deletions

View file

@ -3,25 +3,25 @@ var CasperUtils = require('./casperUtils').CasperUtils;
casper.start( casper.start(
CasperUtils.getUrlForCommands([ CasperUtils.getUrlForCommands([
'level intro1 --noIntroDialog --noStartCommand', 'level intro1 --noIntroDialog --noStartCommand',
'show goal',
'git commit', 'git commit',
'git commit' 'git commit'
]), ]),
function() { function() {
this.test.assertTitle('Learn Git Branching'); this.test.assertTitle('Learn Git Branching');
casper.waitFor(CasperUtils.waits.jsMount) casper.waitFor(CasperUtils.waits.jsMount)
.wait(1000) .wait(2000)
.then(CasperUtils.screenshot.entirePage)
.waitFor(CasperUtils.waits.allCommandsFinished) .waitFor(CasperUtils.waits.allCommandsFinished)
.wait(500) // Have to wait for balls to stop bouncing
.then(CasperUtils.screenshot.entirePage) .wait(5000)
.then(function() { .wait(5000)
this.test.assertEvalEquals(function() { .wait(5000)
return debug_LevelStore_isLevelSolved('intro1');
},
true,
'Checking that level is solved'
);
})
.then(CasperUtils.screenshot.entirePage) .then(CasperUtils.screenshot.entirePage)
.then(CasperUtils.asserts.selectorContainsText(
'div.modalView div.inside h2',
"Great Job!!"
))
.then(CasperUtils.testDone); .then(CasperUtils.testDone);
}).run(); }).run();

View file

@ -152,7 +152,6 @@ var Level = Sandbox.extend({
}, },
startOffCommand: function() { startOffCommand: function() {
console.log(this.options);
var method = this.options.command.get('method'); var method = this.options.command.get('method');
if (!this.testOption('noStartCommand') && method !== 'importLevelNow') { if (!this.testOption('noStartCommand') && method !== 'importLevelNow') {
Main.getEventBaton().trigger( Main.getEventBaton().trigger(