a0872d07ef
- cucumber: use 'progress' formatter in CI (not progress-bar TTY) - csv-upload: use timestamp in player names to avoid unique constraint - elo-ratings: delete event_participants before players (FK constraint) - epic3-rankings: use .first() on h1/h2 locator (strict mode) - schedule-tab: look for button instead of anchor for Schedule tab - team-config: wait for search input before filling (step 2 async) - tournament-edit-allowTies: check for 'Edit Tournament' not 'Tournament Name' - epic4-tournament-creation: submit button only on step 2, add waitForSelector
48 lines
1.5 KiB
TypeScript
48 lines
1.5 KiB
TypeScript
/**
|
|
* Epic 3: Rankings & Public Data
|
|
* Acceptance Test: Player Rankings Page
|
|
*
|
|
* User Story: As a visitor, I want to view player rankings so that I can see top players
|
|
*
|
|
* Acceptance Criteria:
|
|
* - Sortable rankings table
|
|
* - Columns: Rank, Name, Elo, Win Rate, Games Played
|
|
* - Search/filter functionality
|
|
* - Pagination
|
|
*/
|
|
|
|
import { test, expect } from '@playwright/test';
|
|
|
|
test.describe('Epic 3: Rankings Page', () => {
|
|
test('Rankings page loads and displays rankings table', async ({ page }) => {
|
|
await page.goto('/rankings');
|
|
|
|
// Check page title or heading - use .first() since page may have both h1 and h2
|
|
await expect(page.locator('h1, h2').first()).toContainText(/rankings?/i);
|
|
|
|
// Check for rankings table
|
|
await expect(page.locator('table')).toBeVisible();
|
|
});
|
|
|
|
test('Rankings table displays player columns', async ({ page }) => {
|
|
await page.goto('/rankings');
|
|
|
|
// Check for expected column headers
|
|
const table = page.locator('table');
|
|
await expect(table).toBeVisible();
|
|
|
|
// Check for column headers (may vary based on implementation)
|
|
const headerCount = await page.locator('th').count();
|
|
expect(headerCount).toBeGreaterThan(0);
|
|
});
|
|
|
|
test('Rankings page is publicly accessible (no login required)', async ({ page }) => {
|
|
// Navigate directly to rankings without logging in
|
|
await page.goto('/rankings');
|
|
|
|
// Page should load without redirecting to login
|
|
await expect(page).toHaveURL(/.*rankings.*/);
|
|
await expect(page.locator('body')).toBeVisible();
|
|
});
|
|
});
|