Files
carmanagement/apps/homepage/tests/visual/integrations.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

25 lines
1002 B
TypeScript

import { expect, test } from '@playwright/test';
for (const scenario of [
{ locale: 'en', theme: 'light' },
{ locale: 'en', theme: 'dark' },
{ locale: 'fr', theme: 'light' },
{ locale: 'ar', theme: 'light' },
{ locale: 'ar', theme: 'dark' },
] as const) {
test(`${scenario.locale} ${scenario.theme} demo initial and validation states`, async ({
page,
}) => {
test.skip(test.info().project.name !== 'chromium', 'Canonical visual baselines use Chromium.');
await page.emulateMedia({ colorScheme: scenario.theme });
await page.goto(`/${scenario.locale}/${scenario.theme}`);
await page.locator('main button[data-demo-source="hero"]').click();
const dialog = page.getByRole('dialog');
await expect(dialog).toHaveScreenshot(`demo-${scenario.locale}-${scenario.theme}-initial.png`);
await dialog.locator('button[type="submit"]').click();
await expect(dialog).toHaveScreenshot(
`demo-${scenario.locale}-${scenario.theme}-validation.png`,
);
});
}