Browse Source

Improved chat tests.

Martin Edenhofer 8 years ago
parent
commit
1a506cd150

+ 2 - 1
app/assets/javascripts/app/controllers/_application_controller_generic.coffee

@@ -102,7 +102,8 @@ class App.ControllerGenericIndex extends App.Controller
     super
 
     # set title
-    @title @pageData.title, true
+    if @pageData.title
+      @title @pageData.title, true
 
     # set nav bar
     if @pageData.navupdate

+ 1 - 1
app/controllers/users_controller.rb

@@ -85,7 +85,7 @@ class UsersController < ApplicationController
         group_ids = []
         role_ids  = []
         if count <= 2
-          Role.where(name: [ Z_ROLENAME_ADMIN, 'Agent', 'Chat', 'CTI']).each { |role|
+          Role.where(name: [ Z_ROLENAME_ADMIN, 'Agent', 'Chat']).each { |role|
             role_ids.push role.id
           }
           Group.all().each { |group|

+ 3 - 1
app/models/setting.rb

@@ -18,8 +18,10 @@ class Setting < ApplicationModel
   @@lookup_at      = nil # rubocop:disable Style/ClassVars
   @@lookup_timeout = if ENV['ZAMMAD_SETTING_TTL'] # rubocop:disable Style/ClassVars
                        ENV['ZAMMAD_SETTING_TTL'].to_i.seconds
-                     else
+                     elsif Rails.env.production?
                        2.minutes
+                     else
+                       15.seconds
                      end
 
 =begin

+ 5 - 5
test/browser/chat_test.rb

@@ -70,7 +70,7 @@ class ChatTest < TestCase
     sleep 15 # wait for rerendering
     switch(
       browser: agent,
-      css: '#navigation .js-switch',
+      css: '#navigation .js-chatMenuItem .js-switch',
       type: 'off',
     )
     click(
@@ -108,7 +108,7 @@ class ChatTest < TestCase
     )
     switch(
       browser: agent,
-      css: '#navigation .js-switch',
+      css: '#navigation .js-chatMenuItem .js-switch',
       type: 'on',
     )
     reload(
@@ -610,7 +610,7 @@ class ChatTest < TestCase
 
     exists(
       browser: agent,
-      css: '#navigation .js-switch input[checked]'
+      css: '#navigation .js-chatMenuItem .js-switch input[checked]'
     )
 
     # no customer action, hide widget
@@ -658,11 +658,11 @@ class ChatTest < TestCase
     # check if agent is offline, idle timeout, chat not answered
     exists_not(
       browser: agent,
-      css: '#navigation .js-switch input[checked]'
+      css: '#navigation .js-chatMenuItem .js-switch input[checked]'
     )
     switch(
       browser: agent,
-      css: '#navigation .js-switch',
+      css: '#navigation .js-chatMenuItem .js-switch',
       type: 'on',
     )