Don't know how to config helper method with my webhook payload template #5356
-
I'm trying to config helper method to my webhook yaml by following documentation. - name: TEXT_COLOUR
value: {{ if eq (.TestExecution.ExecutionResult.Status ) "passed" }}"00FF00"{{ else }}"FF0000"{{ end }} I don't know where to put it in my yaml config. Can someone help me out? Here is my webhook config: apiVersion: executor.testkube.io/v1
kind: Webhook
metadata:
name: testkube-webhook
namespace: testkube
spec:
uri: uri
events:
- end-test-success
- end-test-failed
- end-test-aborted
- end-test-timeout
- end-testsuite-success
- end-testsuite-failed
- end-testsuite-aborted
- end-testsuite-timeout
selector: test-type=ginkgo-test
payloadTemplate: |
{"text": "======================================\n✨ Event {{ .Type_ }} \n📝 Test '{{ .TestExecution.TestName }}' \n🔢 execution ({{ .TestExecution.Id }}) \n🕐 started at '{{ .TestExecution.StartTime }}'\n🏁 finished with '{{ .TestExecution.ExecutionResult.Status }}' status\n⏳ duration '{{ .TestExecution.Duration }}'\n======================================"}
|
Beta Was this translation helpful? Give feedback.
Answered by
vsukhin
May 1, 2024
Replies: 1 comment
-
https://docs.testkube.io/articles/webhooks#helper-methods it's a bit different. see docs. you can use it payload template |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
PaulChen79
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://docs.testkube.io/articles/webhooks#helper-methods it's a bit different. see docs. you can use it payload template