-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsimple.feature
36 lines (30 loc) · 1.22 KB
/
simple.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
33
34
35
36
Feature:
Background:
* def urlBase = karate.properties['url.base'] || karate.get('urlBase', 'http://localhost:8080')
* url urlBase + '/api/todos'
Scenario: simple crud flow
# create first todo record and save the id
* request { title: 'First', complete: false }
* method post
* status 200
* match response == { id: '#string', title: 'First', complete: false }
* def id = response.id
# get newly created todo by id
* path id
* method get
* status 200
* match response == { id: '#(id)', title: 'First', complete: false }
# get all todos and verify that the newly created todo is in the list
* method get
* status 200
* match response contains [{ id: '#(id)', title: 'First', complete: false }]
# create a second todo record and save the id
* request { title: 'Second', complete: false }
* method post
* status 200
* match response == { id: '#string', title: 'Second', complete: false }
* def id = response.id
# get all todos and verify that both the newly created ids are present
* method get
* status 200
* match response contains [{ id: '#string', title: 'First', complete: false },{ id: '#(id)', title: 'Second', complete: false }]