Manual testing your web app is a pain when you have lots of forms which need to be filled in. Not anymore!
$('input').populate();
That was easy! Inputs with a name containing ‘first_name’ will be filled in with a random first name, etc.
$.populate.registerValues({
favoriteColor: ['red', 'green', 'blue']
});
Now favorite_color inputs will be filled in with a random color choice from [‘red’, ‘green’, ‘blue’]
I won’t stop you!
$.populate.registerValues({
favoriteColor: function() {
return 'red';
}
});
I want the username to be the first name plus a number, or I want
the password confirmation to be equal to the password, for example.
(Both of these examples are already in the plugin)
$.populate.registerValues({
username: $.populate.dependency('firstName', function(firstname) {
return firstname + Math.randomInt(100);
}),
passwordConfirmation: $.populate.is('password')
});
Easy-peasy.
Check demo.html/css/js for more examples.