This repository has been archived by the owner on Feb 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathpresence-connection.feature
57 lines (44 loc) · 2.07 KB
/
presence-connection.feature
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@presence
Feature: Presence Connectivity
Presence subscription must be sent to the server.
after connection issues to guarantee
it continues recieving them correctly.
Scenario: Client loses connection
# The client is connected
Given the test server is ready
And the client is initialised
And the server sends the message C|A+
And the client logs in with username "XXX" and password "YYY"
And the server sends the message A|A+
Given the client subscribes to presence events for "userA,userB"
Then the server received the message U|S|1|["userA","userB"]+
# The server sends an ACK message for subscription
Given the server sends the message U|A|S|1+
Given the client subscribes to all presence events
Then the server received the message U|S|S+
# The server sends an ACK message for subscription
Given the server sends the message U|A|S|S+
# The client loses its connection to the server
When the connection to the server is lost
Given two seconds later
Then the client throws a "connectionError" error with message "Can't connect! Deepstream server unreachable on ws://localhost:7777/deepstream"
And the clients connection state is "RECONNECTING"
# The client tries to query for connected clients
Given the client queries for connected clients
Then the server did not recieve any messages
Given the client queries if "userA,userB" are online
Then the server did not recieve any messages
# The client reconnects to the server
When the connection to the server is reestablished
And the server sends the message C|A+
Then the clients connection state is "AUTHENTICATING"
# The client successfully reconnects
Given the client logs in with username "XXX" and password "YYY"
And the server sends the message A|A+
Then the clients connection state is "OPEN"
# The client resends the presence subscription
Then the server received the message U|S|3|["userA","userB"]+
And the server received the message U|S|S+
# The client resends the query
Then the server received the message U|Q|Q+
And the server received the message U|Q|2|["userA","userB"]+