diff options
Diffstat (limited to 'test/tracetesting/frontend/02-get-product-recommendation.yaml')
| -rw-r--r-- | test/tracetesting/frontend/02-get-product-recommendation.yaml | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/tracetesting/frontend/02-get-product-recommendation.yaml b/test/tracetesting/frontend/02-get-product-recommendation.yaml new file mode 100644 index 0000000..78569c3 --- /dev/null +++ b/test/tracetesting/frontend/02-get-product-recommendation.yaml @@ -0,0 +1,36 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + +type: Test +spec: + id: frontend-get-recommendation + name: 'Frontend: Get recommendations' + description: Simulate the user seeing recomendations on Astronomy Shop + trigger: + type: http + httpRequest: + url: http://${var:FRONTEND_ADDR}/api/recommendations + method: GET + headers: + - key: Content-Type + value: application/json + body: | + { + "productIds":[ + "0PUK6V6EV0", + "1YMWWN1N4O", + "2ZYFJ3GM2N", + "66VCHSJNUP", + "6E92ZMYYFZ" + ] + } + specs: + - name: It called the frontend with success + selector: span[tracetest.span.type="general" name="Tracetest trigger"] + assertions: + - attr:tracetest.response.status = 200 + - name: It called ListRecommendations correctly and got 5 products + selector: span[tracetest.span.type="rpc" name="/oteldemo.RecommendationService/ListRecommendations" rpc.system="grpc" rpc.method="ListRecommendations" rpc.service="oteldemo.RecommendationService"] + assertions: + - attr:rpc.grpc.status_code = 0 + - attr:app.products_recommended.count = 5 |
