summaryrefslogtreecommitdiff
path: root/test/tracetesting/email/confirmation.yaml
diff options
context:
space:
mode:
authorSaumit <justsaumit@protonmail.com>2025-09-27 02:14:26 +0530
committerSaumit <justsaumit@protonmail.com>2025-09-27 02:14:26 +0530
commit82e03978b89938219958032efb1448cc76baa181 (patch)
tree626f3e54d52ecd49be0ed3bee30abacc0453d081 /test/tracetesting/email/confirmation.yaml
Initial snapshot - OpenTelemetry demo 2.1.3 -f
Diffstat (limited to 'test/tracetesting/email/confirmation.yaml')
-rw-r--r--test/tracetesting/email/confirmation.yaml62
1 files changed, 62 insertions, 0 deletions
diff --git a/test/tracetesting/email/confirmation.yaml b/test/tracetesting/email/confirmation.yaml
new file mode 100644
index 0000000..96c561e
--- /dev/null
+++ b/test/tracetesting/email/confirmation.yaml
@@ -0,0 +1,62 @@
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+type: Test
+spec:
+ id: email-confirmation
+ name: 'Email: Confirmation'
+ description: Send an order confirmation email
+ trigger:
+ type: http
+ httpRequest:
+ url: ${var:EMAIL_ADDR}/send_order_confirmation
+ method: POST
+ headers:
+ - key: Content-Type
+ value: application/json
+ body: |
+ {
+ "email": "google@example.com",
+ "order": {
+ "order_id": "505",
+ "shipping_tracking_id": "dead-beef",
+ "shipping_cost": {
+ "currency_code": "USD",
+ "units": 17,
+ "nanos": 980000000
+ },
+ "shipping_address": {
+ "street_address_1": "1600 Amphitheatre Parkway",
+ "city": "Mountain View",
+ "state": "California",
+ "country": "United States",
+ "zip_code": "94043"
+ },
+ "items": [
+ {
+ "item": {
+ "product_id": "1YMWWN1N4O",
+ "quantity": 5
+ },
+ "cost": {
+ "currency_code": "USD",
+ "units": 100,
+ "nanos": 0
+ }
+ }
+ ]
+ }
+ }
+ specs:
+ - name: It should be called successfully
+ selector: span[tracetest.span.type="http" name="POST /send_order_confirmation" http.method="POST"]
+ assertions:
+ - attr:http.status_code = 200
+ - name: It should render a email to send
+ selector: span[tracetest.span.type="general" name="sinatra.render_template"]
+ assertions:
+ - attr:name = "sinatra.render_template"
+ - name: It should send an email
+ selector: span[tracetest.span.type="general" name="send_email"]
+ assertions:
+ - attr:name = "send_email"