Phase 5: data-driven, new-player-friendly character builder

Rebuilt CreationWizard to consume the structured ruleset data (Phase 7):
- Class step: rich class cards (description, hit die, key ability, caster, playstyle
  tag) + subclass picker, plus "ready-made hero" quick-start templates that prefill
  class + abilities for instant play.
- Origin step: searchable ancestry/race + background pickers with descriptions (auto
  speed/ancestry-HP where known).
- Abilities: key-ability hints from the chosen class. Skills: choices from class data.
- Spells step (casters only): searchable starting-spell picker → spellcasting.spells.
- Review applies derived build + data-driven saves (esp. PF2e classes).
- Updated the e2e helper + wizard spec to the new flow (class-card data-testid).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 15:35:15 +02:00
parent e1ba3fe1b9
commit 06615020f6
3 changed files with 251 additions and 153 deletions
+6 -2
View File
@@ -2,12 +2,16 @@ import { type Page } from '@playwright/test';
/**
* Walk the guided creation wizard and land on the new character's sheet.
* Uses the default class; selects the minimum required trained skills.
* Picks the Barbarian class (a non-caster, so there's no Spells step) and the
* default standard array; selects the minimum required trained skills.
*/
export async function createCharacter(page: Page, name: string): Promise<void> {
await page.getByRole('button', { name: '+ New character' }).first().click();
await page.getByLabel('Name').fill(name);
await page.getByRole('button', { name: 'Next' }).click(); // → Abilities (standard array is valid by default)
// Class step: pick a class card (waits for the data-driven list to load).
await page.getByTestId('class-card').filter({ hasText: 'Barbarian' }).click();
await page.getByRole('button', { name: 'Next' }).click(); // → Origin
await page.getByRole('button', { name: 'Next' }).click(); // → Abilities (standard array valid)
await page.getByRole('button', { name: 'Next' }).click(); // → Skills
const next = page.getByRole('button', { name: 'Next' });