Added tweet reply test.

This commit is contained in:
Martin Edenhofer 2016-01-14 00:33:34 +01:00
parent c6ee93d2d5
commit 922c9cd928
2 changed files with 93 additions and 1 deletions

View file

@ -1645,6 +1645,40 @@ wait untill text in selector disabppears
true true
end end
=begin
ticket_open_by_title(
browser: browser2,
title: ticket1[:title],
)
=end
def ticket_open_by_title(params)
switch_window_focus(params)
log('ticket_open_by_title', params)
instance = params[:browser] || @browser
# search by number
element = instance.find_elements({ css: '#global-search' })[0]
element.click
element.clear
element.send_keys(params[:title])
sleep 3
# open ticket
#instance.find_element({ partial_link_text: params[:title] } ).click
instance.execute_script("$(\"#global-search-result a:contains('#{params[:title]}') .nav-tab-icon\").click()")
title = instance.find_elements({ css: '.active .ticketZoom-header .ticket-title-update' })[0].text
if title !~ /#{params[:title]}/
screenshot(browser: instance, comment: 'ticket_open_by_title_failed')
fail "unable to search/find ticket #{params[:title]}!"
end
sleep 1
true
end
=begin =begin
overview_count = overview_counter( overview_count = overview_counter(

View file

@ -194,16 +194,74 @@ class TwitterBrowserTest < TestCase
config.access_token_secret = twitter_customer_token_secret config.access_token_secret = twitter_customer_token_secret
end end
text = "Today... #{hash}" text = "Today... ##{hash} #{rand(99_999)}"
tweet = client.update( tweet = client.update(
text, text,
) )
# watch till tweet is in app # watch till tweet is in app
click( text: 'Overviews' )
# enable full overviews
execute(
js: '$(".content.active .sidebar").css("display", "block")',
)
click( text: 'Unassigned & Open' )
sleep 6 # till overview is rendered
watch_for(
css: '.content.active',
value: "##{hash}",
)
ticket_open_by_title(
title: "##{hash}",
)
# reply via app # reply via app
click( css: '.content.active [data-type="twitterStatusReply"]' )
ticket_update(
data: {
body: '@dzucker6 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890',
},
do_not_submit: true,
)
click(
css: '.content.active .js-submit',
)
sleep 10
click(
css: '.content.active .js-reset',
)
sleep 2
match_not(
css: '.content.active',
value: '1234567890',
)
click( css: '.content.active [data-type="twitterStatusReply"]' )
sleep 2
ticket_update(
data: {
body: "@dzucker6 reply ##{hash}222 #{rand(99_999)}",
},
)
sleep 20
match(
css: '.content.active .ticket-article',
value: "##{hash}222",
)
# watch till tweet reached customer # watch till tweet reached customer
text = nil
client.search("##{hash}222", result_type: 'mixed').collect { |local_tweet|
text = local_tweet.text
}
assert(text)
end end