Small test improvements.

This commit is contained in:
Martin Edenhofer 2013-08-27 23:26:43 +02:00
parent 04a657b9aa
commit 8b16a5a7b8
2 changed files with 7 additions and 7 deletions

View file

@ -93,16 +93,16 @@ class AaaGettingStartedTest < TestCase
:execute => 'click',
:css => '#form-agent button[type="submit"]',
},
{
:execute => 'check',
:element => :url,
:result => '#getting_started',
},
{
:execute => 'watch_for',
:area => 'body',
:value => 'Invitation sent',
},
{
:execute => 'check',
:element => :url,
:result => '#getting_started',
},
{
:execute => 'match',
:css => 'body',

View file

@ -245,14 +245,14 @@ class TestCase < Test::Unit::TestCase
assert( false, "(#{test[:name]}) no login box found!" )
return
elsif action[:execute] == 'watch_for'
(1..24).each { |loop|
(1..36).each { |loop|
element = instance.find_element( { :css => action[:area] } )
text = element.text
if text =~ /#{action[:value]}/i
assert( true, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" )
return
end
sleep 0.5
sleep 0.33
}
assert( false, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" )
return