Improved test output.

This commit is contained in:
Martin Edenhofer 2013-06-24 10:09:59 +02:00
parent daaf5ab3cb
commit b6ddca0f88

View file

@ -188,20 +188,20 @@ class TestCase < Test::Unit::TestCase
elsif action[:element] == :title elsif action[:element] == :title
title = instance.title title = instance.title
if title =~ /#{action[:value]}/i if title =~ /#{action[:value]}/i
assert( true, "(#{test[:name]}) matching '#{action[:value]}' in title" ) assert( true, "(#{test[:name]}) matching '#{action[:value]}' in title '#{title}'" )
else else
assert( false, "(#{test[:name]}) not matching '#{action[:value]}' in title" ) assert( false, "(#{test[:name]}) not matching '#{action[:value]}' in title '#{title}'" )
end end
return return
elsif action[:element] == :cookie elsif action[:element] == :cookie
cookies = instance.manage.all_cookies cookies = instance.manage.all_cookies
cookies.each {|cookie| cookies.each {|cookie|
if cookie.to_s =~ /#{action[:value]}/i if cookie.to_s =~ /#{action[:value]}/i
assert( true, "(#{test[:name]}) matching '#{action[:value]}' in cookie" ) assert( true, "(#{test[:name]}) matching '#{action[:value]}' in cookie '#{cookie.to_s}'" )
return return
end end
} }
assert( false, "(#{test[:name]}) not matching '#{action[:value]}' in cookie" ) assert( false, "(#{test[:name]}) not matching '#{action[:value]}' in cookie '#{cookie.to_s}'" )
return return
elsif action[:element] == :alert elsif action[:element] == :alert
element = instance.switch_to.alert element = instance.switch_to.alert