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:
Dorian
2026-03-13 05:15:46 +00:00
co-authored by Claude Opus 4.6
parent a7520be0e7
commit 5bc8932d25
4 changed files with 109 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
import { test, expect } from '@playwright/test'
test.describe('bot registration flow', () => {
test('navigate to join page and see login step', async ({ page }) => {
await page.goto('/join')
// Should show login options
await expect(page.getByText(/sign in/i).first()).toBeVisible({ timeout: 10_000 })
})
test('generate new identity shows choose-mode step', async ({ page }) => {
await page.goto('/join')
// Click "Generate New Identity" button
const genButton = page.getByText(/generate new identity/i)
await genButton.click()
// Should advance to choose-mode step
await expect(page.getByText(/I BUILD BOTS/i)).toBeVisible({ timeout: 5_000 })
await expect(page.getByText(/I FIGHT MYSELF/i)).toBeVisible()
})
test('select bot mode shows archetype picker', async ({ page }) => {
await page.goto('/join')
// Generate identity
await page.getByText(/generate new identity/i).click()
await expect(page.getByText(/I BUILD BOTS/i)).toBeVisible({ timeout: 5_000 })
// Choose bot mode
await page.getByText(/I BUILD BOTS/i).click()
// Should show character/archetype picker
await expect(page.getByText(/pick.*character/i).first()).toBeVisible({ timeout: 5_000 })
})
})