-
Notifications
You must be signed in to change notification settings - Fork 67
/
import-pokemon.yaml
29 lines (29 loc) 路 1.14 KB
/
import-pokemon.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
type: Test
spec:
id: artillery-engine-import-pokemon
name: "Artillery Engine: Import Pokemon"
trigger:
type: http
httpRequest:
method: POST
url: ${var:ENDPOINT}/pokemon/import
body: '{"id": ${var:POKEMON_ID}}'
headers:
- key: Content-Type
value: application/json
specs:
- selector: span[tracetest.span.type="general" name = "validate request"] span[tracetest.span.type="http"]
name: "All HTTP Spans: Status code is 200"
assertions:
- attr:http.status_code = 200
- selector: span[tracetest.span.type="http" name="GET" http.method="GET"]
assertions:
- attr:http.route = "/api/v2/pokemon/${var:POKEMON_ID}"
- selector: span[tracetest.span.type="database"]
name: "All Database Spans: Processing time is less than 1s"
assertions:
- attr:tracetest.span.duration < 1s
outputs:
- name: DATABASE_POKEMON_ID
selector: span[tracetest.span.type="database" name="create postgres.pokemon" db.system="postgres" db.name="postgres" db.user="postgres" db.operation="create" db.sql.table="pokemon"]
value: attr:db.result | json_path '$.id'