Skip to content

added functionality to add screenshots in run and tests#87

Open
mayankkush1 wants to merge 5 commits into
masterfrom
feat/screenshot-in-tests
Open

added functionality to add screenshots in run and tests#87
mayankkush1 wants to merge 5 commits into
masterfrom
feat/screenshot-in-tests

Conversation

@mayankkush1

Copy link
Copy Markdown
Contributor

PR: Add Media Attachments for Test Cases

Summary

This PR adds the ability to attach screenshots and videos to test cases, supporting both "Expected Behavior" (attached during test creation/edit) and "Actual Behavior" (attached during test runs).

Features

Storage Layer

  • Abstracted storage interface with support for Local, AWS S3, and GCS providers
  • Dynamic provider loading - cloud SDKs only loaded when configured
  • Presigned URL support for direct client uploads

Database

  • New testAttachments table for expected behavior media
  • New runAttachments table for actual behavior media
  • Automatic migration runner for Docker deployments

API Endpoints

  • GET/POST/DELETE /api/v1/test/attachments/* - Test attachment CRUD
  • GET/POST/DELETE /api/v1/run/attachments/* - Run attachment CRUD
  • GET /api/v1/attachments/serve/* - Local file serving

UI Components

  • MediaUploader - Drag & drop upload with progress
  • MediaGallery - Thumbnail grid with lightbox
  • MediaViewer - Full-screen viewer with left/right navigation
  • DeleteConfirmDialog - Confirmation before deletion
  • Soft delete - Mark for deletion, only applied on save

Integration Points

  • Edit Test page - Upload/manage expected behavior attachments
  • Test Detail page - View expected + actual behavior
  • Test Detail Sliding Panel - Quick preview of all attachments
  • RBAC permissions for attachment operations

Screenshots

Feature Description
Upload Area Drag & drop zone with file type/size info
Gallery View Thumbnail grid with delete buttons
Lightbox Full-screen with ← → navigation
Soft Delete Greyed thumbnails with undo option

Configuration

# Storage provider: local (default), s3, or gcs
STORAGE_PROVIDER=local
STORAGE_LOCAL_PATH=./uploads/attachments

# For S3
STORAGE_BUCKET=my-bucket
STORAGE_REGION=us-east-1
STORAGE_ACCESS_KEY_ID=xxx
STORAGE_SECRET_ACCESS_KEY=xxx

Breaking Changes

None - new tables and endpoints only.

@orca-security-in orca-security-in Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 1   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca
🛡️ The following SAST misconfigurations have been detected
NAME FILE
medium Use of Cryptographically Weak Random Number Generators Detected ...s/StorageProvider.ts View in code

@github-actions

github-actions Bot commented Dec 3, 2025

Copy link
Copy Markdown

Test Coverage Report

Category Coverage Status
Statements 97.74% 1861/1904
Branches 87.74% 573/653
Functions 96.65% 260/269
Lines 97.69% 1784/1826

@orca-security-in orca-security-in Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 3   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca
🛡️ The following SAST misconfigurations have been detected
NAME FILE
medium Use of Cryptographically Weak Random Number Generators Detected ...s/StorageProvider.ts View in code
medium Container command is running with root privileges ...cloud-deployment.mdx View in code
medium Container command is running with root privileges ...cloud-deployment.mdx View in code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants