Simple bash scripts using curl and jq to test PromptPipe API functionality.
curl- for making HTTP requestsjq- for JSON parsing and formattingbash- shell environment- Running PromptPipe instance on localhost:8080
Install required tools:
# Ubuntu/Debian
sudo apt install curl jq
# macOS
brew install curl jq
# Alpine Linux
apk add curl jqchmod +x test-scripts/*.sh# Basic health check
./test-scripts/quick-test.sh# Test basic message sending
./test-scripts/test-send.sh
# Test advanced GenAI prompt engineering
./test-scripts/test-genai.sh
# Test message scheduling (schedule objects)
./test-scripts/test-schedule.sh
# Test response handling
./test-scripts/test-responses.sh
# Test receipt tracking
./test-scripts/test-receipts.sh# Run all tests
./test-scripts/run-all-tests.shEdit config.sh to customize:
- API base URL (default: http://localhost:8080)
- Test phone numbers (default: +15551234567, +15551234568)
- Output colors and logging
- ✅ Static messages
- ✅ Branch messages with options
- ✅ GenAI messages (with/without OpenAI key)
- ✅ Custom flow messages
- ✅ Input validation (phone numbers, required fields)
- ✅ Error handling (invalid JSON, wrong methods)
- ✅ Schedule object validation (minute/hour/day/month/weekday)
- ✅ Different prompt types with scheduling
- ✅ Edge cases (frequent schedules, invalid fields)
- ✅ Recording participant responses
- ✅ Special characters and emojis
- ✅ Long message handling
- ✅ Response statistics
- ✅ Data structure validation
- ✅ Receipt retrieval
- ✅ Receipt data structure
- ✅ Status tracking
- ✅ Receipt analysis
- ✅ Complete workflows (send → receipt → response → stats)
- ✅ All prompt types in sequence
- ✅ Error scenario testing
- ✅ Basic load testing
- ✅ Data consistency verification
Tests provide:
- ✅ Colored output for easy reading
- 📊 Detailed request/response logging
- 📈 Test summaries with pass/fail counts
- 🔍 JSON structure validation
- 📋 Data verification and analysis
[2025-06-18 10:30:15] Testing: Send static message
Request: POST /send
Data: {"to": "+15551234567", "type": "static", "body": "Hello from PromptPipe test!"}
Response Status: 200
Response Body: {"status":"ok","message":"Message sent successfully"}
✓ Send static message - Status: 200
Formatted Response:
{
"status": "ok",
"message": "Message sent successfully"
}
==================================
Test Summary
==================================
Passed: 15
Failed: 0
Total: 15
All tests passed!
config.sh- Configuration and shared functionstest-send.sh- Test POST /send endpointtest-schedule.sh- Test POST /schedule endpointtest-responses.sh- Test response recording and statstest-receipts.sh- Test receipt trackingrun-all-tests.sh- Complete test suite with integration testsquick-test.sh- Fast health checktest-restart-persistence.sh- End-to-end restart persistence test (requires Docker)
- Tests use test phone numbers (+15551234567, +15551234568) by default
- Scripts will detect if PromptPipe is not running and provide start instructions
- All JSON responses are validated and pretty-printed
- Error cases are tested to ensure proper API behavior
- Integration tests verify complete message workflows