Skip to content

Commit 7ba428e

Browse files
committed
Add SSO and admin example Hurl flows
1 parent 928c383 commit 7ba428e

3 files changed

Lines changed: 159 additions & 3 deletions

File tree

examples/SQLPage developer user interface/test.hurl

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
GET http://localhost:8080/
2+
HTTP 200
3+
[Asserts]
4+
header "Content-Type" contains "text/html"
5+
body contains "Website files"
6+
body contains "Create new file"
7+
body contains "Database tables"
8+
body contains "sqlpage_files"
9+
body htmlUnescape contains "view_table.sql?table%5Fname=sqlpage%5Ffiles"
10+
body not contains "An error occurred"
11+
12+
GET http://localhost:8080/edit.sql
13+
HTTP 200
14+
[Asserts]
15+
body contains "New page"
16+
body contains "insert_file.sql"
17+
body contains "code-editor"
18+
body not contains "An error occurred"
19+
20+
POST http://localhost:8080/insert_file.sql
21+
[FormParams]
22+
path: hurl_test.sql
23+
contents: SELECT 'text' as component, 'Hello from Hurl' as contents;
24+
HTTP 302
25+
[Asserts]
26+
header "Location" == "index.sql?inserted=hurl%5Ftest%2Esql"
27+
28+
GET http://localhost:8080/hurl_test.sql
29+
HTTP 200
30+
[Asserts]
31+
body contains "Hello from Hurl"
32+
body not contains "An error occurred"
33+
34+
GET http://localhost:8080/
35+
HTTP 200
36+
[Asserts]
37+
body contains "hurl_test.sql"
38+
body htmlUnescape contains "edit.sql?path=hurl%5Ftest%2Esql"
39+
body htmlUnescape contains "delete.sql?path=hurl%5Ftest%2Esql"
40+
body not contains "An error occurred"
41+
42+
GET http://localhost:8080/view_table.sql?table_name=sqlpage_files
43+
HTTP 200
44+
[Asserts]
45+
body contains "sqlpage_files"
46+
body contains "hurl_test.sql"
47+
body not contains "An error occurred"
48+
49+
GET http://localhost:8080/delete.sql?path=hurl_test.sql
50+
HTTP 200
51+
[Asserts]
52+
body contains "Delete hurl_test.sql ?"
53+
body htmlUnescape contains "delete.sql?path=hurl%5Ftest%2Esql&confirm=yes"
54+
body not contains "An error occurred"
55+
56+
GET http://localhost:8080/delete.sql?path=hurl_test.sql&confirm=yes
57+
HTTP 302
58+
[Asserts]
59+
header "Location" == "index.sql?deleted=hurl%5Ftest%2Esql"
60+
61+
GET http://localhost:8080/
62+
HTTP 200
63+
[Asserts]
64+
body not contains "hurl_test.sql"
65+
body not contains "An error occurred"

examples/make a geographic data application using sqlite extensions/test.hurl

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
GET http://localhost:8080/
2+
HTTP 200
3+
[Asserts]
4+
body contains "Points of interest"
5+
body contains "Add a point"
6+
body not contains "An error occurred"
7+
8+
POST http://localhost:8080/add_point.sql
9+
[FormParams]
10+
Title: Hurl Paris
11+
Latitude: 48.8566
12+
Longitude: 2.3522
13+
Text: First Hurl point
14+
HTTP 302
15+
[Asserts]
16+
header "Location" == "index.sql"
17+
18+
POST http://localhost:8080/add_point.sql
19+
[FormParams]
20+
Title: Hurl Lyon
21+
Latitude: 45.764
22+
Longitude: 4.8357
23+
Text: Second Hurl point
24+
HTTP 302
25+
26+
GET http://localhost:8080/
27+
HTTP 200
28+
[Captures]
29+
paris_id: xpath "substring-after(string(//a[normalize-space(.)='Hurl Paris']/@href), 'id=')"
30+
[Asserts]
31+
body contains "Hurl Paris"
32+
body contains "Hurl Lyon"
33+
body htmlUnescape contains "point.sql?id={{paris_id}}"
34+
body not contains "An error occurred"
35+
36+
GET http://localhost:8080/point.sql?id={{paris_id}}
37+
HTTP 200
38+
[Asserts]
39+
body contains "48.8566"
40+
body contains "2.3522"
41+
body contains "First Hurl point"
42+
body contains "Closest points"
43+
body contains "Hurl Lyon"
44+
body not contains "An error occurred"

examples/single sign on/test.hurl

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/single sign on/test.hurl

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
GET http://localhost:8080
2+
HTTP 200
3+
[Asserts]
4+
header "Content-Type" contains "text/html"
5+
body contains "Welcome"
6+
body contains "Log in"
7+
body htmlUnescape contains "/protected"
8+
body not contains "An error occurred"
9+
10+
GET http://localhost:8080/protected
11+
HTTP 303
12+
[Captures]
13+
login_url: header "Location"
14+
[Asserts]
15+
header "Location" contains "http://localhost:8181/realms/sqlpage_demo/protocol/openid-connect/auth"
16+
17+
GET {{login_url}}
18+
HTTP 200
19+
[Captures]
20+
login_action: xpath "string(//form[@id='kc-form-login']/@action)"
21+
[Asserts]
22+
xpath "//form[@id='kc-form-login']" exists
23+
xpath "//input[@name='username']" exists
24+
xpath "//input[@name='password']" exists
25+
body htmlUnescape contains "client_id=sqlpage"
26+
27+
POST {{login_action}}
28+
[FormParams]
29+
username: demo
30+
password: demo
31+
credentialId:
32+
HTTP 302
33+
[Captures]
34+
callback_url: header "Location"
35+
[Asserts]
36+
header "Location" contains "http://localhost:8080/sqlpage/oidc_callback"
37+
38+
GET {{callback_url}}
39+
HTTP 303
40+
[Asserts]
41+
header "Location" == "/protected"
42+
43+
GET http://localhost:8080/protected/
44+
HTTP 200
45+
[Asserts]
46+
body htmlUnescape contains "You're in, John Smith"
47+
body contains "demo@example.com"
48+
body contains "You have access to this protected page."
49+
body htmlUnescape contains "/assets/welcome.jpeg"
50+
body not contains "An error occurred"

0 commit comments

Comments
 (0)