Added helper to remove click catcher.
This commit is contained in:
parent
db231a8f07
commit
01e1943591
2 changed files with 19 additions and 7 deletions
|
@ -265,6 +265,7 @@ class AgentTicketActionLevel5Test < TestCase
|
||||||
)
|
)
|
||||||
|
|
||||||
# execute reply
|
# execute reply
|
||||||
|
click_catcher_remove
|
||||||
sleep 5 # time to recognice form changes
|
sleep 5 # time to recognice form changes
|
||||||
click(
|
click(
|
||||||
css: '.active [data-type="reply"]',
|
css: '.active [data-type="reply"]',
|
||||||
|
|
|
@ -784,9 +784,9 @@ class TestCase < Test::Unit::TestCase
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
file_upload(
|
file_upload(
|
||||||
:browser => browser1,
|
:browser => browser1,
|
||||||
:css => '#content .text-1',
|
:css => '#content .text-1',
|
||||||
:value => 'some text',
|
:value => 'some text',
|
||||||
)
|
)
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
@ -807,6 +807,20 @@ class TestCase < Test::Unit::TestCase
|
||||||
|
|
||||||
end
|
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
|
=begin
|
||||||
|
|
||||||
watch_for(
|
watch_for(
|
||||||
|
@ -1276,7 +1290,6 @@ wait untill text in selector disabppears
|
||||||
|
|
||||||
# it's not working stable via selenium, use js
|
# it's not working stable via selenium, use js
|
||||||
value = instance.find_elements( { css: '.content.active div[data-name=body]' } )[0].text
|
value = instance.find_elements( { css: '.content.active div[data-name=body]' } )[0].text
|
||||||
puts "V #{value.inspect}"
|
|
||||||
if value != data[:body]
|
if value != data[:body]
|
||||||
body_quoted = quote( data[:body] )
|
body_quoted = quote( data[:body] )
|
||||||
instance.execute_script( "$('.content.active div[data-name=body]').html('#{body_quoted}').trigger('focusout')" )
|
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
|
# click on click catcher
|
||||||
if params[:do_not_submit]
|
if params[:do_not_submit]
|
||||||
if instance.find_elements( { css: '.clickCatcher' } )[0]
|
click_catcher_remove
|
||||||
click( browser: instance, css: '.clickCatcher')
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue