fix(test): stabilize E2E cockpit flow and add LM Studio novel integration test
Harden cockpit dismiss timing and global settings navigation in E2E helpers, tune short-chapter AI prompts for local models, fix electron-updater CJS loading, and add a 10-chapter auto-writing integration test against LM Studio. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -27,9 +27,12 @@ async function skipOnboarding(page: Page): Promise<void> {
|
||||
|
||||
async function dismissCockpitIfOpen(page: Page): Promise<void> {
|
||||
const cockpit = page.locator('[data-testid="cockpit-modal"]')
|
||||
if (await cockpit.isVisible({ timeout: 3000 }).catch(() => false)) {
|
||||
await page.locator('[data-testid="cockpit-modal"] .modal-close').click()
|
||||
try {
|
||||
await cockpit.waitFor({ state: 'visible', timeout: 15_000 })
|
||||
await cockpit.locator('.modal-close').click()
|
||||
await expect(cockpit).toBeHidden({ timeout: 5000 })
|
||||
} catch {
|
||||
/* cockpit did not open */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +76,7 @@ test.describe('Knowledge extraction P5.2', () => {
|
||||
|
||||
await page.locator('[data-testid="panel-tab-knowledge"]').click()
|
||||
await expect(page.locator('[data-testid="knowledge-panel"]')).toBeVisible()
|
||||
await page.locator('[data-testid="knowledge-tab-pending"]').click()
|
||||
await expect(page.locator('[data-testid="knowledge-extract-current"]')).toBeVisible()
|
||||
await expect(page.locator('[data-testid="knowledge-batch-high-confidence"]')).toBeVisible()
|
||||
await app.close()
|
||||
@@ -82,9 +86,10 @@ test.describe('Knowledge extraction P5.2', () => {
|
||||
const app = await launchApp(userDataDir)
|
||||
const page = await app.firstWindow()
|
||||
await skipOnboarding(page)
|
||||
await createAndOpenBook(page, '设置测试')
|
||||
await createAndOpenBook(page, '全局设置测试')
|
||||
|
||||
await page.getByRole('button', { name: '设置' }).click()
|
||||
await page.getByTestId('topbar-settings').click()
|
||||
await expect(page.locator('#settings-page')).toBeVisible({ timeout: 10_000 })
|
||||
await expect(page.locator('[data-testid="settings-knowledge-auto-extract"]')).toBeVisible()
|
||||
await expect(page.locator('[data-testid="settings-extract-threshold"]')).toBeVisible()
|
||||
await app.close()
|
||||
|
||||
Reference in New Issue
Block a user