Added helper to remove click catcher.

This commit is contained in:
Martin Edenhofer 2015-11-16 21:54:07 +01:00
parent db231a8f07
commit 01e1943591
2 changed files with 19 additions and 7 deletions

View file

@ -265,6 +265,7 @@ class AgentTicketActionLevel5Test < TestCase
)
# execute reply
click_catcher_remove
sleep 5 # time to recognice form changes
click(
css: '.active [data-type="reply"]',

View file

@ -784,9 +784,9 @@ class TestCase < Test::Unit::TestCase
=begin
file_upload(
:browser => browser1,
:css => '#content .text-1',
:value => 'some text',
:browser => browser1,
:css => '#content .text-1',
:value => 'some text',
)
=end
@ -807,6 +807,20 @@ class TestCase < Test::Unit::TestCase
end
=begin
click_catcher_remove(
:browser => browser1,
)
=end
def click_catcher_remove(params = {})
instance = params[:browser] || @browser
return if !instance.find_elements( { css: '.clickCatcher' } )[0]
click( browser: instance, css: '.clickCatcher')
end
=begin
watch_for(
@ -1276,7 +1290,6 @@ wait untill text in selector disabppears
# it's not working stable via selenium, use js
value = instance.find_elements( { css: '.content.active div[data-name=body]' } )[0].text
puts "V #{value.inspect}"
if value != data[:body]
body_quoted = quote( data[:body] )
instance.execute_script( "$('.content.active div[data-name=body]').html('#{body_quoted}').trigger('focusout')" )
@ -1284,9 +1297,7 @@ wait untill text in selector disabppears
# click on click catcher
if params[:do_not_submit]
if instance.find_elements( { css: '.clickCatcher' } )[0]
click( browser: instance, css: '.clickCatcher')
end
click_catcher_remove
end
end