-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusers.feature
48 lines (40 loc) · 1.04 KB
/
users.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
42
43
44
45
46
47
48
@run
Feature: sample karate test script
for help, see: https://github.com/intuit/karate/wiki/IDE-Support
Background:
* url 'https://jsonplaceholder.typicode.com'
@get_users
Scenario: get all users and then get the first user by id
Given path 'users'
When method get
Then status 200
* def first = response[0]
Given path 'users', first.id
When method get
Then status 200
@create_user
Scenario: create a user and then get it by id
* def user =
"""
{
"name": "Test User",
"username": "testuser",
"email": "test@user.com",
"address": {
"street": "Has No Name",
"suite": "Apt. 123",
"city": "Electri",
"zipcode": "54321-6789"
}
}
"""
Given url 'https://jsonplaceholder.typicode.com/users'
And request user
When method post
Then status 201
* def id = response.id
* print 'created id is: ', id
Given path id
# When method get
# Then status 200
# And match response contains user