-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
cookie.yml
36 lines (36 loc) · 1.04 KB
/
cookie.yml
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
desc: Inherit cookies Example
runners:
req:
endpoint: ${HTTPBIN_END_POINT:-https://httpbin.org/}
openapi3: https://tryapisproxy.com/spec/httpbin
vars:
cookie:
key: "cookie-name"
value: "cookie-value"
debug: ${DEBUG:-true}
steps:
bindUuid:
desc: UUIDs are numbered in the image of a session.
bind:
uuid: faker.UUID()
setCookie:
desc: Returns a set of response headers from the query string.
req:
/response-headers?Set-Cookie={{ vars.cookie.key }}%3D{{ uuid }}:
get:
body: null
test: |
current.res.status == 200
&& current.res.cookies[vars.cookie.key].Name == vars.cookie.key
&& current.res.cookies[vars.cookie.key].Value == uuid
inheritCookie:
desc: Returns cookie data.
req:
/cookies:
get:
headers:
Cookie: "{{ cookies[url('${HTTPBIN_END_POINT:-https://httpbin.org/}').Host][vars.cookie.key].Raw }};"
body: null
test: |
current.res.status == 200
&& current.res.body.cookies[vars.cookie.key] == uuid