summaryrefslogtreecommitdiff
path: root/test/tracetesting/frontend/06-checking-out-cart.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/frontend/06-checking-out-cart.yaml
Initial snapshot - OpenTelemetry demo 2.1.3 -f
Diffstat (limited to 'test/tracetesting/frontend/06-checking-out-cart.yaml')
-rw-r--r--test/tracetesting/frontend/06-checking-out-cart.yaml64
1 files changed, 64 insertions, 0 deletions
diff --git a/test/tracetesting/frontend/06-checking-out-cart.yaml b/test/tracetesting/frontend/06-checking-out-cart.yaml
new file mode 100644
index 0000000..d8d4748
--- /dev/null
+++ b/test/tracetesting/frontend/06-checking-out-cart.yaml
@@ -0,0 +1,64 @@
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+type: Test
+spec:
+ id: frontend-checkout-shopping-cart
+ name: 'Frontend: Checking out shopping cart'
+ description: Simulate user checking out shopping cart
+ trigger:
+ type: http
+ httpRequest:
+ url: http://${var:FRONTEND_ADDR}/api/checkout
+ method: POST
+ headers:
+ - key: Content-Type
+ value: application/json
+ body: |
+ {
+ "userId": "2491f868-88f1-4345-8836-d5d8511a9f83",
+ "email": "someone@example.com",
+ "address": {
+ "streetAddress": "1600 Amphitheatre Parkway",
+ "state": "CA",
+ "country": "United States",
+ "city": "Mountain View",
+ "zipCode": "94043"
+ },
+ "userCurrency": "USD",
+ "creditCard": {
+ "creditCardCvv": 672,
+ "creditCardExpirationMonth": 1,
+ "creditCardExpirationYear": 2030,
+ "creditCardNumber": "4432-8015-6152-0454"
+ }
+ }
+ specs:
+ - name: It called the frontend with success
+ selector: span[tracetest.span.type="general" name="Tracetest trigger"]
+ assertions:
+ - attr:tracetest.response.status = 200
+ - name: "The order was placed"
+ selector: span[tracetest.span.type="rpc" name="oteldemo.CheckoutService/PlaceOrder" rpc.system="grpc" rpc.method="PlaceOrder" rpc.service="oteldemo.CheckoutService"]
+ assertions:
+ - attr:app.user.id = "2491f868-88f1-4345-8836-d5d8511a9f83"
+ - attr:app.order.items.count = 1
+ - name: "The user was charged"
+ selector: span[tracetest.span.type="rpc" name="oteldemo.PaymentService/Charge" rpc.system="grpc" rpc.method="Charge" rpc.service="oteldemo.PaymentService"]
+ assertions:
+ - attr:rpc.grpc.status_code = 0
+ - attr:tracetest.selected_spans.count >= 1
+ - name: "The product was shipped"
+ selector: span[tracetest.span.type="rpc" name="oteldemo.ShippingService/ShipOrder" rpc.system="grpc" rpc.method="ShipOrder" rpc.service="oteldemo.ShippingService"]
+ assertions:
+ - attr:rpc.grpc.status_code = 0
+ - attr:tracetest.selected_spans.count >= 1
+ - name: "The cart was emptied"
+ selector: span[tracetest.span.type="rpc" name="oteldemo.CartService/EmptyCart" rpc.system="grpc" rpc.method="EmptyCart" rpc.service="oteldemo.CartService"]
+ assertions:
+ - attr:rpc.grpc.status_code = 0
+ - attr:tracetest.selected_spans.count >= 1
+ - name: The order was sent to be processed asyncronously
+ selector: span[tracetest.span.type="messaging" name="orders publish" messaging.system="kafka" messaging.destination.name="orders" messaging.operation="publish"]
+ assertions:
+ - attr:messaging.destination.name = "orders"