A composite GitHub Action that runs automated tests using TestZeus and generates comprehensive test reports with Slack notifications.
- π Automated test execution using TestZeus CLI
- π CTRF (Common Test Report Format) report generation
- π Support for multiple test cases and data files
- π Asset file upload support
- π Environment configuration support for different test environments
Your repository must follow this structure:
your-repo/
βββ tests/
β βββ test-environment/ # Global test environment (optional)
β β βββ data.txt # Global environment configuration
β β βββ assets/ # Optional global environment assets
β β βββ config.json
β βββ test-login/
β β βββ login.feature # Gherkin feature file
β β βββ test-data/ # Optional test data configurations
β β βββ valid-user/ # Test case 1
β β β βββ data.txt # Test data file
β β β βββ assets/ # Optional asset files
β β β βββ profile.png
β β βββ admin-user/ # Test case 2
β β β βββ data.txt
β β β βββ assets/
β β βββ guest-user/ # Test case 3
β β βββ data.txt
β βββ test-checkout/
β β βββ checkout.feature
β β βββ test-data/
β β βββ single-item/ # Multiple cases assigned to one test
β β β βββ data.txt
β β βββ multiple-items/
β β βββ data.txt
β βββ test-search/
β βββ search.feature # Test without test-data (feature file only)
βββ templates/
βββ ctrf-report.hbs # Custom CTRF report template (optional)
- Feature Files: Each test directory must contain a
.featurefile with Gherkin scenarios - Test Data Files: Each test case must have a
data.txtfile in thetest-data/case_name/directory- Multiple test-data cases can exist per test (zero, one, or multiple)
- All test-data cases are assigned to a single test record
- Template File: Create
templates/ctrf-report.hbsfor custom report formatting
- Global Environment File: A single
tests/test-environment/data.txtfile for global environment configuration- This environment configuration is shared across all tests
- Contains global settings like API endpoints, authentication tokens, or configuration parameters
- Supports assets in the
tests/test-environment/assets/directory - If present, will be automatically associated with all created tests
The action follows this logic for creating tests:
- If
tests/test-environment/exists, creates one global environment record - This environment is shared across all tests
For each tests/test-* directory:
- Feature File Only: If no
test-data/directory exists, creates a test with just the feature file - With Test Data: If
test-data/directory exists:- Creates individual test-data records for each case directory
- Collects all test-data IDs from that test
- Creates a single test record with ALL test-data IDs assigned
- Associates the global environment (if exists)
test-login/
βββ login.feature
βββ test-data/
βββ valid-user/data.txt β Creates test-data ID: data_001
βββ admin-user/data.txt β Creates test-data ID: data_002
βββ guest-user/data.txt β Creates test-data ID: data_003
Result: One test record with data: "data_001,data_002,data_003"
Configure these secrets in your GitHub repository (Settings > Secrets and variables > Actions):
| Secret | Description | Required |
|---|---|---|
TESTZEUS_EMAIL |
Your TestZeus account email | β Yes |
TESTZEUS_PASSWORD |
Your TestZeus account password | β Yes |
The action accepts the following input parameters:
| Input | Description | Required | Default |
|---|---|---|---|
email |
TestZeus login email | β Yes | - |
password |
TestZeus login password | β Yes | - |
name |
Name for the test run group | β No | Smoke action suite |
execution_mode |
Execution mode for the test run (lenient or strict) |
β No | lenient |
filename |
Filename for the CTRF report output | β No | ctrf-report.json |
lenient: Tests continue running even if some fail, providing a complete overview of all test resultsstrict: Test execution stops at the first failure, useful for fail-fast scenarios
Create templates/ctrf-report.hbs in your repository and copy this template in to ctrf-report.hbs file. This will render similar to above image:
To create you own custom template then refer the following repos:
name: Run TestZeus Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Run Smoke Suite
uses: test-zeus-ai/testzeus-create-execute@v1
with:
email: ${{ secrets.TESTZEUS_EMAIL }}
password: ${{ secrets.TESTZEUS_PASSWORD }}
name: 'CI Smoke Tests'
execution_mode: 'lenient'
filename: 'test-results.json'
- name: Publish Test Report
uses: ctrf-io/github-test-reporter@v1
with:
report-path: 'downloads/test-results.json'
template-path: 'templates/testzeus-report.hbs'
custom-report: true
if: always()name: Smoke Tests
on:
schedule:
- cron: '0 */6 * * *' # Run every 6 hours
workflow_dispatch: # Manual trigger
push:
branches: [ main, staging ]
jobs:
smoke-tests:
runs-on: ubuntu-latest
steps:
- name: Run Smoke Suite
uses: test-zeus-ai/testzeus-create-execute@v1
with:
email: ${{ secrets.TESTZEUS_EMAIL }}
password: ${{ secrets.TESTZEUS_PASSWORD }}
name: 'Scheduled Smoke Tests'
execution_mode: 'strict'
- name: Publish Test Report
uses: ctrf-io/github-test-reporter@v1
with:
report-path: 'downloads/ctrf-report.json'
template-path: 'templates/testzeus-report.hbs'
custom-report: true
if: always()name: Multi-Environment Tests
on:
workflow_dispatch:
inputs:
environment:
description: 'Target environment'
required: true
default: 'staging'
type: choice
options:
- staging
- production
jobs:
test-staging:
if: github.event.inputs.environment == 'staging'
runs-on: ubuntu-latest
steps:
- name: Run Staging Tests
uses: test-zeus-ai/testzeus-create-execute@v1
with:
email: ${{ secrets.TESTZEUS_EMAIL }}
password: ${{ secrets.TESTZEUS_PASSWORD }}
name: 'Staging Environment Tests'
execution_mode: 'lenient'
test-production:
if: github.event.inputs.environment == 'production'
runs-on: ubuntu-latest
steps:
- name: Run Production Tests
uses: test-zeus-ai/testzeus-create-execute@v1
with:
email: ${{ secrets.TESTZEUS_EMAIL }}
password: ${{ secrets.TESTZEUS_PASSWORD }}
name: 'Production Environment Tests'
execution_mode: 'strict'The action supports an optional global test environment configuration that applies to all tests in your repository.
- Single Location: Place environment configuration in
tests/test-environment/directory - Global Scope: The same environment configuration is applied to all tests
- Automatic Association: When present, the global environment is automatically linked to every test
- Optional: The global test environment is completely optional - tests work without it
- API Base URLs for different environments (staging, production)
- Authentication Tokens or credentials shared across all tests
- Global Configuration settings or feature flags
- Environment-specific Assets like certificates or config files
- Database Connection Strings for test environments
tests/
βββ test-environment/
β βββ data.txt # Global environment config
β βββ assets/
β βββ api-cert.pem
β βββ config.json
β βββ auth-token.txt
βββ test-login/
β βββ login.feature
β βββ test-data/
β βββ valid-user/
β βββ data.txt
βββ test-checkout/
βββ checkout.feature
βββ test-data/
βββ guest-checkout/
β βββ data.txt
βββ member-checkout/
βββ data.txt
The global environment data.txt file can contain:
- API base URLs and endpoints
- Authentication tokens or API keys
- Environment-specific variables
- Global configuration parameters
- Database connection strings
The action generates the following outputs:
- CTRF Report: Stored in
downloads/directory with configurable filename (default:downloads/ctrf-report.json) - Machine-readable test results - HTML Report: Generated from the custom template
- Console Logs: Detailed execution logs in GitHub Actions
- Slack Notifications: Success/failure notifications (if configured)
After the action completes, the CTRF report will be available at:
- Default path:
downloads/ctrf-report.json - Custom path:
downloads/{your-custom-filename}(when using thefilenameinput parameter)
The generated CTRF report follows the Common Test Report Format (CTRF) v1.0.0 specification. The schema includes:
- Report metadata: Format version, specification version, and tool information
- Test summary: Aggregate counts (total, passed, failed, pending, skipped, other) and execution timing
- Individual test results: Each test includes:
- Test identification (name, status, duration, timing)
- Thread/execution context information
- File attachments (screenshots, logs, artifacts)
- Step-by-step execution details with individual step status
- Extended metadata (tenant IDs, test run identifiers, feature/scenario names)
This standardized format ensures compatibility with CTRF-compliant tools and enables consistent test reporting across different testing frameworks.
{
"reportFormat": "CTRF",
"specVersion": "1.0.0",
"results": {
"tool": {
"name": "testzeus",
"version": "1.0.0"
},
"summary": {
"tests": 5,
"passed": 4,
"failed": 1,
"start": 1640995200,
"stop": 1640995800
},
"tests": [
{
"name": "Login Test",
"status": "pass",
"duration": 2500,
"steps": [
{
"name": "Enter credentials",
"status": "pass"
}
],
"attachments": [
{
"name": "image.png",
"contentType": "png",
"path": "<path/to/image>.png"
}
],
"extra": {
"tenantid": "abcd",
"test_run_id": "abcd",
"test_run_dash_id": "abcd",
"agent_config_id": "abcd",
"feature_name": "Authentication",
"scenario_name": "Login to google"
}
}
]
}
}-
"No .feature file found"
- Ensure each test directory has a
.featurefile - Check file naming and extensions
- Ensure each test directory has a
-
"test-data dir not found"
- Verify the
test-datadirectory structure - Each test must have a
test-datasubdirectory
- Verify the
-
"Login failed"
- Check your TestZeus credentials in secrets
- Ensure your TestZeus account is active
-
Template errors
- Ensure
templates/ctrf-report.hbsexists - Check Handlebars syntax in your template
- Ensure
-
Test environment issues
- Global test environment is optional - missing directory won't cause failures
- Ensure
tests/test-environment/data.txtexists if you create the directory - Global environment assets are stored in
tests/test-environment/assets/ - The same environment configuration applies to all tests
Add this step before the action to enable debug logging:
- name: Enable Debug
run: echo "ACTIONS_STEP_DEBUG=true" >> $GITHUB_ENV- Fork the repository
- Create a feature branch
- Make your changes
- Test with a sample repository
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For issues related to:
- TestZeus CLI: Contact TestZeus support
- This Action: Open an issue in this repository
- GitHub Actions: Check GitHub's documentation
