Deterministic Address Fixtures in Playwright & Cypress CI Pipelines
Why unseeded random address libraries break CI snapshots and how to wire deterministic AddressQA fixtures into Playwright test.use() hooks.
- Lock a named seed per spec file: Assign a semantic seed such as qa-stripe-de-01 to every checkout E2E spec so local runs and GitHub Actions emit identical strings.
- Fetch or vendor the typed fixture: Call GET /api/v1/fixtures?country=US&state=DE&seed=qa-stripe-de-01 or paste the generated Playwright / TS snippet into tests/fixtures/addresses.ts.
- Add boundary torture matrices: Run parameterized test.describe loops across leading_zero, long_street, unicode, and punctuation_name presets.
Why Unseeded Random Data Creates Flaky Checkout Suites
When a Playwright test suite generates fresh random names, streets, and ZIP codes on every CI commit, failures become non-reproducible. One run picks California (taxed), the next picks Massachusetts (02108 leading zero), and a third generates an apostrophe name like O'Connor that trips a naive SQL audit log — then disappears on retry.
Wiring AddressQA Deterministic Fixtures into Playwright
By seeding AddressQA’s FNV-1a + Mulberry32 generator with a constant string (for example qa-checkout-de-01), both your local browser and headless Linux CI runners consume the exact same address, postal code, and geo-synchronized NANPA 555-01xx phone number.
import { test, expect } from '@playwright/test';
const MATRIX = [
{ label: 'DE Tax-Free', query: 'country=US&state=DE&seed=qa-de-01', expectTaxZero: true },
{ label: 'NH Leading-Zero', query: 'country=US&state=NH&boundary=leading_zero&seed=qa-nh-01', expectTaxZero: true },
{ label: 'Apostrophe Name', query: 'country=US&state=CA&boundary=punctuation_name&seed=qa-apos-01', expectTaxZero: false },
];
for (const scenario of MATRIX) {
test(`checkout handles ${scenario.label}`, async ({ page, request }) => {
const res = await request.get(`https://addressqa.com/api/v1/fixtures?${scenario.query}`);
const { fixtures: [fx] } = await res.json();
await page.goto('/checkout');
await page.getByLabel(/full name/i).fill(fx.recipient.fullName);
await page.getByLabel(/phone/i).fill(fx.phone.e164);
await page.getByLabel(/street/i).fill(fx.address.line1);
await page.getByLabel(/zip|postal/i).fill(fx.address.postalCode);
await expect(page.getByTestId('zip-preview')).toHaveText(fx.address.postalCode);
});
} Offline CI Determinism via Vendored Snapshots
In air-gapped CI environments, copy the JSON or Playwright/TS tab straight from the AddressQA Workbench into a committed fixtures module. Because the seed is embedded in metadata, any QA engineer can reopen the exact permalink URL (?seed=...&country=...) to inspect or extend the dataset.