feat(e2e): add Playwright E2E testing infrastructure and critical path tests
Set up Playwright with dual-project config (API + Web), auth test fixtures, 16 E2E tests covering registration, login, profile, token refresh, and homepage rendering. Added GitHub Actions CI workflow for automated E2E runs. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
39
e2e/web/homepage.spec.ts
Normal file
39
e2e/web/homepage.spec.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test.describe('Homepage', () => {
|
||||
test('loads and displays platform title', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
|
||||
await expect(page.locator('h1')).toContainText('GoodGo Platform');
|
||||
await expect(page.locator('p')).toContainText('Vietnam Real Estate Platform');
|
||||
});
|
||||
|
||||
test('has correct page title', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
|
||||
await expect(page).toHaveTitle(/GoodGo/i);
|
||||
});
|
||||
|
||||
test('renders without console errors', async ({ page }) => {
|
||||
const errors: string[] = [];
|
||||
page.on('console', (msg) => {
|
||||
if (msg.type() === 'error') errors.push(msg.text());
|
||||
});
|
||||
|
||||
await page.goto('/');
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
expect(errors).toHaveLength(0);
|
||||
});
|
||||
|
||||
test('is responsive — mobile viewport', async ({ page }) => {
|
||||
await page.setViewportSize({ width: 375, height: 667 });
|
||||
await page.goto('/');
|
||||
|
||||
const main = page.locator('main');
|
||||
await expect(main).toBeVisible();
|
||||
|
||||
const h1 = page.locator('h1');
|
||||
await expect(h1).toBeVisible();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user