summaryrefslogtreecommitdiff
path: root/test/tracetesting/frontend/01-see-ads.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/01-see-ads.yaml
Initial snapshot - OpenTelemetry demo 2.1.3 -f
Diffstat (limited to 'test/tracetesting/frontend/01-see-ads.yaml')
-rw-r--r--test/tracetesting/frontend/01-see-ads.yaml35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/tracetesting/frontend/01-see-ads.yaml b/test/tracetesting/frontend/01-see-ads.yaml
new file mode 100644
index 0000000..698a6df
--- /dev/null
+++ b/test/tracetesting/frontend/01-see-ads.yaml
@@ -0,0 +1,35 @@
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+type: Test
+spec:
+ id: frontend-see-adds
+ name: 'Frontend: See Ads'
+ description: Simulate the user seeing a ads on Astronomy Shop
+ trigger:
+ type: http
+ httpRequest:
+ url: http://${var:FRONTEND_ADDR}/api/data
+ method: GET
+ headers:
+ - key: Content-Type
+ value: application/json
+ body: |
+ {
+ "contextKeys": [
+ "binoculars",
+ "telescopes",
+ "accessories"
+ ]
+ }
+ specs:
+ - name: It called the frontend with success and got a valid redirectUrl for each ads
+ selector: span[tracetest.span.type="general" name="Tracetest trigger"]
+ assertions:
+ - attr:tracetest.response.status = 200
+ - attr:tracetest.response.body | json_path '$[0].redirectUrl' contains "/product/"
+ - attr:tracetest.response.body | json_path '$[1].redirectUrl' contains "/product/"
+ - name: It returns two ads
+ selector: span[tracetest.span.type="rpc" name="oteldemo.AdService/GetAds" rpc.system="grpc" rpc.method="GetAds" rpc.service="oteldemo.AdService"]
+ assertions:
+ - attr:app.ads.count = 2