diff --git a/packages/core/tests/integration/prompt/service.integration.test.ts b/packages/core/tests/integration/prompt/service.integration.test.ts index 9c2dd9ff..ba9e1760 100644 --- a/packages/core/tests/integration/prompt/service.integration.test.ts +++ b/packages/core/tests/integration/prompt/service.integration.test.ts @@ -18,9 +18,10 @@ import { TextAdapterRegistry } from '../../../src/services/llm/adapters/registry */ describe('PromptService Integration Tests', () => { const hasGeminiKey = !!process.env.VITE_GEMINI_API_KEY; - const DELAY_BETWEEN_TESTS = 6000; // 1分钟延迟避免速率限制 + const DELAY_BETWEEN_TESTS = 60000; // 1分钟延迟避免速率限制 const TEST_TIMEOUT = 120000; // 2分钟超时 + let promptService: PromptService; let modelManager: ModelManager; let llmService: any; diff --git a/packages/ui/env.d.ts b/packages/ui/env.d.ts index 128cde31..8ca741af 100644 --- a/packages/ui/env.d.ts +++ b/packages/ui/env.d.ts @@ -9,5 +9,10 @@ declare module '*.vue' { // Vite 已经通过 /// 提供了内置的环境变量类型 +// E2E: 注入到 window 的测试辅助变量 +interface Window { + __TEST_DB_NAME__?: string +} + // 引入 Electron 类型定义 -/// \ No newline at end of file +/// diff --git a/packages/ui/src/components/FavoriteManager.vue b/packages/ui/src/components/FavoriteManager.vue index 2542ed2f..b959038f 100644 --- a/packages/ui/src/components/FavoriteManager.vue +++ b/packages/ui/src/components/FavoriteManager.vue @@ -58,7 +58,7 @@ :options="actionMenuOptions" @select="handleActionMenuSelect" > - + @@ -475,12 +475,14 @@ const actionMenuOptions = computed(() => [ { label: t('favorites.manager.actions.manageTags'), key: 'manageTags', - icon: () => h(NIcon, null, { default: () => h(Tags) }) + icon: () => h(NIcon, null, { default: () => h(Tags) }), + props: { 'data-testid': 'favorites-manager-action-manage-tags' } }, { label: t('favorites.manager.actions.manageCategories'), key: 'manageCategories', - icon: () => h(NIcon, null, { default: () => h(Folder) }) + icon: () => h(NIcon, null, { default: () => h(Folder) }), + props: { 'data-testid': 'favorites-manager-action-manage-categories' } }, { type: 'divider' @@ -488,7 +490,8 @@ const actionMenuOptions = computed(() => [ { label: t('favorites.manager.actions.export'), key: 'export', - icon: () => h(NIcon, null, { default: () => h(Download) }) + icon: () => h(NIcon, null, { default: () => h(Download) }), + props: { 'data-testid': 'favorites-manager-action-export' } }, { type: 'divider' @@ -496,7 +499,8 @@ const actionMenuOptions = computed(() => [ { label: t('favorites.manager.actions.clear'), key: 'clear', - icon: () => h(NIcon, null, { default: () => h(Trash) }) + icon: () => h(NIcon, null, { default: () => h(Trash) }), + props: { 'data-testid': 'favorites-manager-action-clear' } } ]); diff --git a/packages/ui/src/components/FunctionModeSelector.vue b/packages/ui/src/components/FunctionModeSelector.vue index 800bfa9e..41f4bb08 100644 --- a/packages/ui/src/components/FunctionModeSelector.vue +++ b/packages/ui/src/components/FunctionModeSelector.vue @@ -1,24 +1,27 @@