2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2015-01-23 22:24:03 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
2016-09-05 13:18:22 +00:00
|
|
|
class AgentTicketEmailSignatureTest < TestCase
|
2015-01-23 22:24:03 +00:00
|
|
|
def test_agent_signature_check
|
2015-03-01 23:16:36 +00:00
|
|
|
|
2021-09-20 10:47:05 +00:00
|
|
|
suffix = SecureRandom.uuid
|
2020-09-30 09:07:01 +00:00
|
|
|
signature_name1 = "sig name 1 äöüß #{suffix}"
|
|
|
|
signature_body1 = "--\nsig body 1 äöüß #{suffix}"
|
|
|
|
signature_name2 = "sig name 2 äöüß #{suffix}"
|
|
|
|
signature_body2 = "--\nsig body 2 äöüß #{suffix}"
|
|
|
|
group_name1 = "group name 1 #{suffix}"
|
|
|
|
group_name2 = "group name 2 #{suffix}"
|
|
|
|
group_name3 = "group name 3 #{suffix}"
|
2015-01-23 22:24:03 +00:00
|
|
|
|
2015-03-01 23:16:36 +00:00
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
2021-08-17 12:10:02 +00:00
|
|
|
username: 'admin@example.com',
|
2015-04-27 13:42:53 +00:00
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2015-03-01 23:16:36 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# create groups and signatures
|
|
|
|
#
|
|
|
|
|
|
|
|
# create signatures
|
|
|
|
signature_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
|
|
|
name: signature_name1,
|
|
|
|
body: signature_body1,
|
2015-01-23 22:24:03 +00:00
|
|
|
},
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
signature_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
|
|
|
name: signature_name2,
|
|
|
|
body: signature_body2,
|
2015-01-23 22:24:03 +00:00
|
|
|
},
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# create groups
|
|
|
|
group_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
2018-12-19 17:31:51 +00:00
|
|
|
name: group_name1,
|
2015-04-27 13:42:53 +00:00
|
|
|
signature: signature_name1,
|
2018-12-19 17:31:51 +00:00
|
|
|
member: [
|
2017-06-16 20:43:09 +00:00
|
|
|
{
|
2021-08-17 12:10:02 +00:00
|
|
|
login: 'admin@example.com',
|
2017-06-16 20:43:09 +00:00
|
|
|
access: 'full',
|
|
|
|
},
|
2015-01-23 22:24:03 +00:00
|
|
|
],
|
2015-03-01 23:16:36 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
group_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
2018-12-19 17:31:51 +00:00
|
|
|
name: group_name2,
|
2015-04-27 13:42:53 +00:00
|
|
|
signature: signature_name2,
|
2018-12-19 17:31:51 +00:00
|
|
|
member: [
|
2017-06-16 20:43:09 +00:00
|
|
|
{
|
2021-08-17 12:10:02 +00:00
|
|
|
login: 'admin@example.com',
|
2017-06-16 20:43:09 +00:00
|
|
|
access: 'full',
|
|
|
|
},
|
2015-03-01 23:16:36 +00:00
|
|
|
],
|
|
|
|
}
|
|
|
|
)
|
|
|
|
group_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
2018-12-19 17:31:51 +00:00
|
|
|
name: group_name3,
|
2015-04-27 13:42:53 +00:00
|
|
|
member: [
|
2017-06-16 20:43:09 +00:00
|
|
|
{
|
2021-08-17 12:10:02 +00:00
|
|
|
login: 'admin@example.com',
|
2017-06-16 20:43:09 +00:00
|
|
|
access: 'full',
|
|
|
|
},
|
2015-03-01 23:16:36 +00:00
|
|
|
],
|
|
|
|
}
|
|
|
|
)
|
2020-03-19 08:17:49 +00:00
|
|
|
sleep 10 # wait until background job is processed
|
2015-03-01 23:16:36 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# check signature in new ticket
|
|
|
|
#
|
|
|
|
|
|
|
|
# reload instances to get new group permissions
|
2021-07-16 13:29:38 +00:00
|
|
|
reload
|
2015-03-01 23:16:36 +00:00
|
|
|
|
|
|
|
# create ticket
|
|
|
|
ticket_create(
|
2018-12-19 17:31:51 +00:00
|
|
|
data: {
|
2015-04-27 13:42:53 +00:00
|
|
|
customer: 'nicole',
|
2018-12-19 17:31:51 +00:00
|
|
|
group: 'Users',
|
|
|
|
title: 'some subject 5 - 123äöü',
|
|
|
|
body: 'some body 5 - 123äöü',
|
2015-01-23 22:24:03 +00:00
|
|
|
},
|
2015-04-27 13:42:53 +00:00
|
|
|
do_not_submit: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# select group
|
|
|
|
select(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [name="group_id"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: group_name1,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check content
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some body 5',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check signature
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body1,
|
2015-04-27 13:42:53 +00:00
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body2,
|
2015-04-27 13:42:53 +00:00
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# select create channel
|
|
|
|
click(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-type="email-out"]',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# group 1 is still selected
|
|
|
|
|
|
|
|
# check content
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some body 5',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check signature
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body1,
|
2015-04-27 13:42:53 +00:00
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body2,
|
2015-04-27 13:42:53 +00:00
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# select group
|
|
|
|
select(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [name="group_id"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: group_name2,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check content
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some body 5',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check signature
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body1,
|
2015-04-27 13:42:53 +00:00
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body2,
|
2015-04-27 13:42:53 +00:00
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# select group
|
|
|
|
select(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [name="group_id"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: group_name3,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check content
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some body 5',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check signature
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body1,
|
2015-04-27 13:42:53 +00:00
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body2,
|
2015-04-27 13:42:53 +00:00
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# select group
|
|
|
|
select(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [name="group_id"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: group_name1,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check content
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some body 5',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check signature
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body1,
|
2015-04-27 13:42:53 +00:00
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body2,
|
2015-04-27 13:42:53 +00:00
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# select create channel
|
|
|
|
click(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-type="phone-out"]',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check content
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some body 5',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check signature
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body1,
|
2015-04-27 13:42:53 +00:00
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body2,
|
2015-04-27 13:42:53 +00:00
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
#
|
|
|
|
# check signature in zoom ticket
|
|
|
|
#
|
|
|
|
ticket_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
|
|
|
customer: 'nicole',
|
2018-12-19 17:31:51 +00:00
|
|
|
group: group_name1,
|
|
|
|
title: 'some subject 5/2 - 123äöü',
|
|
|
|
body: 'some body 5/2 - 123äöü',
|
2015-03-01 23:16:36 +00:00
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
# execute reply
|
|
|
|
click(
|
2015-12-14 16:09:09 +00:00
|
|
|
css: '.active [data-type="emailReply"]',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check if signature exists
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body1,
|
2015-04-27 13:42:53 +00:00
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body2,
|
2015-04-27 13:42:53 +00:00
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# update group2
|
|
|
|
select(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [name="group_id"]',
|
2015-11-16 16:14:33 +00:00
|
|
|
value: group_name2,
|
|
|
|
)
|
|
|
|
|
|
|
|
# execute reply
|
|
|
|
sleep 5 # time to recognice form changes
|
2016-05-05 11:38:33 +00:00
|
|
|
scroll_to(
|
|
|
|
position: 'botton',
|
|
|
|
css: '.active [data-type="emailReply"]',
|
|
|
|
)
|
2015-11-16 16:14:33 +00:00
|
|
|
click(
|
2015-12-14 16:09:09 +00:00
|
|
|
css: '.active [data-type="emailReply"]',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check if signature exists
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body1,
|
2015-11-16 16:14:33 +00:00
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body2,
|
2015-11-16 16:14:33 +00:00
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# discard changes
|
2015-06-06 07:22:14 +00:00
|
|
|
sleep 2
|
2015-03-01 23:16:36 +00:00
|
|
|
click(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active .js-reset',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
sleep 3
|
|
|
|
|
|
|
|
# check if signature exists
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body1,
|
2015-04-27 13:42:53 +00:00
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body2,
|
2015-04-27 13:42:53 +00:00
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
2015-01-23 22:24:03 +00:00
|
|
|
end
|
2015-04-27 14:15:29 +00:00
|
|
|
end
|