-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
206 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# accessing the route without required params should return an error | ||
GET {{ app_host }}/check/link | ||
HTTP 302 | ||
[Asserts] | ||
header "Location" == "/check" | ||
|
||
GET {{ app_host }}/check/link?dataset=foo | ||
HTTP 302 | ||
[Asserts] | ||
header "Location" == "/check" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
GET {{ app_host }}/check/link | ||
[QueryStringParams] | ||
dataset: conservation-area | ||
orgName: Some Organisation | ||
HTTP 302 | ||
[Captures] | ||
session-id: cookie "connect.sid" | ||
upload-method-location: header "Location" | ||
|
||
GET {{ app_host }}{{ upload-method-location }} | ||
[Cookies] | ||
connect.sid: {{ session-id }} | ||
HTTP 200 | ||
[Asserts] | ||
xpath "string(/html/head/title)" contains "How do you want to provide your data" | ||
|
||
POST {{ app_host }}{{ upload-method-location }} | ||
[Cookies] | ||
connect.sid: {{ session-id }} | ||
[FormParams] | ||
upload-method: file | ||
HTTP 302 | ||
[Captures] | ||
upload-url: header "Location" | ||
|
||
GET {{ app_host }}{{ upload-url }} | ||
HTTP 200 | ||
[Asserts] | ||
xpath "string(/html/head/title)" contains "Upload data" | ||
|
||
POST {{ app_host }}{{ upload-url }} | ||
[Cookies] | ||
connect.sid: {{ session-id }} | ||
[MultipartFormData] | ||
datafile: file,common/geox-geoy-example.csv; | ||
HTTP 302 | ||
[Captures] | ||
status-url: header "Location" | ||
|
||
GET {{ app_host }}{{ status-url }} | ||
[Cookies] | ||
connect.sid: {{ session-id }} | ||
HTTP 200 | ||
[Asserts] | ||
xpath "string(/html/head/title)" contains "Status" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
GET {{ app_host }}/check/link | ||
[QueryStringParams] | ||
dataset: conservation-area | ||
orgName: Some Organisation | ||
HTTP 302 | ||
[Captures] | ||
session-id: cookie "connect.sid" | ||
upload-method-location: header "Location" | ||
|
||
GET {{ app_host }}{{ upload-method-location }} | ||
[Cookies] | ||
connect.sid: {{ session-id }} | ||
HTTP 200 | ||
[Asserts] | ||
xpath "string(/html/head/title)" contains "How do you want to provide your data" | ||
|
||
GET {{ app_host }}/check/dataset | ||
[Cookies] | ||
connect.sid: {{ session-id }} | ||
HTTP 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
GET {{ app_host }}/check/link | ||
[QueryStringParams] | ||
dataset: tree | ||
orgName: Some Organisation | ||
HTTP 302 | ||
[Captures] | ||
session-id: cookie "connect.sid" | ||
geometry-type-location: header "Location" | ||
|
||
GET {{ app_host }}{{ geometry-type-location }} | ||
[Cookies] | ||
connect.sid: {{ session-id }} | ||
HTTP 200 | ||
[Asserts] | ||
xpath "string(/html/head/title)" contains "Is your geometry data given as points or polygons" | ||
|
||
POST {{ app_host }}{{ geometry-type-location }} | ||
[Cookies] | ||
connect.sid: {{ session-id }} | ||
[FormParams] | ||
geomType: point | ||
# alternatively, geomType: polygon | ||
HTTP 302 | ||
[Captures] | ||
upload-method-location: header "Location" | ||
|
||
GET {{ app_host }}{{ upload-method-location }} | ||
[Cookies] | ||
connect.sid: {{ session-id }} | ||
HTTP 200 | ||
[Asserts] | ||
xpath "string(/html/head/title)" contains "How do you want to provide your data" | ||
|
||
POST {{ app_host }}{{ upload-method-location }} | ||
[Cookies] | ||
connect.sid: {{ session-id }} | ||
[FormParams] | ||
upload-method: url | ||
HTTP 302 | ||
[Captures] | ||
upload-url: url | ||
|
||
POST {{ app_host }}/check/url | ||
[Cookies] | ||
connect.sid: {{session-id}} | ||
[FormParams] | ||
url: https://gist.githubusercontent.com/rosado/3994e2420857d5c6b0e3bd8dc1488aa1/raw/bf1b52316f66a480a6d116c993ffd57d119094f9/geox-geoy-example.csv | ||
HTTP 302 | ||
[Captures] | ||
status-url: header "Location" | ||
|
||
GET {{ app_host }}{{ status-url }} | ||
HTTP 200 | ||
[Asserts] | ||
xpath "string(/html/head/title)" contains "Status" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
GET {{ app_host }}/check/link | ||
[QueryStringParams] | ||
dataset: conservation-area | ||
orgName: Some Organisation | ||
HTTP 302 | ||
[Captures] | ||
session-id: cookie "connect.sid" | ||
upload-method-location: header "Location" | ||
|
||
GET {{ app_host }}{{ upload-method-location }} | ||
[Cookies] | ||
connect.sid: {{ session-id }} | ||
HTTP 200 | ||
[Asserts] | ||
xpath "string(/html/head/title)" contains "How do you want to provide your data" | ||
xpath "string(/html/body/div[2]/main/div/div/form/span)" contains "Conservation area dataset" | ||
|
||
POST {{ app_host }}{{ upload-method-location }} | ||
[Cookies] | ||
connect.sid: {{ session-id }} | ||
[FormParams] | ||
upload-method: url | ||
HTTP 302 | ||
[Captures] | ||
upload-url: url | ||
|
||
POST {{ app_host }}/check/url | ||
[Cookies] | ||
connect.sid: {{ session-id }} | ||
[FormParams] | ||
url: https://gist.githubusercontent.com/rosado/3994e2420857d5c6b0e3bd8dc1488aa1/raw/bf1b52316f66a480a6d116c993ffd57d119094f9/geox-geoy-example.csv | ||
HTTP 302 | ||
[Captures] | ||
status-url: header "Location" | ||
|
||
GET {{ app_host }}{{ status-url }} | ||
HTTP 200 | ||
[Asserts] | ||
xpath "string(/html/head/title)" contains "Status" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# arguments: | ||
# FILE_OR_DIR - optional, name of the file to run, if not provided, runs all scripts | ||
# | ||
# env: | ||
# HURL_app_host - optional, defaults to "http://localhost:5000" | ||
# HURL_report_dir - optional | ||
|
||
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
|
||
app_host="${HURL_app_host:-"http://localhost:5000"}" | ||
report_dir="${HURL_report_dir:-""}" | ||
test_file="${1:-"${script_dir}"}" | ||
|
||
report_option="" | ||
if [ -n "${report_dir}" ]; then | ||
report_option="--report-html ${report_dir}" | ||
fi | ||
|
||
echo | ||
echo "ℹ️ Running scripts in directory $script_dir" | ||
echo "ℹ️ app_host=${app_host}" | ||
echo | ||
|
||
function run_hurl() { | ||
local file=$1 | ||
hurl --test ${report_option} \ | ||
--variable app_host="${app_host}" \ | ||
${file} | ||
} | ||
|
||
if [ -z "${test_file}" ]; then | ||
run_hurl "${script_dir}" | ||
else | ||
echo " running single test" | ||
run_hurl ${test_file} | ||
fi |