diff --git a/monitor/spec/production_spec.rb b/monitor/spec/production_spec.rb index 37e7e0796..d3b97bc94 100755 --- a/monitor/spec/production_spec.rb +++ b/monitor/spec/production_spec.rb @@ -48,9 +48,10 @@ describe "Deployed site at #{www}", :js => true, :type => :feature, :capybara_fe end it "is possible for #{user1} to sign in and not get disconnected within 30 seconds" do + as_monitor(user1) do + puts "[monitor] Waiting a bit for other connections to close..."; sleep 10 # www and the fakeJamClient really don't like going fast here sign_in_poltergeist(user1) - puts "Waiting for 15 whole seconds before checking websocket connection"; sleep 15 # www and the fakeJamClient really don't like going fast here repeat_for(30.seconds) do expect(page).to_not have_selector('.no-websocket-connection') #looks for reconnect dialog every 1 second end @@ -89,11 +90,11 @@ describe "Deployed site at #{www}", :js => true, :type => :feature, :capybara_fe find('h1', text: 'conversation with ' + user2.name) find('.previous-message-text', text: test_message) find('#text-message-dialog .btn-close-dialog', text: 'CLOSE').trigger(:click) - sign_out_poltergeist + sign_out_poltergeist(validate: true) end as_monitor(user2) do - sign_out_poltergeist + sign_out_poltergeist(validate: true) end end diff --git a/monitor/spec/support/utilities.rb b/monitor/spec/support/utilities.rb index 41c1ef613..be0e32722 100755 --- a/monitor/spec/support/utilities.rb +++ b/monitor/spec/support/utilities.rb @@ -53,7 +53,7 @@ def as_monitor(name) session_name = name.class == JamRuby::User ? name.id : name Capybara.session_name = mapped_session_name(session_name) page.driver.headers = { 'User-Agent' => 'monitor' } - puts "\n *** #{name}'s client *** \n" + puts "\n[monitor] #{name}'s client *** \n" yield end