US Fake Address Generator for Checkout Tests
Use a synthetic United States address fixture for form and import tests. Check the US postcode layout and local address fields.
Preview
Example25 Sample Lane
Test fixture
{
"street": "25 Sample Lane",
"unit": "Apt 4B",
"city": "Boston",
"region": "MA",
"postalCode": "02108",
"country": "US"
}Address format
The example has a delivery line, city, two letter state abbreviation and a five digit ZIP Code. Take the ZIP Code as text so values with a leading zero survive JSON, CSV and database imports. Add a ZIP+4 case such as 02108-1234 for a second test. Decide whether the application keeps the suffix in the primary field or separates it when sending the carrier request.
Put an apartment, suite or unit on its own line in the checkout form. Test the form with that line blank and then with a value such as Apt 4B. Verify that both variants render correctly on the receipt. If address line 2 is optional, test both null and absent values in the API, since backends can serialize the two forms differently.
Form and import tests
Start with state MA to check lookup and abbreviation behavior. Then choose a second state and confirm that the shipping calculator receives the updated region. Try completing checkout with a ZIP Code that matches the pattern but conflicts with a test state in your sandbox. That fixture should trigger the integration’s configured response instead of suddenly changing the state displayed to the customer.
On mobile, verify that the ZIP field can accept a hyphen when ZIP+4 is supported and that autofill does not overwrite the unit. Run import tests with the ZIP column set to text. Keep a separate structured record for experiments with type conversion so an accidental numeric cast will fail a focused assertion.
Fixture assertions
Inspect the delivery label and review whether the address line fits within its available width when a user adds a suite. Test the longest unit string your product permits and confirm the error appears next to that field. Keep actual fulfillment disabled. The sample uses a synthetic street and is intended for UI and data handling tests.
Use this JavaScript assertion as a local smoke test for a mock checkout fixture. Pull state values from the app’s actual configuration for a full country selector test. For a positive carrier test, use an address approved by the carrier’s test environment and assert its verified status independently of the ZIP pattern.
JavaScript test example
const fixture = {
"street": "25 Sample Lane",
"unit": "Apt 4B",
"city": "Boston",
"region": "MA",
"postalCode": "02108",
"country": "US"
};
const postcode = fixture.postalCode;
if (!/^\d{5}(?:-\d{4})?$/.test(postcode) || !(fixture.region === 'MA' && fixture.postalCode.startsWith('0'))) {
throw new Error("Address fixture failed");
}