AI-powered test case generator CLI
Project description
FRIDAY - AI Test Case Generator
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
- Install via Homebrew:
brew tap dipjyotimetia/friday
brew install friday
- Run setup:
friday setup
- 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
- Clone and setup:
git clone https://github.com/dipjyotimetia/friday.git
cd friday
chmod +x prerequisites.sh
./prerequisites.sh
- Configure environment:
cp .env.example .env
# Add your credentials to .env
- Run Tests:
# Run tests
poetry run pytest tests/ -v
- Format Code:
# Format code
poetry run ruff format
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file friday_cli-0.1.37.tar.gz.
File metadata
- Download URL: friday_cli-0.1.37.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b93fe10efea35b891a507018af50c83e4a8b833f2d79232b1a90fda03a7b5c6e
|
|
| MD5 |
3176aac7259d6186cbc47cd2d76f615a
|
|
| BLAKE2b-256 |
4a3853ac376814f47c3ad972625b3e4f89d4d95da7c552ccac6b611544c527f3
|
File details
Details for the file friday_cli-0.1.37-py3-none-any.whl.
File metadata
- Download URL: friday_cli-0.1.37-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bde55efdabf9d52e5929e5de15954f966ef124cf18dabb896409c71d711d7573
|
|
| MD5 |
50fd6de3cf49d1eb9d2ebd9c72b23813
|
|
| BLAKE2b-256 |
5d2f541b31a1f85450e96a7765d5c3219997125900692acc95c42642de7a0ec1
|