1 module FakeWebsocketHelper
2 def use_fake_websocket_driver
3 Capybara.current_driver = :poltergeist_with_fake_websocket
6 def fake_websocket_event(logdata)
7 stamp = Time.now.utc.in_time_zone.as_json
9 owner_uuid: api_fixture('users')['system_user']['uuid'],
14 event = {data: Oj.dump(defaults.merge(logdata), mode: :compat)}
15 script = '$(window).data("arv-websocket").onmessage('+Oj.dump(event, mode: :compat)+');'
16 page.evaluate_script(script)