@@ -6,15 +6,21 @@ Feature: Lobby Discovery
66
77 Scenario : List empty lobby set
88 Given "green" is connected as "1u8fw4aph5ypt" and ready for game "f666036d-d9e1-4d70-b0c3-4a68b24a9884"
9- When "green" requests all lobbies
9+ When "green" requests lobbies with:
10+ """json
11+ {}
12+ """
1013 Then "green" should receive 0 lobbies
1114
1215 Scenario : Don't list lobbies from a different game
1316 Given "green" creates a network for game "f666036d-d9e1-4d70-b0c3-4a68b24a9884"
1417 And "blue" is connected as "h5yzwyizlwao" and ready for game "4307bd86-e1df-41b8-b9df-e22afcf084bd"
1518 And "yellow" is connected as "19yrzmetd2bn7" and ready for game "4307bd86-e1df-41b8-b9df-e22afcf084bd"
1619 And "blue,yellow" are joined in a lobby
17- When "green" requests all lobbies
20+ When "green" requests lobbies with:
21+ """json
22+ {}
23+ """
1824 Then "green" should receive 0 lobbies
1925
2026 Scenario : List lobbies that exist
@@ -29,7 +35,10 @@ Feature: Lobby Discovery
2935 """
3036 And "blue" receives the network event "lobby" with the argument "19yrzmetd2bn7"
3137
32- When "green" requests all lobbies
38+ When "green" requests lobbies with:
39+ """json
40+ {}
41+ """
3342 Then "green" should have received only these lobbies:
3443 | code | playerCount |
3544 | 19yrzmetd2bn7 | 1 |
@@ -54,7 +63,10 @@ Feature: Lobby Discovery
5463 """
5564 And "yellow" receives the network event "lobby" with the argument "prb67ouj837u"
5665
57- When "green" requests all lobbies
66+ When "green" requests lobbies with:
67+ """json
68+ {}
69+ """
5870 Then "green" should have received only these lobbies:
5971 | code | playerCount | public |
6072 | 3t3cfgcqup9e | 1 | true |
@@ -74,7 +86,7 @@ Feature: Lobby Discovery
7486 | 8qva9vyurwbbl | 54fa57d5 -b4bd -401d -981d -2c13de99be27 | 9 | true |
7587 | 9qva9vyurwbbl | f666036d -d9e1 -4d70 -b0c3 -4a68b24a9884 | 10 | true |
7688
77- When "green" requests lobbies with this filter :
89+ When "green" requests lobbies with:
7890 """json
7991 {
8092 "playerCount": {
@@ -97,7 +109,7 @@ Feature: Lobby Discovery
97109 | 1qva9vyurwbbl | f666036d -d9e1 -4d70 -b0c3 -4a68b24a9884 | 1 | {"map ": "de_dust "} | true | 2020 -01 -02 |
98110 | 2qva9vyurwbbl | f666036d -d9e1 -4d70 -b0c3 -4a68b24a9884 | 1 | {"map ": "de_nuke "} | true | 2020 -01 -03 |
99111
100- When "green" requests lobbies with this filter :
112+ When "green" requests lobbies with:
101113 """json
102114 {
103115 "map": "de_nuke",
@@ -126,7 +138,10 @@ Feature: Lobby Discovery
126138 When "blue" disconnects
127139 Then "blue" receives the network event "close"
128140
129- When "green" requests all lobbies
141+ When "green" requests lobbies with:
142+ """json
143+ {}
144+ """
130145 Then "green" should have received only these lobbies:
131146 | code | playerCount |
132147 | HC6Y | 0 |
@@ -152,7 +167,7 @@ Feature: Lobby Discovery
152167 """
153168 And "green" receives the network event "lobby" with the argument "19yrzmetd2bn7"
154169
155- When "blue" requests lobbies with this filter :
170+ When "blue" requests lobbies with:
156171 """json
157172 {
158173 "map": "de_nuke"
@@ -162,3 +177,20 @@ Feature: Lobby Discovery
162177 | code |
163178 | 19yrzmetd2bn7 |
164179 | 3qva9vyurwbb |
180+
181+ Scenario : Sort lobbies with a custom order
182+ Given "green" is connected as "1u8fw4aph5ypt" and ready for game "f666036d-d9e1-4d70-b0c3-4a68b24a9884"
183+ And these lobbies exist:
184+ | code | game | playerCount | public | created_at |
185+ | 1qva9vyurwbb | f666036d -d9e1 -4d70 -b0c3 -4a68b24a9884 | 1 | true | 2020 -01 -03 |
186+ | 2qva9vyurwbb | f666036d -d9e1 -4d70 -b0c3 -4a68b24a9884 | 3 | true | 2020 -01 -02 |
187+ | 3qva9vyurwbb | f666036d -d9e1 -4d70 -b0c3 -4a68b24a9884 | 5 | true | 2020 -01 -01 |
188+
189+ When "green" requests lobbies with:
190+ | filter | {} |
191+ | sort | { "playerCount ": -1 } |
192+ | limit | 2 |
193+ Then "green" should have received only these lobbies:
194+ | code | playerCount |
195+ | 3qva9vyurwbb | 5 |
196+ | 2qva9vyurwbb | 3 |
0 commit comments