861e14503b
## Summary - Fix `isProductionDatabase()` to allow CI database (`euchre_camp_ci`) - Add database schema reset before CI test runs - Create `global.teardown.ts` for cleanup (CI: full reset, dev/prod: selective cleanup) - Add `acceptance-tests` job to PR workflow with CI database - Create `sync-prod-to-dev.js` script for one-way prod→dev sync - Add `just` recipes: `sync-dev`, `test-prod`, `reset-ci-db` - Store credentials in `.credentials` (gitignored) with unique CI user ## Testing Verified against CI database: - Schema reset works - Migrations apply correctly - Test users created successfully - 219 tests pass (slow but working) ## Next Steps - Set `CI_DATABASE_URL` as Gitea repository variable Reviewed-on: #35 Co-authored-by: David Gwilliam <dhgwilliam@gmail.com> Co-committed-by: David Gwilliam <dhgwilliam@gmail.com>
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('http://localhost:3000/rankings');
|
|
|
|
// Check page title or heading
|
|
await expect(page.locator('h1, h2')).toContainText(/rankings?/i);
|
|
|
|
// Check for rankings table
|
|
await expect(page.locator('table')).toBeVisible();
|
|
});
|
|
|
|
test('Rankings table displays player columns', async ({ page }) => {
|
|
await page.goto('http://localhost:3000/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('http://localhost:3000/rankings');
|
|
|
|
// Page should load without redirecting to login
|
|
await expect(page).toHaveURL(/.*rankings.*/);
|
|
await expect(page.locator('body')).toBeVisible();
|
|
});
|
|
});
|