-
Notifications
You must be signed in to change notification settings - Fork 0
/
kittens.feature
41 lines (34 loc) · 932 Bytes
/
kittens.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
37
38
39
40
41
Feature: cats with kittens
Background:
* configure report = false
* url demoBaseUrl
Scenario: create cat with kittens
# create bob cat
Given path 'cats'
And request { name: 'Bob' }
When method post
Then status 200
* def bob = response
* print 'bob:', bob
# create wild cat
Given path 'cats'
And request { name: 'Wild' }
When method post
Then status 200
* def wild = response
* print 'wild:', wild
* configure report = true
# create mom cat
Given path 'cats'
# sometimes, enclosed javascript is more convenient than embedded expressions
And request ({ name: 'Billie', kittens: [bob, wild] })
When method post
Then status 200
And match response == read('billie-expected.json')
* def billie = response
# get kittens for billie
Given path 'cats', billie.id, 'kittens'
When method get
Then status 200
And match each response == { id: '#number', name: '#string' }
And match response contains { id: '#(wild.id)', name: 'Wild' }