Optionally specify a list of cookies to be sent with the request. These will be sent as distinct Cookie headers (as per the HTTP spec).
1linkconfiguration:
2link host: api.mycompany.com
3link scheme: https
4link base_path: /api
5linkspecs:
6link - request:
7link method: get
8link path: /account
9link headers:
10link - name: Accept
11link value: application/json
12link cookies:
13link - name: XSRF-Token
14link value: 399do284kds32odh28
15link response:
16link status_code: 200
See also: Example: Suite Using Cookies
Dynamic cookies can be added by setting cookies
as an object to the this.test
context:
1linkconfiguration:
2link scheme: http
3link host: 127.0.0.1
4link port: 3027
5linkspecs:
6link - before_test:
7link run_type: inline
8link inline:
9link function: !!js/function >
10link function() {
11link this.test.cookies = {cookie1: 'cookie1-value'}
12link }
13link request:
14link path: /echoCookies
15link method: get
16link response:
17link status_code: 200
18link json_data:
19link - path: $.cookie1
20link value: cookie1-value
See also: Example: Suite Using Cookies