BS-011 Reconcile accepted homepage composition to approved reference

This commit is contained in:
rob
2026-11-10 16:41:09 +00:00
parent 4f3b75b2b4
commit 33e3413657
27 changed files with 773 additions and 132 deletions
+22
View File
@@ -0,0 +1,22 @@
import { expect, test } from '@playwright/test'
// Measured from assets/references/home-approved-direction.png (1024×1536).
// These are composition anchors, not acceptance of missing brand/media assets.
test('homepage composition stays aligned with approved desktop reference', async ({ page }, testInfo) => {
await page.setViewportSize({ width: 1024, height: 1536 })
await page.goto('/')
await page.evaluate(() => globalThis.document.fonts.ready)
const header = await page.getByRole('navigation', { name: 'Main navigation' }).boundingBox()
expect(Math.abs(header.height - 67)).toBeLessThanOrEqual(3)
const media = await page.getByRole('region', { name: 'Featured project' }).getByRole('img').boundingBox()
for (const [actual, reference] of [[media.x, 56], [media.y, 814], [media.width, 507], [media.height, 267]]) {
expect(Math.abs(actual - reference)).toBeLessThanOrEqual(8)
}
const closing = await page.getByRole('region', { name: 'Have a project in mind?' }).boundingBox()
expect(Math.abs(closing.x - 35)).toBeLessThanOrEqual(2)
expect(Math.abs(closing.y - 1287)).toBeLessThanOrEqual(15)
expect(Math.abs(closing.width - 954)).toBeLessThanOrEqual(3)
expect(Math.abs(closing.height - 203)).toBeLessThanOrEqual(6)
await page.screenshot({ path: testInfo.outputPath('homepage-reference-viewport.png') })
await page.screenshot({ path: testInfo.outputPath('homepage-reference-full.png'), fullPage: true })
})