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 pathevents-connection.feature
60 lines (46 loc) · 2.13 KB
/
events-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
58
59
60
@events
Feature: Events Connectivity
Events subscriptions must be resent to the
server after connection issues to guarantee
it continues recieving them correctly.
This applies to both subscribing to events
and listening to event subscriptions.
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+
# The client subscribes to an event
Given the client subscribes to an event named "test1"
Then the last message the server recieved is E|S|test1+
# The server sends an ACK message for test1
Given the server sends the message E|A|S|test1+
# The client listens to eventPrefix
When the client listens to events matching "eventPrefix/.*"
Then the last message the server recieved is E|L|eventPrefix/.*+
# The server sends an ACK message for eventPrefix
Given the server sends the message E|A|L|eventPrefix/.*+
# 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 publishes an event
When the client publishes an event named "test1" with data "yetAnotherValue"
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 event subscription
Then the server received the message E|S|test1+
# The client resends the event listen
Then the server received the message E|L|eventPrefix/.*+
# The client sends offline events
Then the server received the message E|EVT|test1|SyetAnotherValue+