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-example1/
β β βββ example.feature # Gherkin feature file
β β βββ test-data/ # Optional test data configurations
β β β βββ case1/
β β β β βββ data.txt # Test data file
β β β β βββ assets/ # Optional asset files
β β β β βββ screenshot.png
β β β βββ case2/
β β β βββ data.txt
β β β βββ assets/
β β βββ test-environments/ # Optional environment configurations
β β βββ case1/
β β β βββ data.txt # Environment configuration file
β β β βββ assets/ # Optional environment assets
β β β βββ config.json
β β βββ case2/
β β βββ data.txt
β β βββ assets/
β βββ test-example2/
β βββ another.feature
β βββ test-data/
β β βββ case1/
β β βββ data.txt
β βββ test-environments/ # Optional - matches test-data structure
β βββ case1/
β βββ data.txt
βββ templates/
βββ ctrf-report.hbs # Custom CTRF report template (optional)
- Feature Files: Each test directory must contain a
.feature
file with Gherkin scenarios - Test Data Files: Each test case must have a
data.txt
file in thetest-data/case_name/
directory - Template File: Create
templates/ctrf-report.hbs
for custom report formatting
- Environment Files: Each test case can optionally have a corresponding
data.txt
file in thetest-environments/case_name/
directory- Environment files contain configuration data for test execution environments
- Must follow the same directory structure as
test-data
- If present, will be automatically associated with the corresponding test case
- Supports assets in the same way as test-data directories
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 |
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: Publish Test Report
uses: ctrf-io/github-test-reporter@v1
with:
report-path: 'ctrf-report.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: Publish Test Report
uses: ctrf-io/github-test-reporter@v1
with:
report-path: 'ctrf-report.json'
template-path: 'templates/testzeus-report.hbs'
custom-report: true
if: always()
The action supports optional test environment configurations that allow you to specify different execution environments for your tests.
- Structure: Test environments follow the same directory structure as test-data
- Matching: Each test case in
test-data/case_name/
can have a correspondingtest-environments/case_name/
- Automatic Association: When both exist, they are automatically linked during test creation
- Optional: Test environments are completely optional - tests work without them
- Different API endpoints for staging vs production
- Database configurations for different environments
- Authentication credentials for various test environments
- Feature flags or configuration settings
- Environment-specific assets like certificates or config files
test-environments/
βββ staging/
β βββ data.txt # Staging environment config
β βββ assets/
β βββ staging-cert.pem
β βββ staging-config.json
βββ production/
βββ data.txt # Production environment config
βββ assets/
βββ prod-cert.pem
βββ prod-config.json
The environment data.txt
files can contain:
- API base URLs
- Database connection strings
- Environment-specific variables
- Configuration parameters
The action generates the following outputs:
- CTRF Report:
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)
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
.feature
file - Check file naming and extensions
- Ensure each test directory has a
-
"test-data dir not found"
- Verify the
test-data
directory structure - Each test must have a
test-data
subdirectory
- Verify the
-
"Login failed"
- Check your TestZeus credentials in secrets
- Ensure your TestZeus account is active
-
Template errors
- Ensure
templates/ctrf-report.hbs
exists - Check Handlebars syntax in your template
- Ensure
-
Test environment issues
- Test environments are optional - missing directories won't cause failures
- Ensure
test-environments
structure matchestest-data
structure - Each environment case directory must have its own
data.txt
file
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