Improved error handling.
This commit is contained in:
parent
20523a7bd8
commit
a5bbd8891b
2 changed files with 17 additions and 14 deletions
|
@ -84,7 +84,6 @@ 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,
|
||||||
|
@ -92,7 +91,6 @@ class AgentTicketActionLevel0Test < TestCase
|
||||||
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,8 +191,9 @@ class AgentTicketActionLevel0Test < TestCase
|
||||||
ticket_create(
|
ticket_create(
|
||||||
:browser => browser2,
|
:browser => browser2,
|
||||||
:data => {
|
:data => {
|
||||||
|
:customer => 'nico',
|
||||||
:group => 'Users',
|
:group => 'Users',
|
||||||
:subject => 'some subject 123äöü',
|
:title => 'some subject 123äöü',
|
||||||
:body => 'some body 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,
|
||||||
|
|
|
@ -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,10 +850,14 @@ 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|
|
||||||
|
begin
|
||||||
text = instance.find_elements( { :css => '.content.active .js-reset' } )[0].text
|
text = instance.find_elements( { :css => '.content.active .js-reset' } )[0].text
|
||||||
if !text || text.empty?
|
if !text || text.empty?
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
rescue
|
||||||
|
# just try again
|
||||||
|
end
|
||||||
sleep 1
|
sleep 1
|
||||||
}
|
}
|
||||||
raise "unable to update ticket"
|
raise "unable to update ticket"
|
||||||
|
|
Loading…
Reference in a new issue