🚀 GUS Test Suite Automation Extension
A comprehensive VS Code extension for automating GUS Test Suite tasks, streamlining the process of test scenario generation from Pull Requests across multiple Git repositories (GitCore, GitSoma, and GitHub).
Note: This works with both VS code and cursor
Make sure your cursor is not connected with remote server, if it is then launch new empty window
✨ Key Highlights
- 🔗 Multi-Repository Support: Works seamlessly with GitCore, GitSoma, and GitHub
- 🤖 Automated Test Generation: AI-powered test scenario creation from PR analysis
- 📦 Bulk Processing: Process multiple work items and PRs simultaneously
- 📄 File URL Processing: Generate test scenarios directly from file URLs
- 🔒 Secure Authentication: Integration with GUS, Okta 2FA, and secure token storage
- 🎯 Smart Filtering: Filter by Epic, Release, or Date Range
- ✏️ Interactive Editing: Review and refine test scenarios before saving
Table of Contents
💾 Installation
For VS code : https://marketplace.visualstudio.com/items?itemName=SalesforceAlchemy.gustestsuiteautomation
For Cursor : Go to Cursor -> Settings -> Extensions -> Search 'gustestsuiteautomation'
Or
Go to https://git.soma.salesforce.com/harsh-sonkusare/GUSTestSuiteAutomation/tree/master
- Copy the
gustestsuiteautomation-x.x.x.vsix file to your local machine
- Open Cursor
- Open the Command Palette (Cmd+Shift+P or Ctrl+Shift+P)
- Type "Extensions: Install from VSIX" and select it
- Navigate to and select the
gustestsuiteautomation-x.x.x.vsix file
🗑️ Uninstallation
To uninstall the extension, run the following command in your terminal:
code --uninstall-extension SalesforceAlchemy.gustestsuiteautomation
🚀 Quick Start
First-Time Setup
- Open Settings
- Open Command Palette (
Cmd+Shift+P or Ctrl+Shift+P)
- Type "GUS Test Suite Automation: Open Settings"
Basic Usage
Option 1: Process a Single PR
- Paste your PR link (GitCore, GitSoma, or GitHub)
- Review and edit generated test scenarios
- Save test suites to GUS
Option 2: Bulk Process Work Items
- Filter by Epic, Release, or Date Range (optional)
- Click "Fetch my work Items"
- Review and manage test scenarios for all discovered PRs
Option 3: Generate from File URL
- Paste the full URL of a file from Git (GitCore, GitSoma, or GitHub)
- Enter the Work Item name (W-XXXXXXXX format)
- Generate test scenarios based on the file content
📝 Available Commands
Gusify Tests
Command: gustestsuiteautomation.gusifyTests
Description: Main entry point to choose between single PR testing or bulk work item processing
Usage: Open Command Palette and type "GUS Test Suite Automation: Gusify Tests"
Options:
Option 1: Let's Gusify Tests (Single PR Processing)
- Process a single PR link from any supported repository
Features:
- PR link parsing for GitCore, GitSoma, and GitHub
- Automatic repository type detection
- Token management for each repository type
- Work item extraction from PR description
- Theme retrieval from GUS
- Test suite generation based on code changes
- Interactive test scenario management
- Real-time test scenario editing
- Workflow:
- Paste PR link (supports GitCore, GitSoma, or GitHub URLs)
- Extension automatically detects repository type
- Extracts work items and associated GUS data
- Analyzes PR changes and generates test scenarios
- Opens interactive panel for test review and editing
- Save finalized test suites to GUS
Option 2: Gusify My Work Items (Bulk Processing)
- Process multiple work items based on Epic and Release filters
Features:
- Epic Filter: Filter work items by specific Epic (name or ID)
- Release Filter: Filter work items by specific Release/Build
- Date Range: Optional date range filtering for work items
- Automatic PR Discovery: Finds all PRs associated with filtered work items
- Multi-Repository Support: Works with GitCore, GitSoma, and GitHub PRs
- Bulk Processing: Process multiple work items and their PRs simultaneously
- Test Suite Generation: Automatically generates test suites for all discovered PRs
- Organized Display: Separate panels for each work item's test scenarios
Workflow:
- Select Epic (optional): Choose a specific Epic to filter work items
- Select Release (optional): Choose a specific Release/Build to filter work items
- Set Date Range (optional): Define a date range for work item filtering
- Click "Fetch my work Items": The extension will:
- Fetch work items matching your criteria
- Discover all associated PRs across repositories
- Generate test suites for each PR
- Display results in organized test scenario panels
Use Cases:
- Process work items for a particular release
- Bulk test generation for multiple related work items
- Historical analysis of work items within a date range
Option 3: Gusify from File URL (Single File Processing)
- Generate test scenarios from a single file in any supported Git repository
Features:
- Direct File URL Input: Paste the complete URL of a file starting with
https://
- Smart URL Parsing: Automatically detects repository type and extracts file path
- Branch Name Support: Handles complex branch names with slashes (e.g.,
p4/260-patch)
- File Validation: Validates the URL points to a file (not a folder) by checking for file extensions
- Work Item Association: Associate the file with a specific GUS work item
- Work Item Validation: Validates work item exists in GUS before processing
- Token Management: Set and validate tokens for the detected repository type
- Test Scenario Generation: Generates test scenarios based on the complete file content
Supported URL Formats:
- GitCore:
https://gitcore.soma.salesforce.com/org/repo/tree/branch/path/to/file.java
- GitSoma:
https://git.soma.salesforce.com/org/repo/blob/branch/path/to/file.java
- GitHub:
https://github.com/org/repo/blob/branch/path/to/file.java
Workflow:
- Open "Gusify Tests" and select "Gusify from File URL"
- Paste the complete file URL (starting with
https://)
- Extension automatically detects repository type and validates the URL
- Set or validate the token for the detected repository
- Enter the Work Item name (format:
W-XXXXXXXX, e.g., W-20411220)
- Extension validates the work item exists in GUS
- Click "Fetch File and Generate Test Scenarios"
- Review and edit generated test scenarios
- Save finalized test suites to GUS
Use Cases:
- Generate test scenarios for a specific test file
- Create test documentation for files not associated with a PR
- Associate test scenarios with specific work items manually
Set Git Core Token
- Note: The token is stored securely in VS Code's secret storage
- How to obtain token:
- Go to GitCore
- Click on your profile picture in the top right
- Select "Settings"
- In the left sidebar, click on "Access Tokens"
- Click "Generate New Token"
- Give your token a descriptive name
- Select the required scopes:
repo (Full control of private repositories)
read:org (Read organization data)
- Click "Generate Token"
- Copy the token immediately - you won't be able to see it again!
Set Git Soma Token
- Note: The token is stored securely in VS Code's secret storage
- How to obtain token:
- Go to GitSoma
- Follow steps 2-9 from above
Set Git Token
- Note: The token is stored securely in VS Code's secret storage
- How to obtain token:
- Go to GitHub
- Follow steps 2-9 from above
Authenticate with GUS
- Description: Authenticate with GUS using your credentials
- Usage:
- Open Command Palette and type "Authenticate with GUS"
- Enter your username
- Enter your SSO password
- Enter your Okta 2FA token
- Features:
- Secure credential handling
- Token persistence for future use
- Authentication Methods:
Standard Authentication (Recommended):
- Enter your GUS credentials:
- Username: your.email@gus.com
- Password: your SSO password
- Okta 2FA Token: the 6-digit code from your Okta authenticator app
- The extension will automatically handle the authentication process
Workbench Access Token (Alternative):
- If you're experiencing issues with the standard authentication method:
- Open Workbench
- Click "Login with Salesforce"
- Enter your GUS credentials
- After successful login, click on "Info" → "Session Information"
- Copy the "Session ID" value
- In VS Code:
- Open Command Palette (Cmd+Shift+P or Ctrl+Shift+P)
- Type "Set GUS Token" and select it
- Paste the Session ID when prompted
Open Settings
- Command:
gustestsuiteautomation.openSettings
- Description: Open the extension settings panel with an intuitive UI
- Usage: Open Command Palette and type "GUS Test Suite Automation: Open Settings"
- Features:
- Configure Salesforce credentials
- Set Salesforce base URL
- Manage all extension configurations in one place
- Interactive settings interface with save and validation
Set Chunk Size
- Note: Larger chunk sizes may improve performance but could hit API limits
- Default: Optimized for Salesforce API limits
✨ Features
- Configurable chunk size for Salesforce API operations
- Optimized batch processing
- Customizable Salesforce instance settings
- Performance-tuned API calls
⌨️ Keyboard Shortcuts & Quick Access
Command Palette
Access all extension commands quickly using the Command Palette:
- Mac:
Cmd+Shift+P
- Windows/Linux:
Ctrl+Shift+P
Then type any of these commands:
- "GUS Test Suite Automation: Gusify Tests"
- "Open Settings"
💡 Best Practices
Test Suite Generation
- Review before saving: Always review generated test scenarios before saving to GUS
- Add context: Enhance auto-generated test scenarios with additional context and edge cases
- Use descriptive names: Ensure test scenario names clearly describe what's being tested
- Organize by theme: Group related test scenarios under appropriate GUS themes
❓ Frequently Asked Questions (FAQ)
General Questions
Q: What repositories are supported?
A: The extension supports GitCore (gitcore.soma.salesforce.com), GitSoma (git.soma.salesforce.com), and GitHub (github.com).
Q: Do I need tokens for all three repository types?
A: No, you only need tokens for the repositories you actually use. Set up tokens only for the platforms you work with.
Q: Is my authentication data secure?
A: Yes, all tokens and credentials are stored using VS Code's secure secret storage mechanism, which encrypts sensitive data.
Feature Questions
Q: How are test scenarios generated?
A: The extension analyzes PR changes, extracts affected components, and uses AI-powered analysis to generate relevant test scenarios based on code modifications.
Q: Can I edit generated test scenarios?
A: Yes, all generated test scenarios can be reviewed and edited before saving to GUS through an interactive web panel.
Q: How does Epic filtering work?
A: You can filter work items by specifying an Epic name or ID. The extension will fetch all work items associated with that Epic and process their PRs.
Q: What is "Gusify from File URL" used for?
A: This option allows you to generate test scenarios from any file in a Git repository without needing a PR. Simply paste the file URL, specify a work item, and generate tests based on the file content.
Technical Questions
Q: What is chunk size and why should I adjust it?
A: Chunk size controls how many records are processed in each Salesforce API call. Adjust it if you're hitting API limits or need better performance.
Q: How long do tokens last?
A: Repository tokens typically don't expire (unless you set an expiration), but GUS authentication tokens expire after a period of inactivity. You'll need to re-authenticate when prompted.
Q: How do I get help with the extension?
A: Check the Troubleshooting section, review the repository documentation, or contact the development team.
Best Practice Questions
Q: Should I review all auto-generated test scenarios?
A: Yes, always review generated test scenarios to ensure they're accurate, complete, and relevant to your specific changes.
👨💻 Development
To modify or extend this extension:
- Clone the repository from GitSoma
- Run
npm install to install dependencies
- Make your changes to the TypeScript files in the
src/ directory
- Press F5 to start debugging in a new Extension Development Host window
- Use
vsce package to create a new VSIX file for distribution
Building the Extension
To compile the TypeScript source to JavaScript:
npm run compile
To package the extension into a VSIX file:
npx vsce package
🤝 Contributing
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch
- Make your changes with clear commit messages
- Test thoroughly
- Submit a pull request
💬 Support
For issues, questions, or feature requests:
- Check the Troubleshooting section
- Review existing issues in the repository
- Contact the development team
📄 License
This extension is proprietary software developed for internal use at Salesforce.
Version: 1.0.4
Publisher: SalesforceAlchemy
Repository: GitSoma - GUSTestSuiteAutomation
Made with ❤️ by the Salesforce Alchemy Team