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.35.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.35-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: friday_cli-0.1.35.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.35.tar.gz
Algorithm Hash digest
SHA256 ec46b3e42dbc04025887cfa0bcb0b21f72e9b4f82b262730a07968931c4522c7
MD5 24da2e7f1d4386eaafc86baae23734a1
BLAKE2b-256 4092cbac88066c466255d5e60609eb919e92aec3bace37dbb7d1f5836aa99b1e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: friday_cli-0.1.35-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.35-py3-none-any.whl
Algorithm Hash digest
SHA256 7e9fee678b362b05ff60a57e2cda376c4ba8c807fabab52cb97c94e02400bd2e
MD5 47d400442cca10df581e53f618ce1121
BLAKE2b-256 6e3db6e7ebdd29c8f814b18d43d257eed1991657e0b2b941634e56678d78f1a3

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