feat: ship v1.2.0 Wave 1 foundation with book settings, chapter management, and focus mode
Deliver schema v9, book/chapter IPC extensions, BookSettingsTab, chapter meta/tags, AI session menu, focus mode and TTS, template context enrich, and Wave 1 E2E coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,7 +2,7 @@ import { mkdtempSync, rmSync, existsSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { tmpdir } from 'os'
|
||||
import { test, expect } from '@playwright/test'
|
||||
import { launchApp, skipOnboarding, createBookAndOpenEditor, ensureChapterEditor } from './helpers'
|
||||
import { launchApp, skipOnboarding, createBookAndOpenEditor, ensureChapterEditor, addCharacterSetting, dismissCockpitIfOpen } from './helpers'
|
||||
|
||||
test.describe('Chapter template', () => {
|
||||
let userDataDir: string
|
||||
@@ -40,4 +40,36 @@ test.describe('Chapter template', () => {
|
||||
|
||||
await app.close()
|
||||
})
|
||||
|
||||
test('E2E-TEMPL-05: characterList from settings in quick create', async () => {
|
||||
const app = await launchApp(userDataDir)
|
||||
const page = await app.firstWindow()
|
||||
await skipOnboarding(page)
|
||||
await createBookAndOpenEditor(page, '角色模板书')
|
||||
await addCharacterSetting(page, '林远')
|
||||
await addCharacterSetting(page, '苏晴')
|
||||
|
||||
await page.locator('#topbar .top-btn').filter({ hasText: '⚙' }).click()
|
||||
await page.getByTestId('settings-nav-templates').click()
|
||||
await page.getByTestId('setting-template-add').click()
|
||||
const customCard = page.locator('.template-settings-item').filter({ hasText: '新模板' }).last()
|
||||
await customCard.getByRole('button', { name: '编辑' }).click()
|
||||
await page.locator('.template-edit-panel textarea').fill('出场角色:{characterList}\n\n正文')
|
||||
await page.locator('#topbar .tab').filter({ hasText: '角色模板书' }).click()
|
||||
await expect(page.locator('#editor-layout')).toBeVisible({ timeout: 10_000 })
|
||||
await dismissCockpitIfOpen(page)
|
||||
await page.getByTestId('sidebar-tab-chapters').click()
|
||||
|
||||
await page.getByTestId('chapter-quick-new').click()
|
||||
await expect(page.getByTestId('template-quick-create-modal')).toBeVisible()
|
||||
await page.locator('.template-card').filter({ hasText: '新模板' }).click()
|
||||
await page.getByTestId('template-chapter-title').fill('角色章')
|
||||
await page.getByTestId('template-create-btn').click()
|
||||
|
||||
const editor = page.locator('.ProseMirror')
|
||||
await expect(editor).toContainText('林远', { timeout: 10_000 })
|
||||
await expect(editor).toContainText('苏晴')
|
||||
|
||||
await app.close()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user