Muthukumarank commited on
Commit
68cab26
·
verified ·
1 Parent(s): 5cf5368

Add backend/app/api/frameworks.py — universal LLM provider + complete API

Browse files
Files changed (1) hide show
  1. backend/app/api/frameworks.py +50 -0
backend/app/api/frameworks.py ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ TestGenius AI — Supported Frameworks Endpoint
3
+ """
4
+
5
+ from fastapi import APIRouter
6
+
7
+ router = APIRouter(prefix="/api/v1", tags=["frameworks"])
8
+
9
+ SUPPORTED_FRAMEWORKS = {
10
+ "python": [
11
+ {"id": "pytest", "name": "pytest", "description": "Python testing framework (recommended)", "test_types": ["unit", "integration", "edge_case", "security"]},
12
+ {"id": "unittest", "name": "unittest", "description": "Python standard library testing", "test_types": ["unit", "integration"]},
13
+ ],
14
+ "javascript": [
15
+ {"id": "jest", "name": "Jest", "description": "JavaScript testing framework by Meta", "test_types": ["unit", "integration", "edge_case"]},
16
+ {"id": "mocha", "name": "Mocha + Chai", "description": "Flexible JS test framework", "test_types": ["unit", "integration"]},
17
+ {"id": "cypress", "name": "Cypress", "description": "E2E testing for web applications", "test_types": ["e2e", "ui", "edge_case"]},
18
+ {"id": "playwright", "name": "Playwright", "description": "Cross-browser E2E testing", "test_types": ["e2e", "ui"]},
19
+ ],
20
+ "typescript": [
21
+ {"id": "jest", "name": "Jest + ts-jest", "description": "Jest with TypeScript support", "test_types": ["unit", "integration", "edge_case"]},
22
+ {"id": "vitest", "name": "Vitest", "description": "Vite-native testing framework", "test_types": ["unit", "integration"]},
23
+ {"id": "playwright", "name": "Playwright", "description": "E2E with TypeScript", "test_types": ["e2e", "ui"]},
24
+ ],
25
+ "go": [
26
+ {"id": "go_testing", "name": "Go testing", "description": "Go standard library testing", "test_types": ["unit", "integration"]},
27
+ ],
28
+ "java": [
29
+ {"id": "junit", "name": "JUnit 5", "description": "Java testing framework", "test_types": ["unit", "integration"]},
30
+ ],
31
+ }
32
+
33
+ TEST_TYPES = [
34
+ {"id": "unit", "name": "Unit Tests", "description": "Test individual functions/methods in isolation", "icon": "🟢"},
35
+ {"id": "integration", "name": "Integration Tests", "description": "Test API endpoints and service interactions", "icon": "🔵"},
36
+ {"id": "edge_case", "name": "Edge Case Tests", "description": "Boundary values, null inputs, concurrent access", "icon": "🟡"},
37
+ {"id": "security", "name": "Security Tests", "description": "SQL injection, XSS, auth bypass attempts", "icon": "🔴"},
38
+ {"id": "e2e", "name": "E2E Tests", "description": "Full user journey through the application", "icon": "🟣"},
39
+ {"id": "ui", "name": "UI Tests", "description": "Form validation, responsive design, error states", "icon": "⚪"},
40
+ ]
41
+
42
+
43
+ @router.get("/frameworks", summary="List supported test frameworks")
44
+ async def list_frameworks():
45
+ return {"frameworks": SUPPORTED_FRAMEWORKS, "test_types": TEST_TYPES}
46
+
47
+
48
+ @router.get("/languages", summary="List supported languages")
49
+ async def list_languages():
50
+ return {"languages": list(SUPPORTED_FRAMEWORKS.keys())}