Canadian Fake Address Generator for QA Fixtures
Use a synthetic Canada address fixture for form and import tests. Check the CA postcode layout and local address fields.
Preview
Example12 Example Avenue
Test fixture
{
"street": "12 Example Avenue",
"unit": "4B",
"city": "Ottawa",
"region": "ON",
"postalCode": "k1a0b1",
"country": "CA"
}Address format
Canadian postal codes use an alternating letter and digit layout with a space between the two groups of three. The first group is the forward sortation area. The second group narrows the local delivery unit. Capture the postal code as a text field and test normalization with both uppercase and lowercase input.
Use a Canadian province or territory code alongside the municipality. Exercise a second language locale with a street or place name that includes accents, and check that the address export remains UTF-8. Keep province stored as a stable key so localized display labels do not break import mappings.
Form and import tests
On a bilingual checkout, switch the UI language with an address already filled. The addresses should stay intact while labels change. Follow the saved record into the confirmation view and confirm the postal code retains its space. For an unauthenticated checkout, save the fixture and reload to expose problems with address state restored from the browser.
Prepare a fixture with a unit identifier such as 4B. Test which line receives the unit in each destination system, since an order display and a carrier integration may format the same fields differently. Compare separate snapshots of the internal object and its printed presentation to localize any differences.
Fixture assertions
Try pasting a postal code with tabs at the edges and check how the UI handles whitespace. Add a fixture with a digit where the first letter belongs, then assert that the form focuses the postal field on submission. Cover format and deliverability in separate tests, so a provider outage cannot mask a local input validation regression.
The example checks the alternating pattern and a province mapping in a synthetic Ottawa record. It is suitable for an import smoke test. Keep a separate fixture with an invalid province key to exercise that error path, and stub or disable real fulfillment when running the checkout suite.
JavaScript test example
const fixture = {
"street": "12 Example Avenue",
"unit": "4B",
"city": "Ottawa",
"region": "ON",
"postalCode": "k1a0b1",
"country": "CA"
};
const postcode = fixture.postalCode.toUpperCase().replace(/\s/g, '').replace(/^(.{3})(.+)$/, '$1 $2');
if (!/^[A-Z]\d[A-Z] \d[A-Z]\d$/.test(postcode) || !(postcode === 'K1A 0B1' && fixture.region === 'ON')) {
throw new Error("Address fixture failed");
}