Improved click().
This commit is contained in:
parent
d34d293f8f
commit
7aa4d16236
1 changed files with 11 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue