Skip to content

Instantly share code, notes, and snippets.

@MorganBerger
Created September 30, 2015 09:42
Show Gist options
  • Save MorganBerger/3a8ee050ad949acf0d71 to your computer and use it in GitHub Desktop.
Save MorganBerger/3a8ee050ad949acf0d71 to your computer and use it in GitHub Desktop.
var casper = require('casper').create();
var formdata = {
'email': 'morgan3.berger2@student.42.fr',
'password': 'morgan666',
'first_name': 'PRENON',
'last_name': 'NOM',
'mobile_country': 'FR',
'mobile': '05 04 03 02 01',
'language': 'fr',
'card_number': '4562 3967 8424 3531',
'card_code': '817',
'card_expiration_month': '3',
'card_expiration_year': '2018',
'billing_zip': '75017',
'promotion_code': 'School42'
};
casper.start('https://get.uber.com/sign-up/', function() {
this.fill('form.form-vertical', formdata, true);
});
casper.then(function() {
this.echo(JSON.stringify(this.getFormValues('form.form-vertical'), null, 4));
this.evaluateOrDie(function() {
return /message sent/.test(document.body.innerText);
}, 'Account creation FAILED :(');
this.echo(this.getFormValues('form').q);
});
casper.run(function() {
this.echo('Account created MUAHAHAHAH').exit();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment