Files
landing/tests/visual.spec.ts
mifi a5989b03b1
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
Add GDPR compliant cookie banner and update footer/privacy policy to include GA and Clarity; added e2e and unit tests for cookie handling; updated snapshots
2026-03-12 15:04:49 -03:00

144 lines
6.8 KiB
TypeScript

import { test, expect } from '@playwright/test';
test.describe('visual regression', () => {
test('home page matches snapshot', async ({ page }) => {
await page.goto('/');
await expect(page).toHaveTitle(/mifi Ventures/);
await expect(page.locator('h1')).toBeVisible();
await expect(page.locator('#main')).toBeVisible();
await expect(page.locator('.footer')).toBeVisible();
await expect(page.locator('#cookie-banner')).toBeVisible();
await page.evaluate(() => {
localStorage.setItem('mifi-ventures-cookie-consent', 'reject');
});
await page.goto('/');
await expect(page.locator('#cookie-banner')).not.toBeVisible();
await expect(page).toHaveScreenshot('home.png', { fullPage: true });
});
test('services page matches snapshot', async ({ page }) => {
await page.goto('/services');
await expect(page).toHaveTitle(/SaaS Architecture Services | mifi Ventures/);
await expect(page.locator('h1')).toBeVisible();
await expect(page.locator('#main')).toBeVisible();
await expect(page.locator('.footer')).toBeVisible();
await expect(page.locator('#cookie-banner')).toBeVisible();
await page.evaluate(() => {
localStorage.setItem('mifi-ventures-cookie-consent', 'reject');
});
await page.goto('/services');
await expect(page.locator('#cookie-banner')).not.toBeVisible();
await expect(page).toHaveScreenshot('services.png', { fullPage: true });
});
test('services/hands-on-saas-architecture-consultant page matches snapshot', async ({ page }) => {
await page.goto('/services/hands-on-saas-architecture-consultant');
await expect(page).toHaveTitle(/SaaS Product Architecture Consultant | mifi Ventures/);
await expect(page.locator('h1')).toBeVisible();
await expect(page.locator('#main')).toBeVisible();
await expect(page.locator('#faq')).toBeVisible();
await expect(page.locator('.footer')).toBeVisible();
await expect(page.locator('#cookie-banner')).toBeVisible();
await page.evaluate(() => {
localStorage.setItem('mifi-ventures-cookie-consent', 'reject');
});
await page.goto('/services/hands-on-saas-architecture-consultant');
await expect(page.locator('#cookie-banner')).not.toBeVisible();
await expect(page).toHaveScreenshot('services-hands-on-saas-architecture-consultant.png', { fullPage: true });
});
test('services/mvp-architecture-and-launch page matches snapshot', async ({ page }) => {
await page.goto('/services/mvp-architecture-and-launch');
await expect(page).toHaveTitle(/MVP Architecture & Launch Consultant | mifi Ventures/);
await expect(page.locator('h1')).toBeVisible();
await expect(page.locator('#main')).toBeVisible();
await expect(page.locator('#faq')).toBeVisible();
await expect(page.locator('.footer')).toBeVisible();
await expect(page.locator('#cookie-banner')).toBeVisible();
await page.evaluate(() => {
localStorage.setItem('mifi-ventures-cookie-consent', 'reject');
});
await page.goto('/services/mvp-architecture-and-launch');
await expect(page.locator('#cookie-banner')).not.toBeVisible();
await expect(page).toHaveScreenshot('services-mvp-architecture-and-launch.png', { fullPage: true });
});
test('services/fractional-cto-for-early-stage-saas page matches snapshot', async ({ page }) => {
await page.goto('/services/fractional-cto-for-early-stage-saas');
await expect(page).toHaveTitle(/Fractional CTO for Early-Stage SaaS | mifi Ventures/);
await expect(page.locator('h1')).toBeVisible();
await expect(page.locator('#main')).toBeVisible();
await expect(page.locator('#faq')).toBeVisible();
await expect(page.locator('.footer')).toBeVisible();
await expect(page.locator('#cookie-banner')).toBeVisible();
await page.evaluate(() => {
localStorage.setItem('mifi-ventures-cookie-consent', 'reject');
});
await page.goto('/services/fractional-cto-for-early-stage-saas');
await expect(page.locator('#cookie-banner')).not.toBeVisible();
await expect(page).toHaveScreenshot('services-fractional-cto-for-early-stage-saas.png', { fullPage: true });
});
test('services/stage-aligned-infrastructure page matches snapshot', async ({ page }) => {
await page.goto('/services/stage-aligned-infrastructure');
await expect(page).toHaveTitle(/Startup Infrastructure Strategy | mifi Ventures/);
await expect(page.locator('h1')).toBeVisible();
await expect(page.locator('#main')).toBeVisible();
await expect(page.locator('#faq')).toBeVisible();
await expect(page.locator('.footer')).toBeVisible();
await expect(page.locator('#cookie-banner')).toBeVisible();
await page.evaluate(() => {
localStorage.setItem('mifi-ventures-cookie-consent', 'reject');
});
await page.goto('/services/stage-aligned-infrastructure');
await expect(page.locator('#cookie-banner')).not.toBeVisible();
await expect(page).toHaveScreenshot('services-stage-aligned-infrastructure.png', { fullPage: true });
});
test('privacy policy page matches snapshot', async ({ page }) => {
await page.goto('/privacy-policy');
await expect(page).toHaveTitle(/Privacy Policy | mifi Ventures/);
await expect(page.locator('h1')).toBeVisible();
await expect(page.locator('#main')).toBeVisible();
await expect(page.locator('.footer')).toBeVisible();
await expect(page.locator('#cookie-banner')).toBeVisible();
await page.evaluate(() => {
localStorage.setItem('mifi-ventures-cookie-consent', 'reject');
});
await page.goto('/privacy-policy');
await expect(page.locator('#cookie-banner')).not.toBeVisible();
await expect(page).toHaveScreenshot('privacy-policy.png', { fullPage: true });
});
test('terms of service page matches snapshot', async ({ page }) => {
await page.goto('/terms-of-service');
await expect(page).toHaveTitle(/Terms of Service | mifi Ventures/);
await expect(page.locator('h1')).toBeVisible();
await expect(page.locator('#main')).toBeVisible();
await expect(page.locator('.footer')).toBeVisible();
await expect(page.locator('#cookie-banner')).toBeVisible();
await page.evaluate(() => {
localStorage.setItem('mifi-ventures-cookie-consent', 'reject');
});
await page.goto('/terms-of-service');
await expect(page.locator('#cookie-banner')).not.toBeVisible();
await expect(page).toHaveScreenshot('terms-of-service.png', { fullPage: true });
});
});