test: E2E specs for signup, fight replay, and leaderboard flows
Bot registration (3 tests), human registration (1 test), fight replay (2 tests for JS error checking), and leaderboard (3 tests for rendering). All use Playwright with text-based selectors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
a7520be0e7
commit
5bc8932d25
@@ -0,0 +1,31 @@
|
||||
import { test, expect } from '@playwright/test'
|
||||
|
||||
test.describe('fight replay', () => {
|
||||
test('arena page loads without JS errors', async ({ page }) => {
|
||||
const jsErrors: string[] = []
|
||||
page.on('pageerror', err => jsErrors.push(err.message))
|
||||
|
||||
await page.goto('/arena')
|
||||
await page.waitForTimeout(2000)
|
||||
|
||||
// Filter out expected errors (e.g., missing API data in test env)
|
||||
const criticalErrors = jsErrors.filter(e =>
|
||||
e.includes('TypeError') || e.includes('ReferenceError') || e.includes('SyntaxError')
|
||||
)
|
||||
expect(criticalErrors).toHaveLength(0)
|
||||
})
|
||||
|
||||
test('fight page with invalid ID shows error gracefully', async ({ page }) => {
|
||||
const jsErrors: string[] = []
|
||||
page.on('pageerror', err => jsErrors.push(err.message))
|
||||
|
||||
await page.goto('/arena/nonexistent-fight-id')
|
||||
await page.waitForTimeout(2000)
|
||||
|
||||
// Should not crash — may show error state or redirect
|
||||
const criticalErrors = jsErrors.filter(e =>
|
||||
e.includes('ReferenceError') || e.includes('SyntaxError')
|
||||
)
|
||||
expect(criticalErrors).toHaveLength(0)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user