Skip to main content

AI-powered test case generator CLI

Project description

FRIDAY - AI Test Case Generator

Auto Test Case Generator Banner

An AI-powered test case generator that leverages Google Vertex AI and LangChain to automatically create test cases from Jira/GitHub issues and Confluence documentation.

🚀 Features

  • Generate test cases using Google Vertex AI or OpenAI
  • Extract requirements from Jira tickets or GitHub issues
  • Integrate context from Confluence pages
  • Process data using LangChain's prompt engineering
  • Store and search documents using ChromaDB vectorization
  • Export test cases in JSON or Markdown format
  • Create embeddings using web crawler for additional context

📋 Prerequisites

  • Python 3.12+
  • Google Cloud Platform account with Vertex AI enabled or OpenAI
  • Jira/GitHub and Confluence access credentials

🔄 Sequence Diagram

%%{init: {
    'theme': 'base',
    'themeVariables': {
        'primaryColor': '#1a1a1a',
        'primaryTextColor': '#fff',
        'primaryBorderColor': '#4285f4',
        'lineColor': '#4285f4',
        'secondaryColor': '#2d2d2d',
        'tertiaryColor': '#2d2d2d',
        'actorBkg': '#4285f4',
        'actorTextColor': '#fff',
        'actorLineColor': '#4285f4',
        'signalColor': '#6c757d',
        'signalTextColor': '#fff',
        'labelBoxBkgColor': '#2d2d2d',
        'labelBoxBorderColor': '#4285f4',
        'labelTextColor': '#fff',
        'loopTextColor': '#fff',
        'noteBorderColor': '#43a047',
        'noteBkgColor': '#43a047',
        'noteTextColor': '#fff',
        'activationBorderColor': '#4285f4',
        'activationBkgColor': '#2d2d2d',
        'sequenceNumberColor': '#fff'
    }
}}%%

sequenceDiagram
    box rgba(66, 133, 244, 0.1) External Components
    participant User
    end
    
    box rgba(66, 133, 244, 0.1) Core System
    participant Main
    participant IssueConnector
    participant JiraConnector
    participant GitHubConnector
    participant ConfluenceConnector
    participant TestCaseGenerator
    participant PromptBuilder
    end

    Note over User,PromptBuilder: Test Case Generation Flow

    User->>+Main: Run main.py with issue-key/number<br/>and confluence-id
    
    alt Jira Issue
        rect rgba(67, 160, 71, 0.1)
            Main->>+IssueConnector: Get issue details
            IssueConnector->>+JiraConnector: Fetch Jira issue
            JiraConnector-->>-IssueConnector: Return issue details
            IssueConnector-->>-Main: Return issue details
            Main->>+IssueConnector: Extract acceptance criteria
            IssueConnector->>JiraConnector: Extract from Jira
            JiraConnector-->>IssueConnector: Return criteria
            IssueConnector-->>-Main: Return acceptance criteria
        end
    else GitHub Issue
        rect rgba(67, 160, 71, 0.1)
            Main->>+IssueConnector: Get issue details
            IssueConnector->>+GitHubConnector: Fetch GitHub issue
            GitHubConnector-->>-IssueConnector: Return issue details
            IssueConnector-->>-Main: Return issue details
            Main->>+IssueConnector: Extract acceptance criteria
            IssueConnector->>GitHubConnector: Extract from GitHub
            GitHubConnector-->>IssueConnector: Return criteria
            IssueConnector-->>-Main: Return acceptance criteria
        end
    end
    
    rect rgba(255, 152, 0, 0.1)
        Main->>+ConfluenceConnector: Fetch Confluence<br/>page content
        ConfluenceConnector-->>-Main: Return page content
    end
    
    rect rgba(66, 133, 244, 0.1)
        Main->>+PromptBuilder: Build prompt with details
        PromptBuilder-->>-Main: Return prompt
        Main->>+TestCaseGenerator: Generate test cases
        TestCaseGenerator-->>-Main: Return test cases
    end
    
    Main->>-User: Save test cases to<br/>output file

    Note over User,PromptBuilder: Process Complete

⚡️ Quick Start

  1. Install via Homebrew:
brew tap dipjyotimetia/friday
brew install friday
  1. Run setup:
friday setup
  1. Generate test cases:
# From Jira
friday generate --jira-key PROJ-123 --confluence-id 12345 -o test_cases.md

# From GitHub
friday generate --gh-issue 456 --gh-repo owner/repo --confluence-id 12345 -o test_cases.md

📖 Usage Options

Web Crawler

# Crawl single domain
friday crawl https://example.com --provider vertex --persist-dir ./my_data/chroma --max-pages 5

# Crawl multiple domains
friday crawl https://example.com --provider vertex --persist-dir ./my_data/chroma --max-pages 10 --same-domain false

Command Reference

friday --help          # Show all commands
friday version         # Display version
friday generate --help # Show generation options

Parameters

  • --jira-key: Jira issue key
  • --confluence-id: Confluence page ID (optional)
  • --gh-issue: GitHub issue number
  • --gh-repo: GitHub repository (format: owner/repo)
  • --output: Output file path (default: test_cases.json)

🔧 GitHub Action

name: Friday Test Generator

on:
  pull_request:
    types: [opened, synchronize]
  workflow_dispatch:
    inputs:
      confluence_id:
        description: 'Confluence Page ID'
        required: true
      jira_id:
        description: 'Jira Issue ID'
        required: false

jobs:
  generate-tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Generate Test Cases
        uses: dipjyotimetia/friday@main
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          confluence_url: ${{ secrets.CONFLUENCE_URL }}
          confluence_user: ${{ secrets.CONFLUENCE_USERNAME }}
          confluence_token: ${{ secrets.CONFLUENCE_API_TOKEN }}
          jira_url: ${{ secrets.JIRA_URL }}
          jira_user: ${{ secrets.JIRA_USERNAME }}
          jira_token: ${{ secrets.JIRA_API_TOKEN }}
          confluence_id: ${{ inputs.confluence_id || '12345' }}
          jira_id: ${{ inputs.jira_id || github.event.pull_request.number }}
          google_cloud_project: ${{ secrets.GOOGLE_CLOUD_PROJECT }}
          google_cloud_region: ${{ secrets.GOOGLE_CLOUD_REGION }}
          model_provider: 'vertex'
          persist_dir: './data/chroma'

      - name: Upload Test Cases
        uses: actions/upload-artifact@v4
        with:
          name: test-cases
          path: test_cases.md

💻 Development

  1. Clone and setup:
git clone https://github.com/dipjyotimetia/friday.git
cd friday
chmod +x prerequisites.sh
./prerequisites.sh
  1. Configure environment:
cp .env.example .env
# Add your credentials to .env
  1. Run Tests:
# Run tests
poetry run pytest tests/ -v
  1. Format Code:
# Format code
poetry run ruff format
  1. Deploy to google cloud
chmod +x deploy.sh
PROJECT_ID="your-project" REGION="us-west1" ./deploy.sh

MIT License

Copyright (c) 2025 Dipjyoti Metia

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

friday_cli-0.1.39.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

friday_cli-0.1.39-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

Details for the file friday_cli-0.1.39.tar.gz.

File metadata

  • Download URL: friday_cli-0.1.39.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.3 Linux/6.8.0-1020-azure

File hashes

Hashes for friday_cli-0.1.39.tar.gz
Algorithm Hash digest
SHA256 dd7251f30f25c5c1c5f90d96f1de7ba234fe15405fd62f5c235bf5ded60d1b35
MD5 0f0f29c6ac75fe8355ebb0253a1f0fd8
BLAKE2b-256 b0ec3543a64b2c2f6a2659e074be0a01c26a17e05d6d088f3a6bf08ad8fe63e3

See more details on using hashes here.

File details

Details for the file friday_cli-0.1.39-py3-none-any.whl.

File metadata

  • Download URL: friday_cli-0.1.39-py3-none-any.whl
  • Upload date:
  • Size: 25.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.3 Linux/6.8.0-1020-azure

File hashes

Hashes for friday_cli-0.1.39-py3-none-any.whl
Algorithm Hash digest
SHA256 7b5970d707a0d36478c7ee1c7d2f42043357a1cf537a9823f9954ac14a1e8804
MD5 ba906b3e3c1211a7e9e3f10e78fca376
BLAKE2b-256 d09b78f1bc13dc653599ab392ac2e5358242e7d2d8e49738a52da986af902a57

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page