forked from karatelabs/karate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathread-files.feature
30 lines (26 loc) · 868 Bytes
/
read-files.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
Feature: demo reading files and using in a test
Background:
* url demoBaseUrl
# a POST to /echo will simply echo the request payload
* path 'echo'
Scenario: using json from a file
* table employees
| firstName | lastName |
| 'John' | 'Smith' |
| 'Jane' | 'Doe' |
Given request ({ employees: employees })
When method post
Then status 200
And match $ == read('sample.json')
Scenario: using xml from a file
* set payload /employees
| path | value |
| employee[1]/firstName | 'John' |
| employee[1]/lastName | 'Smith' |
| employee[2]/firstName | 'Jane' |
| employee[2]/lastName | 'Doe' |
Given request payload
When method post
Then status 200
And xml response = response
And match response == read('sample.xml')