/
01-see-ads.yaml
34 lines (33 loc) 路 1.19 KB
/
01-see-ads.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# test suite based on https://github.com/open-telemetry/opentelemetry-demo/tree/main/test/tracetesting/frontend-service
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