Base URL: http://localhost:3000 (or your deployed server URL)
POST /results
Creates a new test result entry for a PR.
Request Body:
{
"prLink": "https://github.com/user/repo/pull/123",
"prName": "Feature: Add user authentication"
}Response:
{
"success": true,
"message": "Result created successfully",
"data": {
"id": 1,
"created_at": "2024-01-15T10:30:00.000Z",
"pr_link": "https://github.com/user/repo/pull/123",
"pr_name": "Feature: Add user authentication",
"overall_result": {},
"run_status": "RUNNING"
}
}PATCH /results/:id
Updates the overall success status of a test result.
Request Body:
{
"resSuccess": true
}Response:
{
"success": true,
"message": "Result updated successfully",
"data": {
"id": 1,
"created_at": "2024-01-15T10:30:00.000Z",
"pr_link": "https://github.com/user/repo/pull/123",
"pr_name": "Feature: Add user authentication",
"overall_result": {"passed": 8, "failed": 2, "total": 10},
"run_status": "PASSED"
}
}GET /results
Retrieves all test results, ordered by creation date (newest first).
Response:
{
"success": true,
"data": [
{
"id": 1,
"created_at": "2024-01-15T10:30:00.000Z",
"pr_link": "https://github.com/user/repo/pull/123",
"pr_name": "Feature: Add user authentication",
"overall_result": {"passed": 8, "failed": 2, "total": 10},
"run_status": "PASSED"
}
]
}POST /suites
Creates a new test suite linked to a result.
Request Body:
{
"resultId": 1,
"name": "Authentication Flow Tests",
"s3Link": "https://bucket.s3.amazonaws.com/video_123.mp4",
"suitesSuccess": false
}Response:
{
"success": true,
"message": "Suite created successfully",
"data": {
"id": 1,
"created_at": "2024-01-15T10:35:00.000Z",
"result_id": 1,
"name": "Authentication Flow Tests"
}
}PATCH /suites/:id
Updates suite success status and/or S3 link.
Request Body:
{
"suitesSuccess": true,
"s3Link": "https://bucket.s3.amazonaws.com/video_123_updated.mp4"
}Response:
{
"success": true,
"message": "Suite updated successfully",
"data": {
"id": 1,
"created_at": "2024-01-15T10:35:00.000Z",
"result_id": 1,
"name": "Authentication Flow Tests"
}
}GET /results/:id/suites
Retrieves all test suites for a specific result.
Response:
{
"success": true,
"data": [
{
"id": 1,
"created_at": "2024-01-15T10:35:00.000Z",
"result_id": 1,
"name": "Authentication Flow Tests"
}
]
}POST /tests
Creates a new individual test linked to a suite.
Request Body:
{
"suiteId": 1,
"name": "Login with valid credentials",
"summary": "Test successful login flow with email and password",
"testSuccess": true
}Response:
{
"success": true,
"message": "Test created successfully",
"data": {
"id": 1,
"created_at": "2024-01-15T10:40:00.000Z",
"suite_id": 1,
"name": "Login with valid credentials",
"summary": "Test successful login flow with email and password",
"test_success": true,
"run_status": "RUNNING",
"steps": [],
"s3_link": null
}
}PATCH /tests/:id
Updates test success status and/or summary.
Request Body:
{
"testSuccess": false,
"summary": "Test failed due to timeout on login button click"
}Response:
{
"success": true,
"message": "Test updated successfully",
"data": {
"id": 1,
"created_at": "2024-01-15T10:40:00.000Z",
"suite_id": 1,
"name": "Login with valid credentials",
"summary": "Test failed due to timeout on login button click",
"test_success": false,
"run_status": "FAILED",
"steps": ["Click Login", "Observe error"],
"s3_link": "https://bucket.s3.amazonaws.com/video_123.mp4"
}
}GET /suites/:id/tests
Retrieves all individual tests for a specific suite.
Response:
{
"success": true,
"data": [
{
"id": 1,
"created_at": "2024-01-15T10:40:00.000Z",
"suite_id": 1,
"name": "Login with valid credentials",
"summary": "Test successful login flow with email and password",
"test_success": true,
"run_status": "PASSED",
"steps": ["Open login page", "Enter credentials", "Submit", "Verify dashboard"],
"s3_link": "https://bucket.s3.amazonaws.com/video_123.mp4"
}
]
}POST /upload-video
Uploads a video file to S3 storage.
Request: Multipart form data with video field
Response:
{
"success": true,
"message": "Video uploaded successfully",
"fileUrl": "https://bucket.s3.amazonaws.com/video_1642248000000_test.mp4",
"fileName": "video_1642248000000_test.mp4"
}POST /upload-data
Uploads JSON data to Supabase table.
Request Body: Any JSON object
Response:
{
"success": true,
"message": "Data uploaded successfully",
"data": [...]
}All endpoints return error responses in this format:
{
"error": "Error message describing what went wrong"
}Common HTTP status codes:
400- Bad Request (missing required fields)500- Internal Server Error (database/S3 errors)
CREATE TABLE public.results (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
created_at timestamptz NOT NULL DEFAULT now(),
pr_link text,
pr_name text,
overall_result jsonb,
run_status text -- e.g., 'QUEUED' | 'RUNNING' | 'PASSED' | 'FAILED'
);CREATE TABLE public.suites (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
created_at timestamptz NOT NULL DEFAULT now(),
result_id bigint REFERENCES public.results(id) ON DELETE CASCADE,
name text,
);CREATE TABLE public.tests (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
created_at timestamptz NOT NULL DEFAULT now(),
suite_id bigint REFERENCES public.suites(id) ON DELETE CASCADE,
name text,
summary text,
test_success boolean,
run_status text, -- e.g., 'QUEUED' | 'RUNNING' | 'PASSED' | 'FAILED'
steps jsonb DEFAULT '[]'::jsonb,
s3_link text,
);Note:
- Foreign keys
suites.result_idandtests.suite_idenable nested selects likeresults.select('*, suites(*, tests(*))'). - Column names use snake_case for consistency with the pipeline and backend.
POST /results- Create result entryPOST /suites- Create suite entries (withsuitesSuccess: false)POST /tests- Create test entries (withtestSuccess: false)- Execute agents...
PATCH /tests/:id- Update individual test resultsPATCH /suites/:id- Update suite resultsPATCH /results/:id- Update overall result
- Execute agents...
POST /results- Create result with final statusPOST /suites- Create suites with final resultsPOST /tests- Create tests with final results