Improved error handling.

This commit is contained in:
Martin Edenhofer 2015-02-24 01:11:10 +01:00
parent 20523a7bd8
commit a5bbd8891b
2 changed files with 17 additions and 14 deletions

View file

@ -84,16 +84,14 @@ class AgentTicketActionLevel0Test < TestCase
ticket_create( ticket_create(
:browser => browser2, :browser => browser2,
:data => { :data => {
:customer => '', :title => 'A',
:title => 'A',
}, },
:do_not_submit => true, :do_not_submit => true,
) )
ticket_create( ticket_create(
:browser => browser2, :browser => browser2,
:data => { :data => {
:customer => '', :title => 'B',
:title => 'B',
}, },
:do_not_submit => true, :do_not_submit => true,
) )
@ -143,7 +141,7 @@ class AgentTicketActionLevel0Test < TestCase
watch_for( watch_for(
:browser => browser2, :browser => browser2,
:css => '.active div[data-name=body]', :css => '.active div[data-name=body]',
:value => 'some content' + random, :value => 'some content ' + random,
) )
sleep 2 sleep 2
@ -193,9 +191,10 @@ class AgentTicketActionLevel0Test < TestCase
ticket_create( ticket_create(
:browser => browser2, :browser => browser2,
:data => { :data => {
:group => 'Users', :customer => 'nico',
:subject => 'some subject 123äöü', :group => 'Users',
:body => 'some body 123äöü', :title => 'some subject 123äöü',
:body => 'some body 123äöü',
}, },
) )
@ -266,7 +265,7 @@ class AgentTicketActionLevel0Test < TestCase
:css => '.modal', :css => '.modal',
) )
watch_for( set(
:browser => browser2, :browser => browser2,
:css => '.active div[data-name=body]', :css => '.active div[data-name=body]',
:value => '::' + random, :value => '::' + random,

View file

@ -536,7 +536,7 @@ class TestCase < Test::Unit::TestCase
instance = params[:browser] || @browser instance = params[:browser] || @browser
timeout = 16 timeout = 16
if action[:timeout] if params[:timeout]
timeout = params[:timeout] timeout = params[:timeout]
end end
loops = (timeout).to_i loops = (timeout).to_i
@ -550,7 +550,7 @@ class TestCase < Test::Unit::TestCase
end end
sleep 1 sleep 1
} }
raise "#{test[:css]}) still exsists" raise "#{params[:css]}) still exsists"
end end
=begin =begin
@ -850,9 +850,13 @@ class TestCase < Test::Unit::TestCase
instance.find_elements( { :css => '.content.active button.js-submit' } )[0].click instance.find_elements( { :css => '.content.active button.js-submit' } )[0].click
(1..10).each {|loop| (1..10).each {|loop|
text = instance.find_elements( { :css => '.content.active .js-reset' } )[0].text begin
if !text || text.empty? text = instance.find_elements( { :css => '.content.active .js-reset' } )[0].text
return true if !text || text.empty?
return true
end
rescue
# just try again
end end
sleep 1 sleep 1
} }