US Address Test Fixtures: CSV & JSON for Playwright & SQL

The columns an address fixture should keep, a CSV header and JSON shape you can paste, and how to load the rows in Playwright, Cypress and SQL seeds without flaky data.

Last updated: 2026-11-30

Test data should be boring. If your address fixture changes on every run, a failing test tells you nothing. This is the field reference we use when someone asks "which columns should my address fixture keep?" — plus how to load it in Playwright, Cypress and a SQL seed.

The columns worth keeping

Column Example Why you need it
street 1228 Elm St House number and street as one string, suffix included
city Manchester Spelled out; never abbreviated
state NH Two-letter USPS code, no period
zip 03101 String, not integer — leading zeros are real
zip4 (blank) Only if you validate against USPS data; leave empty otherwise
phone 603-4xx-xxxx Mask the last four if the fixture is committed to a public repo
phone_e164 +1603xxxxxxx For Twilio-style APIs that demand E.164
county (optional) Needed for E911 and some tax engines
timezone America/New_York Date, appointment and cutoff tests
income (income_median) 84434 or null Nullable integer (ACS 5-year estimate) — commercial or institutional ZIPs such as 19716 (Newark, DE) and 97204 (Portland, OR) return null, which is ideal for testing nullable-field handling in your parser or database schema
lat / lng (optional) Distance, store-locator and mapping tests

Two rules worth shouting about: ZIP must be text (or every New Hampshire, New Jersey and Maine row breaks), and phone must match the ZIP's area code, otherwise you are testing a combination that does not exist.

A CSV header you can paste

street,city,state,zip,zip4,phone,phone_e164,timezone,income_median
1228 Elm St,Manchester,NH,03101,,603-4xx-xxxx,+1603xxxxxxx,America/New_York,84434

That single row is illustrative — it shows the shape, with the phone masked the way our own example output is. Generate real rows from the random US address generator (batch of 5 or 10, CSV or JSON export) and paste them in.

The same row as JSON

[
  {
    "street": "1228 Elm St",
    "city": "Manchester",
    "state": "NH",
    "zip": "03101",
    "phone": "603-4xx-xxxx",
    "phone_e164": "+1603xxxxxxx",
    "timezone": "America/New_York",
    "income_median": 84434
  }
]

Keep the key names stable across states so one loader handles every row. Note that income and incomeBracket can legitimately be null (for institutional or commercial-tower ZIPs such as 19716, 97204, 90071, 75270, 30303, 28244 and 28246 where the U.S. Census Bureau publishes no ACS household estimate) — a realistic edge case to test your nullable branches rather than assuming every ZIP has a numeric income. Write null rather than dropping the key or emitting an empty string — a missing key, an empty string and a null value are three different bugs.

Loading the fixtures

Playwright / Cypress. Read the fixture once at the top of the test file, then loop the rows. One test per row gives you a failure that names the state (checkout › OR) instead of "expected true, received false".

const rows = require('./fixtures/us-addresses.json');
for (const row of rows) {
  test(`signup accepts a ${row.state} address`, async ({ page }) => {
    await page.fill('#zip', row.zip);
    await expect(page.locator('#zip')).toHaveValue(row.zip); // catches the leading zero
  });
}

SQL seed. Insert with explicit column names, and make zip a CHAR(5) or VARCHAR(10), never INT. A seed that runs twice should either be idempotent (ON CONFLICT DO NOTHING) or run inside a transaction you roll back.

Caveat: our phones carry random last digits, so do not assert on the full number in a snapshot test — assert on the area code, and pass a fixed phone through your own factory when a snapshot needs a stable string.

Keeping the file safe

  • Never commit a real customer address into a fixture. Use generated ones.
  • Never point a load test at a generated address as if it were a mailbox.
  • Do not use a generated address for account verification, KYC or E911 — it cannot pass, and it is not legal to try.
  • Refresh the file only when you add a state or a new scenario; a fixture that changes on every run defeats its purpose.

Related reading

US Address Generator · US Address Generator by State · Do fake addresses pass validation? · Wyoming vs. Delaware LLC fees (2026) · Address generator for testing · Sample US addresses and format rules