PR 14: adds a tier-3.5 Playwright pass that opens every refactored page, clicks every visible button/link/role=button, and asserts no console errors, no app-side network 4xx/5xx, and no click-time exceptions. Helper: - tests/helpers/click-everything.ts — shared `clickEverythingOnPage` with default skips for destructive selectors (archive, delete, transfer, sign-out), auto-closing of dialogs, and return-to-start after navigation. Exhaustive specs (tests/e2e/exhaustive/): - 01-yachts: list + detail + transfer dialog - 02-companies: list + detail + add-membership dialog - 03-reservations: berth list + detail reservations tab + reserve dialog - 04-client-detail: list + detail walking every tab - 05-eoi-generate: generate dialog opens with Documenso option - 06-invoice-form: new-invoice dialog billing-entity toggle - 07-berths: list + detail walking every tab - 08-portal: client portal yachts / memberships / reservations - 09-navigation: every primary nav target loads cleanly Destructive specs (tests/e2e/destructive/): - 01-yacht-archive: create-via-API → archive via UI → assert removed. Skips with a clear message when the global setup does not seed an owner client (avoids brittle failures while the full destructive fixture lands). Playwright config: testDir hoisted to ./tests/e2e; new `exhaustive` and `destructive` projects share the existing setup project. New scripts test:e2e / test:e2e:smoke / test:e2e:exhaustive / test:e2e:destructive in package.json drive each project independently. CI integration deferred — no .github/workflows/* exists in this repo yet, so the PR 14 task to wire a separate CI job is N/A. The new projects will pick up automatically when a workflow lands. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
61 lines
2.3 KiB
TypeScript
61 lines
2.3 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
|
|
import { clickEverythingOnPage } from '../../helpers/click-everything';
|
|
import { login, navigateTo, PORT_SLUG } from '../smoke/helpers';
|
|
|
|
test.describe('exhaustive: yachts', () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await login(page, 'super_admin');
|
|
});
|
|
|
|
test('list page — every visible button/link is clickable without errors', async ({ page }) => {
|
|
await navigateTo(page, '/yachts');
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
const result = await clickEverythingOnPage(page);
|
|
expect(result.errors, JSON.stringify(result.errors, null, 2)).toEqual([]);
|
|
expect(result.clicked).toBeGreaterThan(0);
|
|
});
|
|
|
|
test('detail page — every tab + button (skipping destructive)', async ({ page }) => {
|
|
await navigateTo(page, '/yachts');
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
// Click into the first yacht row.
|
|
const firstRow = page.locator('tbody tr a, tbody tr button').first();
|
|
if (await firstRow.isVisible({ timeout: 3000 }).catch(() => false)) {
|
|
await firstRow.click();
|
|
await page.waitForURL(new RegExp(`/${PORT_SLUG}/yachts/[^/]+`), { timeout: 10_000 });
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
const result = await clickEverythingOnPage(page);
|
|
expect(result.errors, JSON.stringify(result.errors, null, 2)).toEqual([]);
|
|
} else {
|
|
test.skip(true, 'no yachts seeded — list is empty');
|
|
}
|
|
});
|
|
|
|
test('transfer-ownership dialog opens and closes cleanly', async ({ page }) => {
|
|
await navigateTo(page, '/yachts');
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
const firstRow = page.locator('tbody tr a, tbody tr button').first();
|
|
if (!(await firstRow.isVisible({ timeout: 3000 }).catch(() => false))) {
|
|
test.skip(true, 'no yachts seeded');
|
|
return;
|
|
}
|
|
await firstRow.click();
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
const transferBtn = page.getByRole('button', { name: /transfer/i }).first();
|
|
if (await transferBtn.isVisible({ timeout: 3000 }).catch(() => false)) {
|
|
await transferBtn.click();
|
|
const dialog = page.getByRole('dialog');
|
|
await expect(dialog).toBeVisible({ timeout: 5000 });
|
|
const cancel = dialog.getByRole('button', { name: /cancel|close/i }).first();
|
|
await cancel.click();
|
|
await expect(dialog).toBeHidden({ timeout: 5000 });
|
|
}
|
|
});
|
|
});
|