2015-01-23 22:24:03 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class AgentTicketActionLevel5Test < TestCase
|
|
|
|
def test_agent_signature_check
|
2015-03-01 23:16:36 +00:00
|
|
|
|
2015-04-27 13:43:34 +00:00
|
|
|
suffix = rand(99_999_999_999_999_999).to_s
|
2015-01-23 22:24:03 +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
|
2015-04-27 12:51:43 +00:00
|
|
|
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(
|
2015-04-27 13:42:53 +00:00
|
|
|
username: 'master@example.com',
|
|
|
|
password: 'test',
|
|
|
|
url: browser_url,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
#
|
|
|
|
# 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: {
|
|
|
|
name: group_name1,
|
|
|
|
signature: signature_name1,
|
|
|
|
member: [
|
2015-03-01 23:16:36 +00:00
|
|
|
'master@example.com'
|
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: {
|
|
|
|
name: group_name2,
|
|
|
|
signature: signature_name2,
|
|
|
|
member: [
|
2015-03-01 23:16:36 +00:00
|
|
|
'master@example.com'
|
|
|
|
],
|
|
|
|
}
|
|
|
|
)
|
|
|
|
group_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
|
|
|
name: group_name3,
|
|
|
|
member: [
|
2015-03-01 23:16:36 +00:00
|
|
|
'master@example.com'
|
|
|
|
],
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
#
|
|
|
|
# check signature in new ticket
|
|
|
|
#
|
|
|
|
|
|
|
|
# reload instances to get new group permissions
|
|
|
|
reload()
|
|
|
|
|
|
|
|
# create ticket
|
|
|
|
ticket_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
|
|
|
customer: 'nicole',
|
|
|
|
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(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [name="group_id"]',
|
|
|
|
value: group_name1,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check content
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: 'some body 5',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check signature
|
|
|
|
match_not(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body1,
|
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
match_not(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body2,
|
|
|
|
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(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: 'some body 5',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check signature
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body1,
|
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
match_not(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body2,
|
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# select group
|
|
|
|
select(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [name="group_id"]',
|
|
|
|
value: group_name2,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check content
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: 'some body 5',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check signature
|
|
|
|
match_not(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body1,
|
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body2,
|
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# select group
|
|
|
|
select(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [name="group_id"]',
|
|
|
|
value: group_name3,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check content
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: 'some body 5',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check signature
|
|
|
|
match_not(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body1,
|
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
match_not(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body2,
|
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# select group
|
|
|
|
select(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [name="group_id"]',
|
|
|
|
value: group_name1,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check content
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: 'some body 5',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check signature
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body1,
|
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
match_not(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body2,
|
|
|
|
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(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: 'some body 5',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check signature
|
|
|
|
match_not(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body1,
|
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
match_not(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body2,
|
|
|
|
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',
|
|
|
|
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(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body1,
|
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
match_not(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body2,
|
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# update group2
|
|
|
|
select(
|
2015-11-16 16:14:33 +00:00
|
|
|
css: '.active [name="group_id"]',
|
|
|
|
value: group_name2,
|
|
|
|
)
|
|
|
|
|
|
|
|
# execute reply
|
|
|
|
sleep 5 # time to recognice form changes
|
|
|
|
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(
|
2015-11-16 16:14:33 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body1,
|
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
match(
|
2015-11-16 16:14:33 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body2,
|
|
|
|
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(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body1,
|
|
|
|
no_quote: true,
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
match_not(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: signature_body2,
|
|
|
|
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
|