2015-10-08 10:26:35 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
2016-09-05 13:18:22 +00:00
|
|
|
class AgentTicketEmailReplyKeepBodyTest < TestCase
|
2015-10-08 10:26:35 +00:00
|
|
|
def test_reply_message_keep_body
|
|
|
|
|
|
|
|
# merge ticket with closed tab
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
|
|
|
username: 'agent1@example.com',
|
|
|
|
password: 'test',
|
|
|
|
url: browser_url,
|
|
|
|
)
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
# create new ticket
|
|
|
|
ticket1 = ticket_create(
|
|
|
|
data: {
|
|
|
|
customer: 'nico',
|
|
|
|
group: 'Users',
|
|
|
|
title: 'some subject 123äöü - reply test',
|
|
|
|
body: 'some body 123äöü - reply test',
|
|
|
|
},
|
|
|
|
)
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
# fill body
|
|
|
|
ticket_update(
|
|
|
|
data: {
|
|
|
|
body: 'keep me',
|
|
|
|
},
|
|
|
|
do_not_submit: true,
|
|
|
|
)
|
|
|
|
|
2015-11-17 18:57:15 +00:00
|
|
|
# scroll to reply - needed for chrome
|
|
|
|
scroll_to(
|
|
|
|
position: 'botton',
|
2015-12-14 16:09:09 +00:00
|
|
|
css: '.content.active [data-type="emailReply"]',
|
2015-11-17 18:57:15 +00:00
|
|
|
)
|
|
|
|
|
2015-10-08 10:26:35 +00:00
|
|
|
# click reply
|
2016-03-22 23:12:50 +00:00
|
|
|
click(css: '.content.active [data-type="emailReply"]')
|
2015-10-08 10:26:35 +00:00
|
|
|
|
|
|
|
# check body
|
|
|
|
watch_for(
|
|
|
|
css: '.content.active .js-reset',
|
|
|
|
value: '(Discard your unsaved changes.|Verwerfen der)',
|
|
|
|
no_quote: true,
|
|
|
|
)
|
|
|
|
|
|
|
|
# check body
|
|
|
|
ticket_verify(
|
|
|
|
data: {
|
|
|
|
body: 'keep me',
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2015-11-17 18:57:15 +00:00
|
|
|
# scroll to reply - needed for chrome
|
2016-03-23 05:55:34 +00:00
|
|
|
sleep 5
|
2015-11-17 18:57:15 +00:00
|
|
|
scroll_to(
|
|
|
|
position: 'botton',
|
2015-12-14 16:09:09 +00:00
|
|
|
css: '.content.active [data-type="emailReply"]',
|
2015-11-17 18:57:15 +00:00
|
|
|
)
|
2015-10-08 10:26:35 +00:00
|
|
|
# click reply
|
2016-03-22 23:12:50 +00:00
|
|
|
click(css: '.content.active [data-type="emailReply"]')
|
2015-10-08 10:26:35 +00:00
|
|
|
|
|
|
|
# check body
|
|
|
|
watch_for(
|
|
|
|
css: '.content.active .js-reset',
|
|
|
|
value: '(Discard your unsaved changes.|Verwerfen der)',
|
|
|
|
no_quote: true,
|
|
|
|
)
|
|
|
|
|
2016-03-22 23:12:50 +00:00
|
|
|
# check body
|
|
|
|
ticket_verify(
|
|
|
|
data: {
|
|
|
|
body: 'keep me',
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2015-10-08 10:26:35 +00:00
|
|
|
end
|
2018-08-22 07:55:39 +00:00
|
|
|
|
|
|
|
def test_full_quote
|
|
|
|
@browser = instance = browser_instance
|
|
|
|
login(
|
|
|
|
username: 'master@example.com',
|
|
|
|
password: 'test',
|
|
|
|
url: browser_url,
|
|
|
|
)
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
ticket_open_by_title(
|
|
|
|
title: 'Welcome to Zammad',
|
|
|
|
)
|
|
|
|
watch_for(
|
|
|
|
css: '.content.active .js-settingContainer .js-setting .dropdown-icon',
|
|
|
|
)
|
|
|
|
|
|
|
|
# enable email full quote in the ticket zoom config page
|
|
|
|
scroll_to(
|
|
|
|
position: 'botton',
|
|
|
|
css: '.content.active .js-settingContainer .js-setting .dropdown-icon',
|
|
|
|
)
|
|
|
|
click(css: '.content.active .js-settingContainer .js-setting .dropdown-icon')
|
|
|
|
modal_ready()
|
|
|
|
select(
|
|
|
|
css: '.modal #ui_ticket_zoom_article_email_full_quote select[name="ui_ticket_zoom_article_email_full_quote"]',
|
|
|
|
value: 'yes'
|
|
|
|
)
|
|
|
|
click(
|
|
|
|
css: '.modal #ui_ticket_zoom_article_email_full_quote .btn[type="submit"]',
|
|
|
|
)
|
|
|
|
modal_close()
|
|
|
|
modal_disappear()
|
|
|
|
|
|
|
|
exists(css: '.content.active .ticket-article [data-type="emailReply"]')
|
|
|
|
|
|
|
|
# scroll to reply - needed for chrome
|
|
|
|
scroll_to(
|
|
|
|
position: 'botton',
|
|
|
|
css: '.content.active .ticket-article [data-type="emailReply"]',
|
|
|
|
)
|
|
|
|
|
|
|
|
click(css: '.content.active .ticket-article [data-type="emailReply"]')
|
|
|
|
|
|
|
|
full_text = @browser.find_element(css: '.content.active .article-new .articleNewEdit-body').text
|
|
|
|
|
2018-09-25 13:27:54 +00:00
|
|
|
match = full_text.match(/\nOn (.*?) Nicole Braun wrote:/)
|
2018-08-22 07:55:39 +00:00
|
|
|
assert match
|
|
|
|
assert match[1]
|
|
|
|
assert Time.zone.parse(match[1])
|
|
|
|
end
|
2015-10-08 10:26:35 +00:00
|
|
|
end
|