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

View file

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