522ff8abce
- Ability generation: standard array, point buy (27-pt, validated), 4d6kh3 roll; AbilityGenModal with assign-from-pool + steppers (pure abilityGen lib + tests) - Level-up flow: increment level, HP gain (average or roll hit die + CON) - Print / save-to-PDF: print button + @media print hides app chrome and roll tray - Plan: added Phase 11 (data-driven Assistant) to the roadmap Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
32 lines
1.3 KiB
TypeScript
32 lines
1.3 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
await page.goto('/');
|
|
await page.evaluate(async () => {
|
|
indexedDB.deleteDatabase('ttrpg-manager');
|
|
localStorage.clear();
|
|
});
|
|
await page.reload();
|
|
});
|
|
|
|
test('generate ability scores and level up', async ({ page }) => {
|
|
await page.getByRole('button', { name: '+ New campaign' }).first().click();
|
|
await page.locator('input[data-autofocus]').fill('Build');
|
|
await page.getByRole('button', { name: 'Create' }).click();
|
|
await page.getByRole('link', { name: 'Characters' }).click();
|
|
await page.getByRole('button', { name: '+ New character' }).first().click();
|
|
await page.locator('input[data-autofocus]').fill('Builder');
|
|
await page.getByRole('button', { name: 'Create' }).click();
|
|
await page.getByRole('link', { name: /Builder/ }).click();
|
|
|
|
// Generate scores via standard array (default assignment 15,14,13,12,10,8)
|
|
await page.getByRole('button', { name: 'Generate' }).click();
|
|
await page.getByRole('button', { name: 'Apply' }).click();
|
|
await expect(page.getByLabel('STR score')).toHaveValue('15');
|
|
|
|
// Level up from 1 -> 2
|
|
await page.getByRole('button', { name: 'Level up' }).click();
|
|
await page.getByRole('button', { name: 'Level up' }).last().click();
|
|
await expect(page.getByRole('spinbutton', { name: 'Level', exact: true })).toHaveValue('2');
|
|
});
|