Skip to content

Instantly share code, notes, and snippets.

@PsyGik
Last active June 12, 2023 16:20
Show Gist options
  • Save PsyGik/e942a70515e5c3548af6e82639b75f18 to your computer and use it in GitHub Desktop.
Save PsyGik/e942a70515e5c3548af6e82639b75f18 to your computer and use it in GitHub Desktop.
Testing Form auto-fills using bookmarklets
import { faker } from 'https://cdn.skypack.dev/@faker-js/faker';
const firstName = faker.person.firstName();
const lastName = faker.person.lastName();
const email = faker.internet.email({ firstName, lastName, provider: 'mailinator.com' });
const country = faker.location.countryCode();
const state = faker.location.state();
const pin_code = faker.location.zipCode({state});
document.getElementById("firstName").value = firstName;
document.getElementById("lastName").value = lastName;
document.getElementById("email").value = email;
document.getElementById("address.country").value = country;
document.getElementById("address.state").value = state;
document.getElementById("address.postal_code").value = pin_code;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment