Created
July 10, 2013 16:47
-
-
Save iperdomo/5967970 to your computer and use it in GitHub Desktop.
Dummy sample navigation test using CasperJS
This file contains 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
var casper = require('casper').create({ | |
verbose: true, | |
logLevel: 'debug' | |
}); | |
var url = 'http://akvoflowsandbox.appspot.com/admin/'; | |
casper.start(url, function () { | |
this.fill('form[action="https://accounts.google.com/ServiceLoginAuth"]', { | |
Email: 'youremail@gmail.com', | |
Passwd: 'yourpass' | |
}, true); | |
}); | |
casper.then(function () { | |
var devicesLink = 'a[data-ember-action="2"]'; // Devices top link CSS selector | |
this.test.assertExists(devicesLink, 'Device element exists'); | |
this.click(devicesLink); // click on Devices | |
this.test.assertTruthy(casper.evaluate(function () { | |
return FLOW.router.location.path | |
}) === '/devices', 'Yeap! we made it'); | |
}); | |
casper.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment