npmrun
|
0c8d51a770
|
feat: add POST create endpoint and E2E tests for agent-documents
- POST /api/agent-documents for manual document creation
- E2E tests: list, detail, type filter, search, edit, delete, auth guard, nav
Co-authored-by: CodeFree <codefree@chinatelcom.cn>
|
2 months ago |
npmrun
|
d3e9e481fe
|
feat(e2e): add agent chat E2E tests with mock LLM server
- Add mock LLM server (OpenAI-compatible SSE streaming) on port 3600
- Inline mock LLM logic into global-setup to avoid ESM .ts import issues
- Seed LLM provider + model + userConfig in global-setup
- Add 10 agent chat E2E tests covering welcome page, input, send, streaming, history
- Fix stdio pipe for execSync in global-setup to prevent Playwright hang
- Login helper clicks new-chat button to avoid cross-test session pollution
- All 37 E2E tests pass (smoke 5 + auth 22 + agent-chat 10)
Co-authored-by: CodeFree <codefree@chinatelcom.cn>
|
2 months ago |
npmrun
|
71ce463e4d
|
feat: add E2E testing framework with Playwright
- Install @playwright/test@1.49.1, @nuxt/test-utils@3.15.4, dotenv-cli@7.4.4
- Add .env.test for test environment configuration
- Add E2E_TEST_MODE and E2E_FIXED_CAPTCHA env variables to schema
- Inject fixed captcha in challenge.ts when E2E_TEST_MODE is enabled
- Create e2e/ directory structure: specs/, helpers/, fixtures/
- Implement global-setup.ts: build → migrate → seed → spawn server
- Implement global-teardown.ts: stop server via PID
- Write 27 test cases across 4 spec files:
- smoke.spec.ts (5 tests): homepage, login/register pages, captcha API, config API
- auth-login.spec.ts (7 tests): UI login, toast, wrong password/captcha, redirect
- auth-register.spec.ts (6 tests): validation, success, duplicate, login after register
- auth-guard.spec.ts (9 tests): public/protected paths, authenticated access, API guard
- Add test:e2e, test:e2e:ui, test:e2e:headed scripts to package.json
- Update .gitignore for test artifacts (db.test.sqlite, test-results/, playwright-report/)
- Update CLAUDE.md with E2E testing architecture and guidelines
Test server: build + preview mode with isolated SQLite database
Captcha injection: business code branch gated by E2E_TEST_MODE env
All 27 tests passing.
Co-authored-by: CodeFree <codefree@chinatelcom.cn>
|
2 months ago |