forked from karatelabs/karate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cats-test.feature
36 lines (29 loc) · 1001 Bytes
/
cats-test.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: integration test
Background:
* def port = karate.env == 'mock' ? karate.start('cats-mock.feature').port : 8080
* url 'http://localhost:' + port + '/cats'
Scenario: create cat
Given request { name: 'Billie' }
When method post
Then status 200
And match response == { id: '#uuid', name: 'Billie' }
And def id = response.id
Given path id
When method get
Then status 200
And match response == { id: '#(id)', name: 'Billie' }
When method get
Then status 200
And match response contains [{ id: '#(id)', name: 'Billie' }]
Given request { name: 'Bob' }
When method post
Then status 200
And match response == { id: '#uuid', name: 'Bob' }
And def id = response.id
Given path id
When method get
Then status 200
And match response == { id: '#(id)', name: 'Bob' }
When method get
Then status 200
And match response contains [{ id: '#uuid', name: 'Billie' },{ id: '#(id)', name: 'Bob' }]