learning_ai_clock/web/e2e/landing.spec.ts

42 lines
1.8 KiB
TypeScript

import { test, expect } from '@playwright/test';
test.describe('Landing Page', () => {
test('renders hero section with branding', async ({ page }) => {
await page.goto('/landing');
await expect(page.getByText('ChronoMind').first()).toBeVisible();
await expect(page.getByRole('heading', { name: 'Never be caught off-guard' })).toBeVisible();
});
test('shows feature grid with 6 features', async ({ page }) => {
await page.goto('/landing');
await expect(page.getByText('Pre-Warning Cascades')).toBeVisible();
await expect(page.getByText('Visual Timeline')).toBeVisible();
await expect(page.getByText('5 Urgency Levels')).toBeVisible();
await expect(page.getByText('Pomodoro Built-In')).toBeVisible();
await expect(page.getByText('Smart Defaults')).toBeVisible();
await expect(page.getByText('Privacy-First')).toBeVisible();
});
test('has CTA button linking to app', async ({ page }) => {
await page.goto('/landing');
const cta = page.getByRole('link', { name: /try it now/i }).first();
await expect(cta).toBeVisible();
await expect(cta).toHaveAttribute('href', '/');
});
test('footer has privacy and terms links', async ({ page }) => {
await page.goto('/landing');
await expect(page.getByRole('link', { name: 'Privacy' }).first()).toBeVisible();
await expect(page.getByRole('link', { name: 'Terms' }).first()).toBeVisible();
});
test('page renders without console errors', async ({ page }) => {
const errors: string[] = [];
page.on('pageerror', err => errors.push(err.message));
await page.goto('/landing');
await page.waitForLoadState('domcontentloaded');
const realErrors = errors.filter(e => !e.includes('fetch') && !e.includes('Failed'));
expect(realErrors).toHaveLength(0);
});
});