Fixed tests.

This commit is contained in:
Martin Edenhofer 2016-01-13 23:27:34 +01:00
parent 5b1a481cf1
commit c6ee93d2d5
3 changed files with 20 additions and 12 deletions

View file

@ -102,10 +102,6 @@ class String
# remove style tags with content # remove style tags with content
string.gsub!( %r{<style(|\s.+?)>(.+?)</style>}im, '') string.gsub!( %r{<style(|\s.+?)>(.+?)</style>}im, '')
# insert spaces on [A-z]\n[A-z]
string.gsub!( /([A-z])\n([A-z])/m, '\1 \2' )
# remove empty lines # remove empty lines
string.gsub!( /^\s*/m, '' ) string.gsub!( /^\s*/m, '' )
@ -117,6 +113,9 @@ class String
placeholder = placeholder.gsub(/\n/, '###BR###') placeholder = placeholder.gsub(/\n/, '###BR###')
} }
# insert spaces on [A-z]\n[A-z]
string.gsub!( /([A-z])\n([A-z])/m, '\1 \2' )
# remove all new lines # remove all new lines
string.gsub!(/(\n\r|\r\r\n|\r\n|\n)/, '') string.gsub!(/(\n\r|\r\r\n|\r\n|\n)/, '')

View file

@ -186,6 +186,7 @@ class ChatTest < TestCase
browser: agent, browser: agent,
css: 'a[href="#customer_chat"]', 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-close' } ).each(&:click)
customer = browser_instance customer = browser_instance
@ -273,7 +274,7 @@ class ChatTest < TestCase
watch_for( watch_for(
browser: agent, browser: agent,
css: '.active .chat-window', css: '.active .chat-window',
value: 'has closed the conversation', value: 'closed the conversation',
) )
end end
@ -292,6 +293,7 @@ class ChatTest < TestCase
browser: agent, browser: agent,
css: 'a[href="#customer_chat"]', 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-close' } ).each(&:click)
customer = browser_instance customer = browser_instance
@ -373,6 +375,10 @@ class ChatTest < TestCase
css: '.zammad-chat', css: '.zammad-chat',
value: 'my name is me', value: 'my name is me',
) )
click(
browser: agent,
css: '.active .chat-window .js-disconnect',
)
click( click(
browser: agent, browser: agent,
css: '.active .chat-window .js-close', css: '.active .chat-window .js-close',
@ -395,6 +401,7 @@ class ChatTest < TestCase
browser: customer, browser: customer,
css: '.zammad-chat-is-open', 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-close' } ).each(&:click)
sleep 2 sleep 2
click( click(
@ -440,6 +447,7 @@ class ChatTest < TestCase
browser: agent, browser: agent,
css: 'a[href="#customer_chat"]', 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-close' } ).each(&:click)
# set chat preferences # set chat preferences
@ -555,7 +563,7 @@ class ChatTest < TestCase
watch_for( watch_for(
browser: agent, browser: agent,
css: '.active .chat-window', css: '.active .chat-window',
value: 'has closed the conversation', value: 'closed the conversation',
) )
end end
@ -574,6 +582,7 @@ class ChatTest < TestCase
browser: agent, browser: agent,
css: 'a[href="#customer_chat"]', 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-close' } ).each(&:click)
exists( exists(

View file

@ -606,7 +606,7 @@ Registration AG Ulm HRB 534075 * General Manager Holger Felgner
}, },
{ {
data: IO.read('test/fixtures/mail30.box'), data: IO.read('test/fixtures/mail30.box'),
body_md5: '23220f9537e59a8febc62705aa1c387c', body_md5: 'b4038e70d25854a023bce604c9f7a7ff',
params: { params: {
from: 'Manfred Haert <Manfred.Haert@example.com>', from: 'Manfred Haert <Manfred.Haert@example.com>',
from_email: 'Manfred.Haert@example.com', from_email: 'Manfred.Haert@example.com',