Created
September 30, 2015 09:42
-
-
Save MorganBerger/3a8ee050ad949acf0d71 to your computer and use it in GitHub Desktop.
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(); | |
var formdata = { | |
'email': '[email protected]', | |
'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