Shumiland/tests/e2e/check.spec.ts
Vadym Samoilenko cca4ea1d55
Some checks are pending
CI / Type Check (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Unit Tests (push) Waiting to run
Deploy / Build & Push Image (push) Waiting to run
Deploy / Deploy to VPS (push) Blocked by required conditions
feat: implement full frontend — all sections, components, Figma Code Connect
- All 8 home page sections: Hero, Locations slider, WhyParents accordion,
  Birthday pricing cards, Video, Gallery, Reviews slider, News
- UI components: NavLink, BtnPrimary, BtnGradient, BtnDetails, AccordionItem
- Layout: sticky Header (NavLink + BtnPrimary), Footer with logo
- Figma Code Connect: 5 components published (.figma.tsx + figma.config.json)
- Public assets: all Figma images and SVGs exported
- Pages: /kvytky, /lokatsii, /blog, /dni-narodzhennia, /grupovi-vidviduvannia
- Tests: Vitest unit/api suites, Playwright e2e screenshots
- Payload CMS: blocks, collections, seed data updates
- Hero negative-margin to extend behind sticky header
- Custom Tailwind breakpoints: lg=1440px, xl=1920px
- Fix ESLint config: drop FlatCompat, use eslint-config-next flat export
- Add tsconfig.tsbuildinfo, test-results/, agentdb.rvf* to .gitignore

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-10 16:40:56 +01:00

23 lines
1 KiB
TypeScript

import { test, expect } from '@playwright/test'
test('homepage visual check', async ({ page }) => {
await page.setViewportSize({ width: 1440, height: 900 })
const errors: string[] = []
page.on('console', msg => { if (msg.type() === 'error') errors.push(msg.text()) })
await page.goto('http://localhost:3000/')
await page.waitForLoadState('networkidle')
await page.screenshot({ path: '/tmp/home-desktop.png', fullPage: false })
await page.screenshot({ path: '/tmp/home-desktop-full.png', fullPage: true })
const imgs = await page.$$eval('img', imgs => imgs.map(i => ({ src: i.src, ok: i.naturalWidth > 0 })))
const broken = imgs.filter(i => !i.ok)
const headerH = await page.$eval('header', h => h.offsetHeight).catch(() => null)
console.log('Header height:', headerH)
console.log('Images:', imgs.length, 'broken:', broken.length)
if (broken.length) console.log('BROKEN:', broken.map(i => i.src.split('/').pop()))
console.log('Errors:', errors.length ? errors : 'none')
expect(broken.length, 'broken images').toBe(0)
})