trabajo-afectivo/test/browser/agent_ticket_actions_level5_test.rb

302 lines
6.3 KiB
Ruby
Raw Normal View History

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-01-23 22:24:03 +00:00
suffix = rand(99999999999999999).to_s
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-03-01 23:16:36 +00:00
@browser = browser_instance
login(
:username => 'master@example.com',
:password => 'test',
:url => browser_url,
)
tasks_close_all()
#
# create groups and signatures
#
# create signatures
signature_create(
: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(
: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(
:data => {
:name => group_name1,
:signature => signature_name1,
:member => [
'master@example.com'
2015-01-23 22:24:03 +00:00
],
2015-03-01 23:16:36 +00:00
}
)
group_create(
:data => {
:name => group_name2,
:signature => signature_name2,
:member => [
'master@example.com'
],
}
)
group_create(
:data => {
:name => group_name3,
:member => [
'master@example.com'
],
}
)
#
# check signature in new ticket
#
# reload instances to get new group permissions
reload()
# create ticket
ticket_create(
:data => {
:customer => 'nicole',
:group => 'Users',
:title => 'some subject 5 - 123äöü',
:body => 'some body 5 - 123äöü',
2015-01-23 22:24:03 +00:00
},
2015-03-01 23:16:36 +00:00
:do_not_submit => true,
)
# select group
select(
:css => '.active [name="group_id"]',
:value => group_name1,
)
# check content
match(
:css => '.active [data-name="body"]',
:value => 'some body 5',
)
# check signature
match_not(
:css => '.active [data-name="body"]',
:value => signature_body1,
:no_quote => true,
)
match_not(
:css => '.active [data-name="body"]',
:value => signature_body2,
:no_quote => true,
)
# select create channel
click(
:css => '.active [data-type="email-out"]',
)
# group 1 is still selected
# check content
match(
:css => '.active [data-name="body"]',
:value => 'some body 5',
)
# check signature
match(
:css => '.active [data-name="body"]',
:value => signature_body1,
:no_quote => true,
)
match_not(
:css => '.active [data-name="body"]',
:value => signature_body2,
:no_quote => true,
)
# select group
select(
:css => '.active [name="group_id"]',
:value => group_name2,
)
# check content
match(
:css => '.active [data-name="body"]',
:value => 'some body 5',
)
# check signature
match_not(
:css => '.active [data-name="body"]',
:value => signature_body1,
:no_quote => true,
)
match(
:css => '.active [data-name="body"]',
:value => signature_body2,
:no_quote => true,
)
# select group
select(
:css => '.active [name="group_id"]',
:value => group_name3,
)
# check content
match(
:css => '.active [data-name="body"]',
:value => 'some body 5',
)
# check signature
match_not(
:css => '.active [data-name="body"]',
:value => signature_body1,
:no_quote => true,
)
match_not(
:css => '.active [data-name="body"]',
:value => signature_body2,
:no_quote => true,
)
# select group
select(
:css => '.active [name="group_id"]',
:value => group_name1,
)
# check content
match(
:css => '.active [data-name="body"]',
:value => 'some body 5',
)
# check signature
match(
:css => '.active [data-name="body"]',
:value => signature_body1,
:no_quote => true,
)
match_not(
:css => '.active [data-name="body"]',
:value => signature_body2,
:no_quote => true,
)
# select create channel
click(
:css => '.active [data-type="phone-out"]',
)
# check content
match(
:css => '.active [data-name="body"]',
:value => 'some body 5',
)
# check signature
match_not(
:css => '.active [data-name="body"]',
:value => signature_body1,
:no_quote => true,
)
match_not(
:css => '.active [data-name="body"]',
:value => signature_body2,
:no_quote => true,
)
#
# check signature in zoom ticket
#
ticket_create(
:data => {
:customer => 'nicole',
:group => group_name1,
:title => 'some subject 5/2 - 123äöü',
:body => 'some body 5/2 - 123äöü',
},
)
# execute reply
click(
:css => '.active [data-type="reply"]',
)
# check if signature exists
match(
:css => '.active [data-name="body"]',
:value => signature_body1,
:no_quote => true,
)
match_not(
:css => '.active [data-name="body"]',
:value => signature_body2,
:no_quote => true,
)
=begin
# update group2
select(
:css => '.active [name="group_id"]',
:value => group_name2,
)
# check if signature exists
match_not(
:css => '.active [data-name="body"]',
:value => signature_body1,
:no_quote => true,
)
match(
:css => '.active [data-name="body"]',
:value => signature_body2,
:no_quote => true,
)
=end
# discard changes
click(
:css => '.active .js-reset',
)
sleep 3
# check if signature exists
match_not(
:css => '.active [data-name="body"]',
:value => signature_body1,
:no_quote => true,
)
match_not(
:css => '.active [data-name="body"]',
:value => signature_body2,
:no_quote => true,
)
2015-01-23 22:24:03 +00:00
end
end