forked from karatelabs/karate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
call-isolated-headers.feature
32 lines (25 loc) · 1.17 KB
/
call-isolated-headers.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
28
29
30
31
32
Feature: when not using 'shared scope', 'configure headers' may need to be
duplicated even in 'called' features and the variables needed for the
headers JS routine should be returned and made available to the 'caller'
Background:
# note how this next line has to be duplicated in 'common-multiple.feature'
* configure headers = read('classpath:headers.js')
* def setup = callonce read('common-multiple.feature')
# and we have to ensure the 'time' and 'token' variables are set for 'headers.js' to work
* def time = setup.time
* def token = setup.token
# a cookie is also needed in our authentication demo example
* cookie time = setup.time
# for an example of using 'shared scope' which simplifies the above
# refer to 'call-updates-config.feature' and 'common.feature'
* url demoBaseUrl
Scenario: all auth headers have been set via the background and 'common-multiple.feature'
Given path 'headers', token
And param url = demoBaseUrl
When method get
Then status 200
Scenario: make sure that the second scenario also works well with the 'callonce' in the background
Given path 'headers', token
And param url = demoBaseUrl
When method get
Then status 200