import { dirname, join } from 'node:path' import { fileURLToPath } from 'node:url' import { _electron as electron, expect, test } from '@playwright/test' const here = dirname(fileURLToPath(import.meta.url)) const MAIN = join(here, '..', 'out', 'main', 'index.js') // Opt-in (GITEA_LIVE=1 + COMMITEA_MODEL_LIVE=1 + a local model on :1234). Launches // WITHOUT COMMITEA_E2E so Reginald runs the real agent loop against the real repo. test.describe('live Reginald', () => { test('answers a question by consulting the real project', async () => { test.skip(!process.env.GITEA_LIVE || !process.env.COMMITEA_MODEL_LIVE, 'live model test — opt-in') test.setTimeout(120_000) const app = await electron.launch({ args: [MAIN], env: { ...process.env } }) const win = await app.firstWindow() await win.waitForLoadState('domcontentloaded') // model configured → the live greeting + header, not the scripted demo await expect(win.getByText('gemma-4 · local')).toBeVisible({ timeout: 20000 }) await expect(win.getByText(/I check the real board before I answer/)).toBeVisible() const composer = win.getByPlaceholder(/Tell me what to do/) await composer.fill('What should I work on right now?') await composer.press('Enter') // the agent loop ran end-to-end: it consulted the project, then answered await expect(win.getByText(/consulted the project/)).toBeVisible({ timeout: 90_000 }) await win.screenshot({ path: join(here, '.artifacts', 'screens', 'live-reginald.png'), fullPage: true, animations: 'disabled' }) await app.close() }) })