Improved error handling.
This commit is contained in:
parent
ec1b1522a0
commit
403913f404
2 changed files with 12 additions and 12 deletions
|
@ -21,7 +21,6 @@ class App.UserOrganizationAutocompletion extends App.Controller
|
|||
@el
|
||||
|
||||
open: =>
|
||||
@emptyResultList()
|
||||
@el.addClass('open')
|
||||
@catcher = new App.clickCatcher
|
||||
holder: @el.offsetParent()
|
||||
|
@ -29,7 +28,6 @@ class App.UserOrganizationAutocompletion extends App.Controller
|
|||
zIndexScale: 1
|
||||
|
||||
close: =>
|
||||
@emptyResultList()
|
||||
@el.removeClass('open')
|
||||
if @catcher
|
||||
@catcher.remove()
|
||||
|
|
|
@ -260,14 +260,18 @@ class TestCase < Test::Unit::TestCase
|
|||
loops = (timeout / 0.5).to_i
|
||||
text = ''
|
||||
(1..loops).each { |loop|
|
||||
element = instance.find_element( { :css => action[:area] } )
|
||||
if element.displayed?
|
||||
text = element.text
|
||||
if text =~ /#{action[:value]}/i
|
||||
assert( true, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" )
|
||||
sleep 0.4
|
||||
return
|
||||
begin
|
||||
element = instance.find_element( { :css => action[:area] } )
|
||||
if element && element.displayed?
|
||||
text = element.text
|
||||
if text =~ /#{action[:value]}/i
|
||||
assert( true, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" )
|
||||
sleep 0.4
|
||||
return
|
||||
end
|
||||
end
|
||||
rescue => e
|
||||
puts e.message
|
||||
end
|
||||
sleep 0.5
|
||||
}
|
||||
|
@ -376,10 +380,8 @@ class TestCase < Test::Unit::TestCase
|
|||
element.clear
|
||||
element.send_keys( 'nico*' )
|
||||
sleep 4
|
||||
element = instance.find_element( { :css => '.active .newTicket input[name="customer_id_completion"]' } )
|
||||
element.send_keys( :arrow_down )
|
||||
sleep 0.3
|
||||
element = instance.find_element( { :css => '.active .newTicket input[name="customer_id_completion"]' } )
|
||||
sleep 0.1
|
||||
element.send_keys( :enter )
|
||||
sleep 0.3
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue