forked from karatelabs/karate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.feature
27 lines (21 loc) · 1.1 KB
/
common.feature
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
@ignore
Feature: common routine that updates the configured headers and cookies
Scenario:
Given url demoBaseUrl
And path 'headers'
When method get
Then status 200
* def time = responseCookies.time.value
* def token = response
# cookies are auto-configured, i.e. they 'persist' for subsequent HTTP calls
# if you are using 'shared scope': https://github.com/intuit/karate#shared-scope
# this next line will update the global scope, which is the recommended approach for re-usable sign-in / auth flows
* configure headers = read('classpath:headers.js')
# if you have more HTTP / API calls as part of this 're-usable' sign-in flow
# they can be made here, and they will use the 'headers.js' configured above
# if you are NOT using 'shared scope', you will need to duplicate the
# 'configure headers' line in your 'caller' feature for your main flow to work
# and ensure that the 'time' and 'token' variables are returned from here
# and set (using 'def') in the 'caller' feature, including cookies if needed
# refer to 'call-isolated-headers.feature' and 'common-multiple.feature'
# for an example of NOT using 'shared scope'