Files
bscscore/tests/recordings/2-9-ball-race5-winner.ts
Frank Schwenk 65aaa92359 Add Playwright E2E testing with recorded workflows
- Add @playwright/test as dev dependency
- Create playwright.config.ts with Chrome-only testing config
- Add npm scripts: test:record, test:e2e, test:replay
- Create 13 test recordings covering:
  - 2-player and 3-player games
  - 8-ball, 9-ball, and 10-ball game types
  - Various race-to values (1, 3, 5, 7, 9) and "endlos" mode
  - Both wechselbreak (alternating) and winnerbreak rules
- Fix Infinity handling in gameService.ts and NewGameScreen.tsx
  - Parse "endlos" and "Infinity" strings as Infinity number
  - Properly serialize Infinity as string in form data
- Increase GameDetail score font size from 20vh to 40vh
- Update README.md with testing documentation:
  - Quick start guide for recording and running tests
  - Move E2E testing from "Future Improvements" (now implemented)
- Add comprehensive tests/recordings/README.md documentation

Purpose: Establishes browser automation testing infrastructure with
real workflow recordings, enabling regression testing and interaction
documentation for all game configuration combinations.
2025-10-31 14:41:36 +01:00

27 lines
1.6 KiB
TypeScript

import { test, expect } from '@playwright/test';
test('test', async ({ page }) => {
await page.goto('http://localhost:3000/');
await page.getByRole('button', { name: 'Neues Spiel starten' }).click();
await page.getByRole('textbox', { name: 'Name Spieler' }).click();
await page.getByRole('textbox', { name: 'Name Spieler' }).fill('Alice');
await page.getByRole('button', { name: 'Weiter' }).click();
await page.getByRole('textbox', { name: 'Name Spieler' }).click();
await page.getByRole('textbox', { name: 'Name Spieler' }).fill('Bob');
await page.getByRole('button', { name: 'Weiter' }).click();
await page.getByRole('button', { name: 'Überspringen' }).click();
await page.getByRole('button', { name: '9-Ball' }).click();
await page.getByRole('button', { name: '5' }).click();
await page.getByRole('button', { name: 'Break-Regel wählen: Winnerbreak' }).click();
await page.getByRole('button', { name: 'Zuerst: Alice' }).click();
await page.getByRole('button', { name: 'Aktueller Punktestand für Alice' }).click();
await page.getByRole('button', { name: 'Aktueller Punktestand für Bob' }).click();
await page.getByRole('button', { name: 'Aktueller Punktestand für Alice' }).click();
await page.getByRole('button', { name: 'Aktueller Punktestand für Alice' }).click();
await page.getByRole('button', { name: 'Aktueller Punktestand für Alice' }).click();
await page.getByRole('button', { name: 'Aktueller Punktestand für Alice' }).click();
await page.getByRole('button', { name: 'Bestätigen' }).click();
await page.getByRole('button', { name: 'Zurück zur Liste' }).click();
});