-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathslumber.yml
154 lines (142 loc) · 3.34 KB
/
slumber.yml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# Note: This file is meant primarily for development and testing of Slumber. It
# is not intended as documentation. While it may be a helpful example, canonical
# documentation is at: https://slumber.lucaspickering.me/book/
profiles:
works:
name: This Works
default: true
data:
host: https://httpbin.org
username: xX{{chains.username}}Xx
user_guid: abc123
init-fails:
name: Request Init Fails
data:
request-fails:
name: Request Fails
data:
host: http://localhost:5000
username: xX{{chains.username}}Xx
user_guid: abc123
chains:
username:
source: !command
command: [whoami]
trim: both
password:
source: !prompt
message: Password
sensitive: true
select_value:
source: !select
message: Select a value
options:
- foo
- bar
- baz
- a really really really really long option
- "{{chains.username}}"
select_dynamic:
source: !select
message: Select a value
options: "{{chains.login_form_values}}"
login_form_values:
source: !request
recipe: login
selector: $.form[*]
selector_mode: array
auth_token:
source: !request
recipe: login
trigger: !expire 12h
selector: $.form
image:
source: !file
path: ./static/slumber.png
big_file:
source: !file
path: Cargo.lock
.ignore:
base: &base
authentication: !bearer "{{chains.auth_token}}"
headers:
Accept: application/json
requests:
login: !request
method: POST
url: "{{host}}/anything/login"
authentication: !basic
username: "{{username}}"
password: "{{chains.password}}"
query:
- sudo=yes_please
- fast=no_thanks
- fast=actually_maybe
headers:
Accept: application/json
body: !form_urlencoded
username: "{{username}}"
password: "{{chains.password}}"
users: !folder
name: Users
requests:
get_users: !request
<<: *base
name: Get Users
method: GET
url: "{{host}}/get"
query:
- foo=bar
- select={{chains.select_dynamic}}
get_user: !request
<<: *base
name: Get User
method: GET
url: "{{host}}/anything/{{user_guid}}"
modify_user: !request
<<: *base
name: Modify User
method: PUT
url: "{{host}}/anything/{{user_guid}}"
body:
!json {
"new_username": "user formerly known as {{chains.username}}",
"number": 3,
"bool": true,
"null": null,
"array": [1, 2, false, 3.3, "www.www"],
}
get_image: !request
headers:
Accept: image/png
name: Get Image
method: GET
url: "{{host}}/image"
upload_image: !request
name: Upload Image
method: POST
url: "{{host}}/anything/image"
body: !form_multipart
filename: "logo.png"
image: "{{chains.image}}"
big_file: !request
name: Big File
method: POST
url: "{{host}}/anything"
body: "{{chains.big_file}}"
raw_json: !request
name: Raw JSON
method: POST
url: "{{host}}/anything"
headers:
Content-Type: application/json
body: >
{
"location": "boston",
"size": "HUGE"
}
delay: !request
<<: *base
name: Delay
method: GET
url: "{{host}}/delay/5"