-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsample-test.sh
executable file
·26 lines (20 loc) · 1.13 KB
/
sample-test.sh
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
#!/usr/bin/env bash
# To run:
# ./sample-test.sh -u https://duckduckgo.com
# or
# SHAKEDOWN_URL=https://duckduckgo.com ./sample-test.sh
source shakedown.sh # load the framework
shakedown GET /about # make a GET request
status 200 # assert response status is 200
content_type 'text/html' # assert content type contains string
header 'Expires' # assert response header exists containing string
contains 'DuckDuckGo' # assert response body contains string
shakedown POST / -L -d "q=Bob%20Seger" # make a POST request with form data
status 200
contains 'Robert Clark Seger'
shakedown GET http://www.google.com -L # provide full url to override default base url.
status 200 # -L cURL option to follow redirects
shakedown GET http://www.google.com
header_contains 'Cache-Control' 'private' # assert header 'Cache-Control' contains 'private'
#print_headers # debug helper
#print_body # debug helper