diff options
Diffstat (limited to 'test/tracetesting/email')
| -rw-r--r-- | test/tracetesting/email/all.yaml | 10 | ||||
| -rw-r--r-- | test/tracetesting/email/confirmation.yaml | 62 |
2 files changed, 72 insertions, 0 deletions
diff --git a/test/tracetesting/email/all.yaml b/test/tracetesting/email/all.yaml new file mode 100644 index 0000000..517ca65 --- /dev/null +++ b/test/tracetesting/email/all.yaml @@ -0,0 +1,10 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + +type: TestSuite +spec: + id: email-all + name: 'Email' + description: Run all Email tests enabled in sequence + steps: + - ./confirmation.yaml 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" |
