2017-11-23 08:09:44 +00:00
|
|
|
|
2016-03-07 06:46:11 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class AgentTicketActionLevel0Test < TestCase
|
|
|
|
|
|
|
|
def test_aaa_agent_ticket_create_with_one_group
|
|
|
|
agent = "bob.smith_one_group#{rand(99_999_999)}"
|
|
|
|
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
|
|
|
username: 'master@example.com',
|
|
|
|
password: 'test',
|
|
|
|
url: browser_url,
|
|
|
|
)
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
# create new ticket
|
|
|
|
ticket1 = ticket_create(
|
|
|
|
data: {
|
|
|
|
customer: 'nico',
|
2016-03-08 06:33:25 +00:00
|
|
|
group: '-NONE-',
|
2016-03-07 06:46:11 +00:00
|
|
|
title: 'some subject 123äöü - one group 1',
|
|
|
|
body: 'some body 123äöü - one group 1',
|
|
|
|
},
|
|
|
|
)
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
# update ticket
|
|
|
|
ticket_update(
|
|
|
|
data: {
|
2016-03-08 06:33:25 +00:00
|
|
|
state: 'closed',
|
|
|
|
group: '-NONE-',
|
2016-03-07 06:46:11 +00:00
|
|
|
body: 'some body 1234 äöüß - one group 1 - update',
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
# invite agent (with one group)
|
2016-03-23 07:24:25 +00:00
|
|
|
click(css: '#navigation a[href="#dashboard"]')
|
|
|
|
click(css: '.active.content .tab[data-area="first-steps-widgets"]')
|
2016-03-07 06:46:11 +00:00
|
|
|
watch_for(
|
|
|
|
css: '.active.content',
|
|
|
|
value: 'Configuration',
|
|
|
|
)
|
2016-03-23 07:24:25 +00:00
|
|
|
click(css: '.active.content .js-inviteAgent')
|
|
|
|
modal_ready()
|
2016-03-07 06:46:11 +00:00
|
|
|
set(
|
|
|
|
css: '.modal [name="firstname"]',
|
|
|
|
value: 'Bob',
|
|
|
|
)
|
|
|
|
set(
|
|
|
|
css: '.modal [name="lastname"]',
|
|
|
|
value: 'Smith',
|
|
|
|
)
|
|
|
|
set(
|
|
|
|
css: '.modal [name="email"]',
|
|
|
|
value: "#{agent}@example.com",
|
|
|
|
)
|
2016-12-14 14:48:41 +00:00
|
|
|
exists(
|
|
|
|
displayed: false,
|
2017-06-16 20:43:09 +00:00
|
|
|
css: '.modal .js-groupList',
|
2016-12-14 14:48:41 +00:00
|
|
|
)
|
|
|
|
exists(
|
2017-06-16 20:43:09 +00:00
|
|
|
css: '.modal .js-groupListItem[value=full]:checked',
|
2016-12-14 14:48:41 +00:00
|
|
|
)
|
|
|
|
click(
|
|
|
|
css: '.modal button.btn.btn--primary',
|
|
|
|
fast: true,
|
|
|
|
)
|
|
|
|
watch_for(
|
|
|
|
css: 'body div.modal',
|
|
|
|
value: 'Sending',
|
|
|
|
)
|
|
|
|
watch_for_disappear(
|
|
|
|
css: 'body div.modal',
|
|
|
|
value: 'Sending',
|
|
|
|
)
|
|
|
|
|
|
|
|
click(css: '#navigation a[href="#dashboard"]')
|
|
|
|
click(css: '.active.content .tab[data-area="first-steps-widgets"]')
|
|
|
|
watch_for(
|
|
|
|
css: '.active.content',
|
|
|
|
value: 'Configuration',
|
|
|
|
)
|
|
|
|
click(css: '.active.content .js-inviteAgent')
|
|
|
|
modal_ready()
|
|
|
|
set(
|
|
|
|
css: '.modal [name="firstname"]',
|
|
|
|
value: 'Bob2',
|
|
|
|
)
|
|
|
|
set(
|
|
|
|
css: '.modal [name="lastname"]',
|
|
|
|
value: 'Smith2',
|
|
|
|
)
|
|
|
|
set(
|
|
|
|
css: '.modal [name="email"]',
|
|
|
|
value: "#{agent}2@example.com",
|
|
|
|
)
|
|
|
|
|
|
|
|
# disable agent role
|
|
|
|
uncheck(
|
|
|
|
css: '.modal [name="role_ids"][value=2]',
|
|
|
|
)
|
|
|
|
|
|
|
|
exists(
|
|
|
|
displayed: false,
|
2017-06-16 20:43:09 +00:00
|
|
|
css: '.modal .js-groupList',
|
2016-12-14 14:48:41 +00:00
|
|
|
)
|
2016-03-07 06:46:11 +00:00
|
|
|
exists_not(
|
2017-06-16 20:43:09 +00:00
|
|
|
css: '.modal .js-groupListItem[value=full]:checked',
|
2016-12-14 14:48:41 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# enable agent role
|
|
|
|
check(
|
|
|
|
css: '.modal [name="role_ids"][value=2]',
|
|
|
|
)
|
|
|
|
|
|
|
|
exists(
|
2017-06-16 20:43:09 +00:00
|
|
|
displayed: false,
|
|
|
|
css: '.modal .js-groupList',
|
2016-03-07 06:46:11 +00:00
|
|
|
)
|
2016-12-14 14:48:41 +00:00
|
|
|
exists(
|
2017-06-16 20:43:09 +00:00
|
|
|
css: '.modal .js-groupListItem[value=full]:checked',
|
2016-12-14 14:48:41 +00:00
|
|
|
)
|
|
|
|
|
2016-03-07 06:46:11 +00:00
|
|
|
click(
|
|
|
|
css: '.modal button.btn.btn--primary',
|
|
|
|
fast: true,
|
|
|
|
)
|
|
|
|
watch_for(
|
|
|
|
css: 'body div.modal',
|
|
|
|
value: 'Sending',
|
|
|
|
)
|
|
|
|
watch_for_disappear(
|
|
|
|
css: 'body div.modal',
|
|
|
|
value: 'Sending',
|
|
|
|
)
|
|
|
|
|
2016-03-10 07:39:41 +00:00
|
|
|
tasks_close_all()
|
|
|
|
|
2016-03-07 06:46:11 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_bbb_customer_ticket_create_with_one_group
|
|
|
|
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
|
|
|
username: 'nicole.braun@zammad.org',
|
|
|
|
password: 'test',
|
|
|
|
url: browser_url,
|
|
|
|
)
|
|
|
|
|
|
|
|
# customer ticket create
|
2018-03-06 05:30:12 +00:00
|
|
|
click(css: 'a[href="#new"]', only_if_exists: true)
|
2016-06-09 22:25:13 +00:00
|
|
|
click(css: 'a[href="#customer_ticket_new"]')
|
2016-03-07 06:46:11 +00:00
|
|
|
|
2016-06-09 22:25:13 +00:00
|
|
|
watch_for(
|
|
|
|
css: '.newTicket',
|
|
|
|
value: 'New Ticket',
|
|
|
|
)
|
2016-03-23 07:24:25 +00:00
|
|
|
exists_not(css: '.newTicket select[name="group_id"]')
|
2016-03-07 06:46:11 +00:00
|
|
|
|
|
|
|
set(
|
|
|
|
css: '.newTicket input[name="title"]',
|
|
|
|
value: 'one group',
|
|
|
|
)
|
|
|
|
set(
|
|
|
|
css: '.newTicket [data-name="body"]',
|
|
|
|
value: 'one group body',
|
|
|
|
)
|
2016-03-23 07:24:25 +00:00
|
|
|
click(css: '.newTicket button.js-submit', wait: 5)
|
2016-03-07 06:46:11 +00:00
|
|
|
|
|
|
|
# check if ticket is shown
|
|
|
|
location_check(url: '#ticket/zoom/')
|
|
|
|
|
|
|
|
match(
|
|
|
|
css: '.active div.ticket-article',
|
|
|
|
value: 'one group body',
|
|
|
|
no_quote: true,
|
|
|
|
)
|
|
|
|
|
|
|
|
# update ticket
|
|
|
|
set(
|
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: 'one group - some body 1234 äöüß',
|
|
|
|
no_click: true,
|
|
|
|
)
|
|
|
|
|
|
|
|
task_type(
|
|
|
|
type: 'stayOnTab',
|
|
|
|
)
|
|
|
|
|
|
|
|
click(css: '.active .js-submit')
|
|
|
|
|
|
|
|
watch_for(
|
|
|
|
css: '.active div.ticket-article',
|
|
|
|
value: 'one group - some body 1234 äöüß',
|
|
|
|
)
|
|
|
|
|
2016-03-10 07:39:41 +00:00
|
|
|
tasks_close_all()
|
|
|
|
|
2016-03-07 06:46:11 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_ccc_agent_ticket_create_with_more_groups
|
|
|
|
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
|
|
|
username: 'master@example.com',
|
|
|
|
password: 'test',
|
|
|
|
url: browser_url,
|
|
|
|
)
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
group_create(
|
|
|
|
data: {
|
|
|
|
name: "some group #{rand(999_999_999)}",
|
|
|
|
member: [
|
2017-06-16 20:43:09 +00:00
|
|
|
{
|
|
|
|
login: 'master@example.com',
|
|
|
|
access: 'full',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
login: 'agent1@example.com',
|
|
|
|
access: 'full',
|
|
|
|
},
|
2016-03-07 06:46:11 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
# create new ticket
|
|
|
|
ticket1 = ticket_create(
|
|
|
|
data: {
|
|
|
|
customer: 'nico',
|
|
|
|
group: 'Users',
|
|
|
|
title: 'some subject 123äöü - one group 2',
|
|
|
|
body: 'some body 123äöü - one group 2',
|
|
|
|
},
|
|
|
|
)
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
# update ticket
|
|
|
|
ticket_update(
|
|
|
|
data: {
|
|
|
|
body: 'some body 1234 äöüß - one group 2 - update',
|
2016-03-08 06:33:25 +00:00
|
|
|
group: 'Users',
|
2016-03-07 06:46:11 +00:00
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|