- Fix E2E Playwright config: correct port 5173→9101, increase webServer timeout - Fix signup-bot and signup-human specs: add missing nsec backup step - Implement scoreCreativeAnswer() heuristic for creative round scoring - Pass DB ELO to generateMockBotResponse for non-MOCK_BOTS integration tests - Update challenges tests: all 16 types are now factual (no creative types) - Fix lifecycle test flakiness: widen ELO correlation tolerance, add timeout - All 11 E2E specs pass, 770 unit/integration tests pass Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
44 lines
1.6 KiB
TypeScript
44 lines
1.6 KiB
TypeScript
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()
|
|
|
|
// Must save nsec first — click "I SAVED IT — CONTINUE"
|
|
await expect(page.getByText(/saved it/i).first()).toBeVisible({ timeout: 5_000 })
|
|
await page.getByText(/saved it/i).first().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()
|
|
|
|
// Save nsec step
|
|
await expect(page.getByText(/saved it/i).first()).toBeVisible({ timeout: 5_000 })
|
|
await page.getByText(/saved it/i).first().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(/choose your fighter/i).first()).toBeVisible({ timeout: 5_000 })
|
|
})
|
|
})
|