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>
28 lines
945 B
TypeScript
28 lines
945 B
TypeScript
import { test, expect } from '@playwright/test'
|
|
|
|
test.describe('leaderboard', () => {
|
|
test('leaderboard page loads and shows rankings header', async ({ page }) => {
|
|
await page.goto('/leaderboard')
|
|
|
|
// Should show the rankings header
|
|
await expect(page.getByText(/rankings/i).first()).toBeVisible({ timeout: 10_000 })
|
|
})
|
|
|
|
test('leaderboard has season toggle buttons', async ({ page }) => {
|
|
await page.goto('/leaderboard')
|
|
|
|
// Should have season/alltime toggle
|
|
await expect(page.getByText(/this season/i).first()).toBeVisible({ timeout: 10_000 })
|
|
await expect(page.getByText(/all time/i).first()).toBeVisible()
|
|
})
|
|
|
|
test('leaderboard shows tier column headers', async ({ page }) => {
|
|
await page.goto('/leaderboard')
|
|
await page.waitForTimeout(2000)
|
|
|
|
// Should show table headers for rankings
|
|
const content = await page.textContent('body')
|
|
expect(content).toMatch(/elo|tier|fighter/i)
|
|
})
|
|
})
|