diff --git a/test/browser/chat_test.rb b/test/browser/chat_test.rb index 7238a3271..7350986ce 100644 --- a/test/browser/chat_test.rb +++ b/test/browser/chat_test.rb @@ -186,8 +186,8 @@ class ChatTest < TestCase browser: agent, css: 'a[href="#customer_chat"]', ) - agent.find_elements( { css: '.active .chat-window .js-disconnect' } ).each(&:click) - agent.find_elements( { css: '.active .chat-window .js-close' } ).each(&:click) + agent.find_elements(css: '.active .chat-window .js-disconnect:not(.is-hidden)').each(&:click) + agent.find_elements(css: '.active .chat-window .js-close').each(&:click) customer = browser_instance location( @@ -299,8 +299,8 @@ class ChatTest < TestCase browser: agent, css: 'a[href="#customer_chat"]', ) - agent.find_elements( { css: '.active .chat-window .js-disconnect' } ).each(&:click) - agent.find_elements( { css: '.active .chat-window .js-close' } ).each(&:click) + agent.find_elements(css: '.active .chat-window .js-disconnect:not(.is-hidden)').each(&:click) + agent.find_elements(css: '.active .chat-window .js-close').each(&:click) customer = browser_instance location( @@ -383,7 +383,7 @@ class ChatTest < TestCase ) click( browser: agent, - css: '.active .chat-window .js-disconnect', + css: '.active .chat-window .js-disconnect:not(.is-hidden)', ) click( browser: agent, @@ -407,8 +407,8 @@ class ChatTest < TestCase browser: customer, css: '.zammad-chat-is-open', ) - agent.find_elements( { css: '.active .chat-window .js-disconnect' } ).each(&:click) - agent.find_elements( { css: '.active .chat-window .js-close' } ).each(&:click) + agent.find_elements(css: '.active .chat-window .js-disconnect:not(.is-hidden)').each(&:click) + agent.find_elements(css: '.active .chat-window .js-close').each(&:click) sleep 2 click( browser: customer, @@ -454,8 +454,8 @@ class ChatTest < TestCase browser: agent, css: 'a[href="#customer_chat"]', ) - agent.find_elements( { css: '.active .chat-window .js-disconnect' } ).each(&:click) - agent.find_elements( { css: '.active .chat-window .js-close' } ).each(&:click) + agent.find_elements(css: '.active .chat-window .js-disconnect:not(.is-hidden)').each(&:click) + agent.find_elements(css: '.active .chat-window .js-close').each(&:click) # set chat preferences click( @@ -606,8 +606,8 @@ class ChatTest < TestCase browser: agent, css: 'a[href="#customer_chat"]', ) - agent.find_elements( { css: '.active .chat-window .js-disconnect' } ).each(&:click) - agent.find_elements( { css: '.active .chat-window .js-close' } ).each(&:click) + agent.find_elements(css: '.active .chat-window .js-disconnect:not(.is-hidden)').each(&:click) + agent.find_elements(css: '.active .chat-window .js-close').each(&:click) exists( browser: agent,