Created
June 1, 2016 07:59
-
-
Save leehambley/403562804ecc32a2aa4bc799e37b47d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
casper.test.begin('Test App Login Works Successfully', 1, function(test) { | |
var goalUrl = /wizard\/create/; | |
var formSelector = "form[name='harrowForm.form']"; | |
casper.start('https://harrow.io/', function openTheHomePage() { | |
casper.evaluate(function() { | |
var res = localStorage.clear(); | |
this.echo("Clearing Local Storage", res); | |
}); | |
casper.capture('homepage.png'); | |
casper.clickLabel('Log In', 'a'); | |
}); | |
casper.then(function fillAndSubmitLoginForm(){ | |
casper.waitForSelector(formSelector, function () { | |
casper.capture('login-form.png'); | |
casper.fillSelectors(formSelector, { | |
"input[name='email']" : "[email protected]", | |
"input[name='password']" : "Jack0/perp" | |
}, true); | |
}); | |
}); | |
casper.then(function waitForTheWizardStartPage(){ | |
this.waitForUrl(goalUrl, function(){ | |
casper.capture('wizard.png'); | |
test.assertUrlMatch(goalUrl, 'landed on the wizard startpage'); | |
}); | |
}); | |
casper.run(function endOfTestRunCallback(){ | |
test.done() | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment