Skip to content

Instantly share code, notes, and snippets.

@davidbgk
Forked from brunobord/kill.js
Created January 31, 2013 00:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save davidbgk/4678584 to your computer and use it in GitHub Desktop.
Save davidbgk/4678584 to your computer and use it in GitHub Desktop.
/**
* Casper script to restart Alwaysdata processes.
*
* Usage:
* $ casperjs kill.js email@example.com mysecretpassword
*/
var casper = require('casper').create();
casper.start("https://admin.alwaysdata.com/login/");
casper.then(function() {
this.fill('#login form', { email: casper.cli.get(0), password: casper.cli.get(1) }, true);
});
casper.then(function() {
if (this.visible("#loginmsg")) {
this.die('incorrect authentication');
}
});
casper.thenOpen('https://admin.alwaysdata.com/advanced/processes/restart/');
casper.run(function() {
this.echo('processes restarted', 'INFO').exit();
});
@fedir
Copy link

fedir commented Jun 3, 2013

Nice example of casper.js usage, thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment