1 require 'integration_helper'
2 require 'selenium-webdriver'
5 class WebsocketTest < ActionDispatch::IntegrationTest
8 headless = Headless.new
10 Capybara.current_driver = :selenium
14 visit(page_with_token("active", "/websockets"))
15 fill_in("websocket-message-content", :with => "Stuff")
17 assert page.has_text? '"status":400'
20 test "test live logging" do
21 visit(page_with_token("active", "/pipeline_instances/zzzzz-d1hrv-9fm8l10i9z2kqc6"))
23 assert page.has_no_text? '123 hello'
25 api = ArvadosApiClient.new
27 Thread.current[:arvados_api_token] = @@API_AUTHS["active"]['api_token']
28 api.api("logs", "", {log: {
29 object_uuid: "zzzzz-d1hrv-9fm8l10i9z2kqc6",
31 properties: {"text" => "123 hello"}}})
32 assert page.has_text? '123 hello'
33 Thread.current[:arvados_api_token] = nil