summaryrefslogtreecommitdiff
path: root/test/tracetesting/frontend/03-browse-product.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/03-browse-product.yaml
Initial snapshot - OpenTelemetry demo 2.1.3 -f
Diffstat (limited to 'test/tracetesting/frontend/03-browse-product.yaml')
-rw-r--r--test/tracetesting/frontend/03-browse-product.yaml31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/tracetesting/frontend/03-browse-product.yaml b/test/tracetesting/frontend/03-browse-product.yaml
new file mode 100644
index 0000000..2d13fdf
--- /dev/null
+++ b/test/tracetesting/frontend/03-browse-product.yaml
@@ -0,0 +1,31 @@
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+type: Test
+spec:
+ id: frontend-browse-product
+ name: 'Frontend: Browse products'
+ description: Simulate the user browsing products on Astronomy Shop
+ trigger:
+ type: http
+ httpRequest:
+ url: http://${var:FRONTEND_ADDR}/api/products/0PUK6V6EV0
+ method: GET
+ headers:
+ - key: Content-Type
+ value: application/json
+ specs:
+ - name: It called the frontend with success and got a product with valid attributes
+ selector: span[tracetest.span.type="general" name="Tracetest trigger"]
+ assertions:
+ - attr:tracetest.response.status = 200
+ - attr:tracetest.response.body | json_path '$.id' = "0PUK6V6EV0"
+ - attr:tracetest.response.body | json_path '$.description' != ""
+ - attr:tracetest.response.body | json_path '$.picture' != ""
+ - attr:tracetest.response.body | json_path '$.priceUsd' != "{}"
+ - attr:tracetest.response.body | json_path '$.categories' != "[]"
+ - name: It queried the product catalog correctly for a specific product
+ selector: span[tracetest.span.type="rpc" name="oteldemo.ProductCatalogService/GetProduct" rpc.system="grpc" rpc.method="GetProduct" rpc.service="oteldemo.ProductCatalogService"]
+ assertions:
+ - attr:rpc.grpc.status_code = 0
+ - attr:app.product.id = "0PUK6V6EV0"