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,8 +260,9 @@ 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|
begin
element = instance.find_element( { :css => action[:area] } ) element = instance.find_element( { :css => action[:area] } )
if element.displayed? if element && element.displayed?
text = element.text text = element.text
if text =~ /#{action[:value]}/i if text =~ /#{action[:value]}/i
assert( true, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" ) assert( true, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" )
@ -269,6 +270,9 @@ class TestCase < Test::Unit::TestCase
return return
end end
end end
rescue => e
puts e.message
end
sleep 0.5 sleep 0.5
} }
assert( false, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" ) assert( false, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" )
@ -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