testzeus-notifications
Configure notification channels for test results in TestZeus.
Category: integration · Version: 1.0.0 · Requires: testzeus-auth
Triggers: notification, email alert, webhook, slack, jira, alert, notify, channel, notification channel, pagerduty, opsgenie, teams
Overview
Notification channels in TestZeus allow you to receive alerts when tests complete, suites finish, or reports are generated. Channels can include email addresses, webhooks, and integrations with third-party services.
Quick Reference
# Email channel
testzeus notification create \
--name "QA Team" \
--emails "qa@example.com,team@example.com"
# Webhook channel
testzeus notification create \
--name "CI Pipeline" \
--webhooks "https://ci.example.com/webhook"
# Combined channel
testzeus notification create \
--name "All Alerts" \
--emails "team@example.com" \
--webhooks "https://hooks.example.com"
# List channels
testzeus notification list
# Update
testzeus notification update channel_id \
--is-default true
# Delete
testzeus notification delete channel_idChannel Types
Email Notifications
# Single email
testzeus notification create \
--name "Dev Team" \
--emails "dev@example.com"
# Multiple emails
testzeus notification create \
--name "QA Team" \
--emails "qa1@example.com,qa2@example.com,lead@example.com"
# With default flag
testzeus notification create \
--name "Default Alerts" \
--emails "team@example.com" \
--is-default trueWebhook Notifications
# Single webhook
testzeus notification create \
--name "CI Webhook" \
--webhooks "https://ci.example.com/testzeus/webhook"
# Multiple webhooks
testzeus notification create \
--name "Multi Pipeline" \
--webhooks "https://hooks1.example.com,https://hooks2.example.com"
# Slack webhook format
testzeus notification create \
--name "Slack Alerts" \
--webhooks "https://hooks.slack.com/services/XXX/YYY/ZZZ"Third-Party Integrations
Slack
# Use Slack incoming webhook URL
testzeus notification create \
--name "Slack #qa-alerts" \
--webhooks "https://hooks.slack.com/services/XXX/YYY/ZZZ"Microsoft Teams
# Use Teams incoming webhook URL
testzeus notification create \
--name "Teams QA" \
--webhooks "https://outlook.office.com/webhook/..."PagerDuty
# Use PagerDuty events API endpoint
testzeus notification create \
--name "PagerDuty" \
--webhooks "https://events.pagerduty.com/v2/enqueue"OpsGenie
# Use OpsGenie webhook URL
testzeus notification create \
--name "OpsGenie" \
--webhooks "https://app.opsgenie.com/webhooks/..."Create Notification Channel
Basic Email Channel
testzeus notification create \
--name "QA Team Alerts" \
--emails "qa-team@example.com" \
--is-active trueWebhook Channel
testzeus notification create \
--name "CI/CD Integration" \
--webhooks "https://ci.example.com/webhooks/testzeus" \
--is-active trueCombined Channel
testzeus notification create \
--name "Full Alert Stack" \
--emails "team@example.com,lead@example.com" \
--webhooks "https://hooks.example.com/slack,https://hooks.example.com/teams" \
--is-active true \
--is-default trueWith Filtering
Some channels can be filtered to receive only specific alerts:
# Critical alerts only
testzeus notification create \
--name "Critical Only" \
--emails "oncall@example.com" \
--filters "priority=critical"Manage Channels
List Channels
# List all
testzeus notification list
# Get details
testzeus notification get channel_idUpdate Channel
# Update emails
testzeus notification update channel_id \
--emails "new@example.com,another@example.com"
# Update webhooks
testzeus notification update channel_id \
--webhooks "https://new-webhook.example.com"
# Enable/disable
testzeus notification update channel_id \
--is-active false
# Set as default
testzeus notification update channel_id \
--is-default true
# Remove from default
testzeus notification update channel_id \
--is-default falseDelete Channel
testzeus notification delete channel_idUse with Schedules
Attach to Report Schedule
testzeus schedule create \
--name "Daily Report" \
--cron-expression "0 9 * * *" \
--notification-channels channel_id_1,channel_id_2Attach to Suite Schedule
testzeus test-suite-schedules create \
--name "Daily Checkout" \
--test-suite suite_id \
--cron-expression "0 9 * * *" \
--notification-channels channel_idWebhook Payload
When a webhook is triggered, it receives a payload like:
{
"event": "test_run_completed",
"timestamp": "2024-03-24T10:30:00Z",
"data": {
"run_id": "run_123",
"name": "Checkout Suite",
"status": "completed",
"passed": 24,
"failed": 1,
"duration": "4m 23s"
},
"links": {
"dashboard": "https://app.testzeus.ai/runs/run_123",
"report": "https://app.testzeus.ai/runs/run_123/report"
}
}Event Types
| Event | Description |
|---|---|
test_run_started |
A test run began |
test_run_completed |
A test run finished |
test_run_failed |
A test run failed |
suite_started |
A suite run began |
suite_completed |
A suite run finished |
report_generated |
A scheduled report was generated |
SDK Usage
from testzeus_sdk import TestZeusClient
async def main():
async with TestZeusClient() as client:
# Create email channel
email_channel = await client.notification_channels.create_notification_channel(
name="QA Team",
display_name="QA Team Alerts",
emails=["qa1@example.com", "qa2@example.com"],
is_active=True
)
# Create webhook channel
webhook_channel = await client.notification_channels.create_notification_channel(
name="CI Pipeline",
emails=["ci@example.com"],
webhooks=["https://ci.example.com/webhook"],
is_active=True
)
# List channels
channels = await client.notification_channels.get_list()
# Update
await client.notification_channels.update_notification_channel(
channel_id,
is_default=True
)
# Delete
await client.notification_channels.delete(channel_id)Best Practices
1. Separate Alert Levels
# Critical failures only - page people
testzeus notification create \
--name "PagerDuty Critical" \
--webhooks "https://events.pagerduty.com/..."
# All results - email team
testzeus notification create \
--name "Team Email" \
--emails "team@example.com"
# Reports only - leadership
testzeus notification create \
--name "Weekly Summary" \
--emails "leadership@example.com"2. Use Descriptive Names
# Good
--name "Slack #qa-alerts"
--name "PagerDuty Production"
--name "Email QA Team"
# Avoid
--name "channel1"
--name "test"
--name "notify"3. Set Default Channel
# Only one should be default
testzeus notification update channel_id --is-default trueCommon Workflows
CI/CD Pipeline Integration
# 1. Create webhook channel
testzeus notification create \
--name "GitHub Actions" \
--webhooks "https://github.com/webhooks/testzeus"
# 2. Attach to suite schedule
testzeus test-suite-schedules create \
--name "CI Checks" \
--test-suite ci_suite_id \
--cron-expression "0 * * * *" \
--notification-channels github_actions_channel_idOn-Call Rotation
# 1. Create PagerDuty channel
testzeus notification create \
--name "On-Call" \
--webhooks "https://events.pagerduty.com/..."
# 2. Attach to critical suites
testzeus test-suite-schedules create \
--name "Critical Path" \
--test-suite critical_suite_id \
--cron-expression "0 9 * * *" \
--notification-channels oncall_channel_idDaily Summary
# 1. Create email channel
testzeus notification create \
--name "Daily Summary" \
--emails "team@example.com"
# 2. Attach to report schedule
testzeus schedule create \
--name "Evening Report" \
--cron-expression "0 18 * * *" \
--notification-channels daily_summary_channel_idError Handling
Common Errors
| Error | Cause | Solution |
|---|---|---|
Invalid webhook URL |
Malformed URL | Check URL format |
Webhook unreachable |
URL not accessible | Test webhook endpoint |
Email invalid |
Malformed email | Check email addresses |
Test Webhook
Always test your webhook before using in production:
# Send test notification (if supported)
curl -X POST https://your-webhook-url \
-H "Content-Type: application/json" \
-d '{"event": "test", "message": "Test from TestZeus"}'Component Schema
Use NotificationChannel component:
{
"component": "NotificationChannel",
"props": {
"name": "QA Team",
"type": "email",
"emails": ["qa@example.com"],
"webhooks": [],
"isActive": true,
"isDefault": false
}
}{
"component": "NotificationChannel",
"props": {
"name": "CI Webhook",
"type": "webhook",
"emails": [],
"webhooks": ["https://ci.example.com/webhook"],
"isActive": true,
"isDefault": true
}
}Related Skills
- testzeus-scheduling - Attach notifications to schedules
- testzeus-test-suites - Attach notifications to suites