Files
commitea/apps/desktop/e2e/pages/app.page.ts
Croissant Le Doux 6879bedb13 feat(desktop): Focus + Standup screens + burn-up cone (#16)
First real P3 screens, replacing the placeholders:
- FocusScreen — Now/Next/Later cards (Now = jade + Start/Defer footer),
  each with #id, label tags, steeping badge, agent-font rationale, and
  a title link that drives the shell issue drill-in. Milestone card
  wraps the burn-up cone.
- StandupScreen — typeset letter: overnight drift (dot + delta), per-
  person plan (initials avatars), warn-tint stale-blocker nag; sections
  settle in on a 90ms stagger, reduced-motion-safe.
- charts/chart.tsx — BurnUpCone (actual polyline, forecast cone with
  dashed 80% bounds, jade today rule) + RunwayBar (for P3-5). Fixed
  sample geometry until P2 feeds it.

Fixtures (today/focus/standup) mirrored from data.js. Shell routes
focus/standup to the real screens; the drill-in now starts from a Focus
card. Screenshot helper freezes animations so fade-in screens capture
settled. typecheck + 9 e2e green; light/standup/states verified.

Closes P3-3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 12:40:37 -04:00

49 lines
1.7 KiB
TypeScript

import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { expect, type Locator, type Page } from '@playwright/test'
const here = dirname(fileURLToPath(import.meta.url))
/** Where `screenshot()` drops PNGs — gitignored, readable for visual review. */
const SCREENS_DIR = join(here, '..', '.artifacts', 'screens')
/**
* Page Object over the CommiTea app shell. As real screens land (P3), add
* per-screen page objects and accessor methods here; keep locators
* user-facing (getByRole/getByText), never CSS/DOM structure.
*/
export class AppPage {
constructor(readonly page: Page) {}
/** The rail wordmark — present on every in-app view. */
get wordmark(): Locator {
return this.page.getByText('CommiTea', { exact: true })
}
/** Navigate via a left-rail entry by its label. */
nav(label: string): Locator {
return this.page.getByRole('button', { name: label, exact: true })
}
/** Assert the shell has rendered. */
async expectLoaded(): Promise<void> {
await expect(this.wordmark).toBeVisible()
}
/** Read the `commitea` preload API surface from the renderer. */
async preloadApi(): Promise<Record<string, unknown> | undefined> {
return this.page.evaluate(
() => (globalThis as unknown as { commitea?: Record<string, unknown> }).commitea,
)
}
/** Capture a full-page screenshot for visual review; returns the path.
* `animations: 'disabled'` fast-forwards finite CSS animations to their end
* state, so fade-in screens (e.g. Standup) capture settled, not mid-fade. */
async screenshot(name: string): Promise<string> {
const path = join(SCREENS_DIR, `${name}.png`)
await this.page.screenshot({ path, fullPage: true, animations: 'disabled' })
return path
}
}