Improved error handling.

This commit is contained in:
Martin Edenhofer 2014-12-02 14:07:35 +01:00
parent ec1b1522a0
commit 403913f404
2 changed files with 12 additions and 12 deletions

View file

@ -21,7 +21,6 @@ class App.UserOrganizationAutocompletion extends App.Controller
@el @el
open: => open: =>
@emptyResultList()
@el.addClass('open') @el.addClass('open')
@catcher = new App.clickCatcher @catcher = new App.clickCatcher
holder: @el.offsetParent() holder: @el.offsetParent()
@ -29,7 +28,6 @@ class App.UserOrganizationAutocompletion extends App.Controller
zIndexScale: 1 zIndexScale: 1
close: => close: =>
@emptyResultList()
@el.removeClass('open') @el.removeClass('open')
if @catcher if @catcher
@catcher.remove() @catcher.remove()

View file

@ -260,14 +260,18 @@ class TestCase < Test::Unit::TestCase
loops = (timeout / 0.5).to_i loops = (timeout / 0.5).to_i
text = '' text = ''
(1..loops).each { |loop| (1..loops).each { |loop|
element = instance.find_element( { :css => action[:area] } ) begin
if element.displayed? element = instance.find_element( { :css => action[:area] } )
text = element.text if element && element.displayed?
if text =~ /#{action[:value]}/i text = element.text
assert( true, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" ) if text =~ /#{action[:value]}/i
sleep 0.4 assert( true, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" )
return sleep 0.4
return
end
end end
rescue => e
puts e.message
end end
sleep 0.5 sleep 0.5
} }
@ -376,10 +380,8 @@ class TestCase < Test::Unit::TestCase
element.clear element.clear
element.send_keys( 'nico*' ) element.send_keys( 'nico*' )
sleep 4 sleep 4
element = instance.find_element( { :css => '.active .newTicket input[name="customer_id_completion"]' } )
element.send_keys( :arrow_down ) element.send_keys( :arrow_down )
sleep 0.3 sleep 0.1
element = instance.find_element( { :css => '.active .newTicket input[name="customer_id_completion"]' } )
element.send_keys( :enter ) element.send_keys( :enter )
sleep 0.3 sleep 0.3
end end