Improved error handling.
This commit is contained in:
parent
a18157ba4d
commit
07824ab633
1 changed files with 10 additions and 6 deletions
|
@ -261,18 +261,22 @@ class TestCase < Test::Unit::TestCase
|
||||||
if action[:timeout]
|
if action[:timeout]
|
||||||
timeout = action[:timeout]
|
timeout = action[:timeout]
|
||||||
end
|
end
|
||||||
loops = (timeout / 2).to_i
|
loops = (timeout).to_i
|
||||||
text = ''
|
text = ''
|
||||||
(1..loops).each { |loop|
|
(1..loops).each { |loop|
|
||||||
element = instance.find_elements( { :css => action[:area] } )[0]
|
element = instance.find_elements( { :css => action[:area] } )[0]
|
||||||
if element #&& element.displayed?
|
if element #&& element.displayed?
|
||||||
text = element.text
|
begin
|
||||||
if text =~ /#{action[:value]}/i
|
text = element.text
|
||||||
assert( true, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" )
|
if text =~ /#{action[:value]}/i
|
||||||
return
|
assert( true, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" )
|
||||||
|
return
|
||||||
|
end
|
||||||
|
rescue
|
||||||
|
# just try again
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
sleep 2
|
sleep 1
|
||||||
}
|
}
|
||||||
assert( false, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" )
|
assert( false, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" )
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue