Improved click().

This commit is contained in:
Martin Edenhofer 2015-04-06 00:39:01 +02:00
parent d34d293f8f
commit 7aa4d16236

View file

@ -202,13 +202,23 @@ class TestCase < Test::Unit::TestCase
:fast => false, # do not wait :fast => false, # do not wait
) )
click(
:browser => browser1,
:text => '.partial_link_text',
:fast => false, # do not wait
)
=end =end
def click(params) def click(params)
log('click', params) log('click', params)
instance = params[:browser] || @browser instance = params[:browser] || @browser
if params[:css]
instance.find_elements( { :css => params[:css] } )[0].click instance.find_elements( { :css => params[:css] } )[0].click
else
instance.find_elements( { :partial_link_text => params[:text] } )[0].click
end
if !params[:fast] if !params[:fast]
sleep 0.4 sleep 0.4
end end