-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathartillery.yaml
52 lines (52 loc) · 1.26 KB
/
artillery.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
config:
target: "http://localhost:4000"
order: "sequence"
phases:
- duration: 300
arrivalRate: 10
maxVusers: 50
name: Main phase
before:
flow:
- log: "Get auth token"
- post:
url: "/login"
json:
login: "admin"
password: "admin"
capture:
- json: $.token
as: token
scenarios:
- flow:
- get:
url: "/users"
headers:
authorization: "Bearer {{ token }}"
- post:
url: "/users"
headers:
authorization: "Bearer {{ token }}"
json:
name: "User{{ $randomString(10) }}"
login: "User{{ $randomString(10) }}"
password: "123456"
capture:
- json: $.id
as: id
- get:
url: "/users/{{ id }}"
headers:
authorization: "Bearer {{ token }}"
- put:
url: "/users/{{ id }}"
headers:
authorization: "Bearer {{ token }}"
json:
name: "User{{ $randomString(10) }}"
login: "User{{ $randomString(10) }}"
password: "123456"
- delete:
url: "/users/{{ id }}"
headers:
authorization: "Bearer {{ token }}"