From 0a054606fe6e2204742e2d6d69912f203d3848e1 Mon Sep 17 00:00:00 2001 From: kun1h Date: Mon, 6 Jul 2026 17:01:25 +0800 Subject: [PATCH] chore: ignore test-results and raise AI test timeouts Co-authored-by: Cursor --- .gitignore | 1 + e2e/ai-chat.spec.ts | 10 +++++----- playwright.config.ts | 2 +- tests/main/ai-client.test.ts | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index e8e1c78..d69041e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ Thumbs.db release/ *.novel *.novel-all +test-results/ diff --git a/e2e/ai-chat.spec.ts b/e2e/ai-chat.spec.ts index dfa67a3..845649f 100644 --- a/e2e/ai-chat.spec.ts +++ b/e2e/ai-chat.spec.ts @@ -88,7 +88,7 @@ test.describe('AI chat', () => { }) test('E2E-P3-CHAT-01: send message and receive assistant reply', async () => { - test.setTimeout(120_000) + test.setTimeout(180_000) const app = await launchApp(userDataDir) const page = await app.firstWindow() @@ -105,7 +105,7 @@ test.describe('AI chat', () => { await page.getByTestId('ai-send').click() const assistant = page.getByTestId('chat-message-assistant').last() - await expect(assistant).toBeVisible({ timeout: 90_000 }) + await expect(assistant).toBeVisible({ timeout: 120_000 }) await expect(assistant).not.toBeEmpty() await app.close() @@ -138,7 +138,7 @@ test.describe('AI chat', () => { }) test('E2E-P3-CMD-01: slash summarize command sends and receives reply', async () => { - test.setTimeout(120_000) + test.setTimeout(180_000) const app = await launchApp(userDataDir) const page = await app.firstWindow() @@ -151,9 +151,9 @@ test.describe('AI chat', () => { await expect(page.getByTestId('ai-send')).toBeEnabled() await page.getByTestId('ai-send').click() - await expect(page.getByTestId('chat-message-user').last()).toContainText('/总结', { timeout: 90_000 }) + await expect(page.getByTestId('chat-message-user').last()).toContainText('/总结', { timeout: 120_000 }) const assistant = page.getByTestId('chat-message-assistant').last() - await expect(assistant).toBeVisible({ timeout: 90_000 }) + await expect(assistant).toBeVisible({ timeout: 120_000 }) await app.close() }) diff --git a/playwright.config.ts b/playwright.config.ts index 81789ea..56de3f8 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -2,7 +2,7 @@ import { defineConfig } from '@playwright/test' export default defineConfig({ testDir: './e2e', - timeout: 120_000, + timeout: 180_000, workers: 1, globalSetup: './e2e/global-setup.ts', use: { diff --git a/tests/main/ai-client.test.ts b/tests/main/ai-client.test.ts index 0db6593..7081911 100644 --- a/tests/main/ai-client.test.ts +++ b/tests/main/ai-client.test.ts @@ -8,5 +8,5 @@ describe('AiClientService', () => { it('IT-AI-01: chat returns non-empty content from LM Studio', async () => { const content = await client.chat([{ role: 'user', content: '回复一个字:好' }]) expect(content.trim().length).toBeGreaterThan(0) - }, 90_000) + }, 180_000) })