Skip to content

Commit 1289727

Browse files
committed
Add corporate conundrum Hurl workflow
1 parent 9705d20 commit 1289727

1 file changed

Lines changed: 55 additions & 1 deletion

File tree

examples/corporate-conundrum/test.hurl

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
GET http://localhost:8080
2+
HTTP 200
3+
[Asserts]
4+
body contains "Welcome to Corporate Conundrum"
5+
body contains "Start a New Game"
6+
body not contains "An error occurred"
7+
8+
GET http://localhost:8080/New%20Game.sql
9+
HTTP 302
10+
[Captures]
11+
game_id: header "Location" regex "id=(-?\\d+)"
12+
[Asserts]
13+
header "Location" matches "^game\\.sql\\?id=-?\\d+$"
14+
15+
GET http://localhost:8080/game.sql?id={{game_id}}&Player=Alice
16+
HTTP 200
17+
[Asserts]
18+
body contains "Players"
19+
body contains "Alice"
20+
body contains "Add a new player"
21+
body not contains "An error occurred"
22+
23+
GET http://localhost:8080/next-question.sql?game_id={{game_id}}&player=Alice
24+
HTTP 302
25+
[Captures]
26+
question_id: header "Location" regex "question%5Fid=(\\d+)"
27+
[Asserts]
28+
header "Location" contains "question.sql"
29+
header "Location" contains "player=Alice"
30+
31+
GET http://localhost:8080/question.sql?game_id={{game_id}}&question_id={{question_id}}&player=Alice
32+
HTTP 200
33+
[Asserts]
34+
body contains "Submit your answer"
35+
body contains "Your answer"
36+
body not contains "An error occurred"
37+
38+
GET http://localhost:8080/wait.sql?game_id={{game_id}}&question_id={{question_id}}&player=Alice&answer=42
39+
HTTP 200
40+
[Asserts]
41+
body contains "Waiting for other players to answer"
42+
body not contains "An error occurred"
43+
44+
GET http://localhost:8080/next-question.sql?game_id={{game_id}}&player=Alice
45+
HTTP 302
46+
[Asserts]
47+
header "Location" contains "game-over.sql"
48+
49+
GET http://localhost:8080/game-over.sql?game_id={{game_id}}
50+
HTTP 200
51+
[Asserts]
52+
body contains "The game is over"
53+
body contains "Scores"
54+
body contains "Alice"
55+
body not contains "An error occurred"

0 commit comments

Comments
 (0)