Skip to content

ChamsBouzaiene/QA-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

QA Analysis Tool

A comprehensive web application for automated quality assurance analysis, test scenario generation, and visual testing documentation.

The QA Analysis Tool is a full-stack application designed to streamline the quality assurance process for web applications. It automatically analyzes websites, generates comprehensive test scenarios using AI, and provides detailed visual reports to help development teams identify potential testing areas and improve their QA coverage.

Technology Stack Backend AI

πŸš€ Features

πŸ” Automated Website Analysis

  • Visual Screenshot Capture: High-quality, full-page screenshots using Playwright
  • Interactive Element Detection: Automatically identifies buttons, forms, links, and other UI components
  • Responsive Analysis: Captures websites at optimal viewport dimensions

πŸ€– AI-Powered Test Generation

  • GPT-4 Vision Integration: Analyzes both visual elements and metadata for comprehensive understanding
  • Smart Test Scenarios: Generates contextually relevant test cases based on UI analysis
  • Quality Insights: Provides actionable recommendations for testing focus areas

πŸ“Š Comprehensive Reporting

  • Visual Documentation: Side-by-side screenshot and test scenario presentation
  • Structured Reports: Organized test cases with clear descriptions and priorities
  • Historical Tracking: Save and review past analysis runs for comparison

πŸ›  Developer-Friendly

  • REST API: Well-documented FastAPI backend with automatic OpenAPI documentation
  • Modern Frontend: React with TypeScript for type safety and maintainability
  • Containerized Deployment: Docker Compose for easy setup and deployment

πŸ— Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   React Frontend β”‚    β”‚  FastAPI Backend β”‚    β”‚   AI Services   β”‚
β”‚                 │◄──►│                 │◄──►│                 β”‚
β”‚  β€’ TypeScript   β”‚    β”‚  β€’ Python       β”‚    β”‚  β€’ OpenAI GPT-4 β”‚
β”‚  β€’ TailwindCSS  β”‚    β”‚  β€’ Playwright   β”‚    β”‚  β€’ Vision API   β”‚
β”‚  β€’ Axios        β”‚    β”‚  β€’ Pydantic     β”‚    β”‚                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Project Structure

qa-analysis-tool/
β”œβ”€β”€ frontend/                 # React TypeScript application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/      # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ pages/          # Main application pages
β”‚   β”‚   β”œβ”€β”€ services/       # API communication layer
β”‚   β”‚   └── types/          # TypeScript type definitions
β”‚   └── public/
β”œβ”€β”€ backend/                 # FastAPI Python application
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ routes/         # API endpoint definitions
β”‚   β”‚   β”œβ”€β”€ services/       # Business logic and external integrations
β”‚   β”‚   β”œβ”€β”€ models/         # Pydantic data models
β”‚   β”‚   └── storage/        # Data persistence layer
β”‚   └── requirements.txt
└── docker-compose.yml      # Container orchestration

πŸ›  Prerequisites

Before running the application, ensure you have:

  • Docker & Docker Compose (recommended for easy setup)
  • Node.js v18+ and npm (for local development)
  • Python 3.10+ and pip (for local development)
  • OpenAI API Key (for AI-powered analysis)

⚑ Quick Start

1. Clone and Configure

git clone <repository-url>
cd qa-analysis-tool

# Copy environment template and configure
cp .env.example .env
# Edit .env file with your OpenAI API key

2. Set Environment Variables

Edit the .env file and add your configuration:

OPENAI_API_KEY=your_actual_openai_api_key_here
VITE_BACKEND_URL=http://localhost:8000
ENVIRONMENT=development

3. Run with Docker (Recommended)

# Build and start all services
docker-compose up --build

# Access the application
# Frontend: http://localhost:5173
# Backend API: http://localhost:8000
# API Documentation: http://localhost:8000/docs

πŸ”§ Development Setup

Backend Development

# Navigate to backend directory
cd backend

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Install Playwright browsers
playwright install

# Run development server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

Frontend Development

# Navigate to frontend directory
cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

πŸ“– Usage Guide

Basic Workflow

  1. Enter Website URL: Input the URL you want to analyze
  2. Automatic Analysis: The tool captures a screenshot and extracts UI elements
  3. AI Processing: GPT-4 Vision analyzes the interface and generates test scenarios
  4. Review Results: Examine the generated test cases and quality recommendations
  5. Export/Save: Download or save the analysis for your testing documentation

API Endpoints

The backend provides several key endpoints:

POST /api/v1/analyze_url     # Analyze a website URL
GET  /api/v1/runs            # Retrieve past analysis runs
POST /api/v1/generate_tests  # Generate test cases from scenarios
GET  /api/v1/checklist/{id}  # Get specific analysis checklist

Full API documentation is available at http://localhost:8000/docs when running the application.

πŸ”’ Security Considerations

  • Environment Variables: All sensitive configuration is managed through environment variables
  • API Keys: Never commit API keys to version control
  • CORS: Configured for development; adjust origins for production deployment
  • Input Validation: All inputs are validated using Pydantic models

πŸš€ Deployment

Production Deployment

  1. Environment Configuration:

    # Set production environment variables
    export OPENAI_API_KEY=your_production_key
    export ENVIRONMENT=production
    export DEBUG=false
  2. Update CORS Origins: Modify backend/app/main.py to include your production domains

  3. Build and Deploy:

    docker-compose -f docker-compose.prod.yml up --build -d

Scaling Considerations

  • Consider implementing rate limiting for API endpoints
  • Add proper logging and monitoring
  • Implement database storage for persistent data
  • Consider using a message queue for long-running AI analysis tasks

🀝 Contributing

We welcome contributions! Please see our contributing guidelines for:

  • Code style and formatting standards
  • Testing requirements
  • Pull request process
  • Issue reporting guidelines

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

Common Issues

Issue: "OpenAI API key not configured" Solution: Ensure your .env file contains a valid OPENAI_API_KEY

Issue: "Playwright browsers not found" Solution: Run playwright install in your Python environment

Issue: "CORS errors in frontend" Solution: Verify VITE_BACKEND_URL in your environment configuration

Getting Help

  • Check the API documentation for endpoint details
  • Review the browser console for frontend errors
  • Check Docker logs: docker-compose logs backend or docker-compose logs frontend

Built with ❀️ for the development community

This tool helps development teams maintain high-quality standards through automated analysis and intelligent test generation.

About

Ai Agent to suggest qa operations for devs

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors