Files
carmanagement/apps/homepage/tests/visual/homepage.visual.spec.ts
T
root 781512399b
Build & Deploy / Build & Push Docker Image (push) Successful in 2m51s
Test / Type Check (all packages) (push) Successful in 52s
Build & Deploy / Deploy to VPS (push) Successful in 4s
Test / API Unit Tests (push) Successful in 49s
Test / Homepage Unit Tests (push) Successful in 44s
Test / Storefront Unit Tests (push) Successful in 39s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Successful in 40s
Test / API Integration Tests (push) Successful in 1m0s
Update homepage routes to include language and mode
2026-07-02 14:10:17 -04:00

31 lines
1.3 KiB
TypeScript

import { expect, test } from '@playwright/test';
const scenarios = [
{ name: 'homepage-en-light-desktop', locale: 'en', theme: 'light', width: 1440, height: 1000 },
{ name: 'homepage-en-dark-mobile', locale: 'en', theme: 'dark', width: 390, height: 844 },
{ name: 'homepage-fr-light-tablet', locale: 'fr', theme: 'light', width: 1024, height: 900 },
{ name: 'homepage-fr-dark-mobile', locale: 'fr', theme: 'dark', width: 390, height: 844 },
{ name: 'homepage-ar-light-desktop', locale: 'ar', theme: 'light', width: 1440, height: 1000 },
{ name: 'homepage-ar-dark-mobile', locale: 'ar', theme: 'dark', width: 390, height: 844 },
{ name: 'homepage-en-light-320', locale: 'en', theme: 'light', width: 320, height: 800 },
] as const;
for (const scenario of scenarios) {
test(`${scenario.name} baseline`, async ({ page, context }) => {
test.skip(test.info().project.name !== 'chromium');
await page.setViewportSize({ width: scenario.width, height: scenario.height });
await context.addCookies([
{
name: 'hpc-theme',
value: scenario.theme,
domain: '127.0.0.1',
path: '/',
secure: false,
sameSite: 'Lax',
},
]);
await page.goto(`/${scenario.locale}/${scenario.theme}`);
await expect(page).toHaveScreenshot(`${scenario.name}.png`, { fullPage: true });
});
}