TestTau gives agents disposable mail and webhook endpoints for tests:
@mail.testtau.com , inspect at https://mail.testtau.com/i/.https://hook.testtau.com/, inspect at https://hook.testtau.com/_/.Authorization: Bearer .Use a unique name per task, for example agent-. Valid names start with a lowercase letter or number and may contain lowercase letters, numbers, ., _, +, or -.
Use public mail when the inbox can be readable by anyone who knows the name.
agent-login-7k3p.agent-login-7k3p@mail.testtau.com.curl -fsS "https://mail.testtau.com/i/agent-login-7k3p/api/wait?timeout=15000&subject=Verify"
curl -fsS "https://mail.testtau.com/i/agent-login-7k3p/api/message/<messageId>/json"
Important fields include fromAddr, toAddr, subject, textBody, htmlBody, preview, attachments, and links.raw.
Use private mail when the test email must not be visible in a public inbox.
https://testtau.com/account.@mail.testtau.com .curl -fsS \
-H "Authorization: Bearer $TESTTAU_MAIL_KEY" \
"https://mail.testtau.com/private/i/<privateInbox>/api/wait?timeout=15000&subject=Verify"
Never put private keys in URLs. Use Authorization: Bearer.
Use public hooks when captured requests can be visible to anyone with the hook id.
HOOK_ID="agent-webhook-7k3p"
curl -fsS -X POST "https://hook.testtau.com/$HOOK_ID" \
-H "content-type: application/json" \
-d '{"event":"agent.test","ok":true}'
curl -fsS "https://hook.testtau.com/_/$HOOK_ID/api/list"
Open https://hook.testtau.com/_/ for the live inspector.
Use private hooks when inspection, replay, config, wipe, and assertions must require an API key.
curl -fsS -X POST "https://hook.testtau.com/private/<hookId>" \
-H "content-type: application/json" \
-d '{"event":"agent.private"}'
curl -fsS \
-H "Authorization: Bearer $TESTTAU_HOOK_KEY" \
"https://hook.testtau.com/private/_/<hookId>/api/list"
For webhook contract tests, configure a JSON Schema and use the assert endpoint as a CI gate.
START="$(date +%s%3N)"
curl -fsS -X PUT "https://hook.testtau.com/_/<hookId>/api/config" \
-H "content-type: application/json" \
-d '{"schema":"{\"type\":\"object\",\"required\":[\"event\"]}","schemaFailMode":"capture"}'
# Trigger the system under test here.
curl -fsS "https://hook.testtau.com/_/<hookId>/api/assert?since=$START&min_count=1"
For private hooks, add -H "Authorization: Bearer $TESTTAU_HOOK_KEY" to config, list, request, replay, wipe, and assert calls.
Return the exact inbox or hook id used, the inspect URL, and the message/request id if one was captured. If a wait timed out, report that explicitly and include the URL the user can open manually.
共 1 个版本