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(
:browser => browser2,
:data => {
:customer => '',
:title => 'A',
:title => 'A',
},
:do_not_submit => true,
)
ticket_create(
:browser => browser2,
:data => {
:customer => '',
:title => 'B',
: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,9 +191,10 @@ class AgentTicketActionLevel0Test < TestCase
ticket_create(
:browser => browser2,
:data => {
:group => 'Users',
:subject => 'some subject 123äöü',
:body => 'some body 123äöü',
:customer => 'nico',
:group => 'Users',
: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,9 +850,13 @@ class TestCase < Test::Unit::TestCase
instance.find_elements( { :css => '.content.active button.js-submit' } )[0].click
(1..10).each {|loop|
text = instance.find_elements( { :css => '.content.active .js-reset' } )[0].text
if !text || text.empty?
return true
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
}