Skip to content

Instantly share code, notes, and snippets.

@iperdomo
Created July 10, 2013 16:47
Show Gist options
  • Save iperdomo/5967970 to your computer and use it in GitHub Desktop.
Save iperdomo/5967970 to your computer and use it in GitHub Desktop.
Dummy sample navigation test using CasperJS
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