Build public home, contact, and content pages
This commit is contained in:
13
tests/e2e/contact.spec.ts
Normal file
13
tests/e2e/contact.spec.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test.describe('contact page', () => {
|
||||
test('renders the enquiry form and contact details', async ({ page }) => {
|
||||
await page.goto('/contact');
|
||||
|
||||
await expect(page.getByRole('heading', { name: 'Talk to the team before you book' })).toBeVisible();
|
||||
await expect(page.getByLabel('Name')).toBeVisible();
|
||||
await expect(page.getByLabel('Email')).toBeVisible();
|
||||
await expect(page.getByLabel('Message')).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: 'hello@example.com' })).toBeVisible();
|
||||
});
|
||||
});
|
||||
11
tests/e2e/content-pages.spec.ts
Normal file
11
tests/e2e/content-pages.spec.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test.describe('content pages', () => {
|
||||
test('renders editorial content pages from shared data', async ({ page }) => {
|
||||
await page.goto('/about');
|
||||
|
||||
await expect(page.getByRole('heading', { name: 'About Holiday Property Booking' })).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: 'What the site is for' })).toBeVisible();
|
||||
await expect(page.getByRole('link', { name: 'Open the contact page' })).toHaveAttribute('href', '/contact');
|
||||
});
|
||||
});
|
||||
@@ -1,23 +1,21 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test.describe('homepage', () => {
|
||||
test('renders the phase 1 scaffold and primary navigation', async ({ page }) => {
|
||||
test('renders the public browsing entry point and primary navigation', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
|
||||
await expect(page.getByRole('heading', { name: 'Holiday Property Booking' })).toBeVisible();
|
||||
await expect(page.getByText('Phase 1 foundation')).toBeVisible();
|
||||
await expect(page.getByRole('navigation', { name: 'Primary' })).toBeVisible();
|
||||
await expect(page.getByRole('link', { name: 'Review foundation' })).toHaveAttribute('href', '#foundation');
|
||||
await expect(page.getByRole('link', { name: 'Check health' })).toHaveAttribute('href', '/api/health');
|
||||
await expect(page.getByRole('link', { name: 'Explore featured stays' })).toHaveAttribute('href', '/#browse');
|
||||
await expect(page.getByRole('link', { name: 'Contact the team' })).toHaveAttribute('href', '/contact');
|
||||
});
|
||||
|
||||
test('shows the core planning sections', async ({ page }) => {
|
||||
test('shows the public content sections', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
|
||||
await expect(page.getByRole('heading', { name: 'Foundation work starts here' })).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: 'The implementation stack is locked' })).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: 'The first schema pass is ready' })).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: 'Ready for the first implementation slice' })).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: 'A few properties guests can imagine themselves in' })).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: 'Editorial content keeps the journey understandable' })).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: 'Location highlights' })).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: 'A clear contact route is already live' })).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test.describe('responsive shell', () => {
|
||||
test('keeps the core content visible on mobile widths', async ({ page }) => {
|
||||
test('keeps the public content visible on mobile widths', async ({ page }) => {
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
await page.goto('/');
|
||||
|
||||
await expect(page.getByRole('heading', { name: 'Holiday Property Booking' })).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: 'Foundation work starts here' })).toBeVisible();
|
||||
await expect(page.getByRole('link', { name: 'Review foundation' })).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: 'A few properties guests can imagine themselves in' })).toBeVisible();
|
||||
await expect(page.getByRole('link', { name: 'Contact the team' })).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user