Skip to content

Instantly share code, notes, and snippets.

@nickstenning
Created May 16, 2017 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickstenning/baf11131c7495bbb5931824054810f53 to your computer and use it in GitHub Desktop.
Save nickstenning/baf11131c7495bbb5931824054810f53 to your computer and use it in GitHub Desktop.
Feature: Real-time websocket streaming # features/streamer.feature:1
Scenario: Receiving recently-created annotations over the websocket # features/streamer.feature:2
Given I am acting as the test user "smokey" # features/steps/api.py:44
And I am listening for notifications on the websocket # features/steps/websocket.py:75
client >> Frame(fin=True, opcode=1, data=b'{"messageType": "client_id", "value": "c9c9cf10-7f4e-433a-9817-934ac8db6670"}')
2017-05-16 17:44:23 [DEBUG] client >> Frame(fin=True, opcode=1, data=b'{"messageType": "client_id", "value": "c9c9cf10-7f4e-433a-9817-934ac8db6670"}')
client >> Frame(fin=True, opcode=1, data=b'{"filter": {"clauses": [], "actions": {"create": true, "update": true, "delete": true}, "match_policy": "include_all"}}')
2017-05-16 17:44:23 [DEBUG] client >> Frame(fin=True, opcode=1, data=b'{"filter": {"clauses": [], "actions": {"create": true, "update": true, "delete": true}, "match_policy": "include_all"}}')
When I create a test annotation # features/steps/api.py:60
Then I should receive a websocket notification within 30s # features/steps/websocket.py:103
client << Frame(fin=True, opcode=1, data=b'{"type": "annotation-notification", "options": {"action": "create"}, "payload": [{"updated": "2017-05-16T15:44:23.692978+00:00", "group": "__world__", "links": {"json": "https://qa.hypothes.is/api/annotations/iO0_ajpOEeeX8LtdwOu7Lg", "html": "https://qa.hypothes.is/a/iO0_ajpOEeeX8LtdwOu7Lg", "incontext": "https://qa.hyp.is/iO0_ajpOEeeX8LtdwOu7Lg/example.com"}, "smokey": true, "tags": [], "text": "", "created": "2017-05-16T15:44:23.692978+00:00", "uri": "http://example.com", "user": "acct:nickstenning@hypothes.is", "target": [{"source": "http://example.com"}], "document": {"title": ["Example Domain"]}, "id": "iO0_ajpOEeeX8LtdwOu7Lg", "permissions": {"read": ["group:__world__"], "admin": ["acct:nickstenning@hypothes.is"], "update": ["acct:nickstenning@hypothes.is"], "delete": ["acct:nickstenning@hypothes.is"]}}]}')
2017-05-16 17:44:23 [DEBUG] client << Frame(fin=True, opcode=1, data=b'{"type": "annotation-notification", "options": {"action": "create"}, "payload": [{"updated": "2017-05-16T15:44:23.692978+00:00", "group": "__world__", "links": {"json": "https://qa.hypothes.is/api/annotations/iO0_ajpOEeeX8LtdwOu7Lg", "html": "https://qa.hypothes.is/a/iO0_ajpOEeeX8LtdwOu7Lg", "incontext": "https://qa.hyp.is/iO0_ajpOEeeX8LtdwOu7Lg/example.com"}, "smokey": true, "tags": [], "text": "", "created": "2017-05-16T15:44:23.692978+00:00", "uri": "http://example.com", "user": "acct:nickstenning@hypothes.is", "target": [{"source": "http://example.com"}], "document": {"title": ["Example Domain"]}, "id": "iO0_ajpOEeeX8LtdwOu7Lg", "permissions": {"read": ["group:__world__"], "admin": ["acct:nickstenning@hypothes.is"], "update": ["acct:nickstenning@hypothes.is"], "delete": ["acct:nickstenning@hypothes.is"]}}]}')
client >> Frame(fin=True, opcode=8, data=b'\x03\xe8')
2017-05-16 17:44:23 [DEBUG] client >> Frame(fin=True, opcode=8, data=b'\x03\xe8')
client << Frame(fin=True, opcode=8, data=b'\x03\xe8')
2017-05-16 17:44:24 [DEBUG] client << Frame(fin=True, opcode=8, data=b'\x03\xe8')
1 feature passed, 0 failed, 0 skipped
1 scenario passed, 0 failed, 0 skipped
4 steps passed, 0 failed, 0 skipped, 0 undefined
Took 0m1.654s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment