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
npmrun
7e04425f7d
feat(llm): add CRUD operations for providers and models
- Implemented GET, POST, PUT, DELETE endpoints for LLM providers and models.
- Added validation for provider and model IDs.
- Introduced functions to list, create, update, and delete providers and models in the service layer.
- Enhanced error handling for invalid inputs and non-existent resources.
- Updated database schema to include new provider and model management features.
3 months ago