Files
botfights/e2e/smoke.spec.ts
T
DorianandClaude Opus 4.6 a7520be0e7 test: add Playwright E2E infrastructure with smoke test
Set up Playwright with Chromium, dev server auto-start, test helpers
for seeding bots and programmatic auth. Added smoke spec that verifies
homepage and leaderboard load without crashes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 05:14:15 +00:00

20 lines
657 B
TypeScript

import { test, expect } from '@playwright/test'
test('homepage loads', async ({ page }) => {
await page.goto('/')
// Page should load without errors
await expect(page).toHaveTitle(/botfights/i)
})
test('leaderboard page loads', async ({ page }) => {
await page.goto('/leaderboard')
// Should render without console errors
const errors: string[] = []
page.on('console', msg => {
if (msg.type() === 'error') errors.push(msg.text())
})
await page.waitForTimeout(1000)
// Allow some errors (e.g., missing API data) but no crashes
expect(errors.filter(e => e.includes('TypeError') || e.includes('ReferenceError'))).toHaveLength(0)
})