Skip to main content

AI-powered test case generator CLI

Project description

FRIDAY - AI Test Case Generator

Auto Test Case Generator Banner

A Python-based tool that uses Google's Vertex AI and LangChain to automatically generate test cases from Jira/Github and Confluence documentation.

Features

  • 🤖 Leverages Google Vertex AI for test case generation
  • 📝 Pulls requirements from Jira tickets or github issue
  • 📚 Extracts additional context from Confluence pages
  • 🔄 Uses LangChain for prompt engineering and chain management
  • 💾 Use ChromaDb for Embeddings, vector search, document storage
  • { } Outputs structured test cases in JSON/MarkDown format

Prerequisites

  • Python 3.13+
  • Google Cloud Platform account with Vertex AI enabled
  • Jira 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

Installation

  1. Clone the repository:
git clone https://github.com/dipjyotimetia/friday.git
cd friday
  1. Install dependencies:
chmod +x prerequisites.sh
./prerequisites.sh
poetry install
  1. Configure environment variables:
cp .env.example .env
# Edit .env with your credentials

Usage

Run the tool with:

# Install the package
poetry install

# Generate test cases from a Jira issue
friday generate --jira-key PROJ-123 --confluence-id 12345 -o test_cases.md

# Generate test cases from a GitHub issue 
friday generate --gh-issue 456 --gh-repo owner/repo --confluence-id 12345 -o test_cases.md

# Show version
friday version

# Show help
friday --help
friday generate --help

Parameters

  • --jira-key: Jira issue key (required)
  • --confluence-id: Confluence page ID (optional)
  • --gh-issue: Github Issue key
  • --gh-repo: Github User/Repo
  • --output: Output file path for generated test cases (default: test_cases.json)

Example other repo

- uses: dipjyotimetia/friday@v1
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    confluence_id: "optional-confluence-id" 

Development

Run tests:

poetry run pytest tests/ -v

Format Code:

poetry run ruff format

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.0.tar.gz (15.6 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.0-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for friday_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e0d128c42db8eb21ff2b39a41fa11ac800ca8bc9c46dbedcf22109e00669bc62
MD5 3351f2867e86ab14606d2fffbf3b3bd4
BLAKE2b-256 f509234c0733ef6c47054b38b0fb4aeba852d2f03f5cd5451e875a522281ca66

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for friday_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 426aa15f6bb470743c1eaec55472f3ae393e229afb556037cc8c950552e177c2
MD5 d2e05474e6744e3171a58c8d58cbe617
BLAKE2b-256 4c617864153074aa7fafe5ba63d04da8f2cdef1f4ddcc0da963a421c5abd2c1b

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