2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2016-03-07 06:46:11 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class AgentTicketActionLevel0Test < TestCase
|
|
|
|
|
|
|
|
def test_aaa_agent_ticket_create_with_one_group
|
2021-09-20 10:47:05 +00:00
|
|
|
agent = "bob.smith_one_group#{SecureRandom.uuid}"
|
2016-03-07 06:46:11 +00:00
|
|
|
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
2021-08-17 12:10:02 +00:00
|
|
|
username: 'admin@example.com',
|
2016-03-07 06:46:11 +00:00
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2016-03-07 06:46:11 +00:00
|
|
|
)
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2016-03-07 06:46:11 +00:00
|
|
|
|
|
|
|
# create new ticket
|
2019-06-28 11:38:49 +00:00
|
|
|
ticket_create(
|
2016-03-07 06:46:11 +00:00
|
|
|
data: {
|
|
|
|
customer: 'nico',
|
2018-12-19 17:31:51 +00:00
|
|
|
group: '-NONE-',
|
|
|
|
title: 'some subject 123äöü - one group 1',
|
|
|
|
body: 'some body 123äöü - one group 1',
|
2016-03-07 06:46:11 +00:00
|
|
|
},
|
|
|
|
)
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
# update ticket
|
|
|
|
ticket_update(
|
|
|
|
data: {
|
2016-03-08 06:33:25 +00:00
|
|
|
state: 'closed',
|
|
|
|
group: '-NONE-',
|
2018-12-19 17:31:51 +00:00
|
|
|
body: 'some body 1234 äöüß - one group 1 - update',
|
2016-03-07 06:46:11 +00:00
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2016-03-07 06:46:11 +00:00
|
|
|
|
|
|
|
# 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')
|
2021-07-16 13:29:38 +00:00
|
|
|
modal_ready
|
2016-03-07 06:46:11 +00:00
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.modal [name="firstname"]',
|
2016-03-07 06:46:11 +00:00
|
|
|
value: 'Bob',
|
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.modal [name="lastname"]',
|
2016-03-07 06:46:11 +00:00
|
|
|
value: 'Smith',
|
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.modal [name="email"]',
|
2016-03-07 06:46:11 +00:00
|
|
|
value: "#{agent}@example.com",
|
|
|
|
)
|
2016-12-14 14:48:41 +00:00
|
|
|
exists(
|
|
|
|
displayed: false,
|
2018-12-19 17:31:51 +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(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.modal button.btn.btn--primary',
|
2016-12-14 14:48:41 +00:00
|
|
|
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')
|
2021-07-16 13:29:38 +00:00
|
|
|
modal_ready
|
2016-12-14 14:48:41 +00:00
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.modal [name="firstname"]',
|
2016-12-14 14:48:41 +00:00
|
|
|
value: 'Bob2',
|
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.modal [name="lastname"]',
|
2016-12-14 14:48:41 +00:00
|
|
|
value: 'Smith2',
|
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.modal [name="email"]',
|
2016-12-14 14:48:41 +00:00
|
|
|
value: "#{agent}2@example.com",
|
|
|
|
)
|
|
|
|
|
|
|
|
# disable agent role
|
|
|
|
uncheck(
|
|
|
|
css: '.modal [name="role_ids"][value=2]',
|
|
|
|
)
|
|
|
|
|
|
|
|
exists(
|
|
|
|
displayed: false,
|
2018-12-19 17:31:51 +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,
|
2018-12-19 17:31:51 +00:00
|
|
|
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(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.modal button.btn.btn--primary',
|
2016-03-07 06:46:11 +00:00
|
|
|
fast: true,
|
|
|
|
)
|
|
|
|
watch_for(
|
|
|
|
css: 'body div.modal',
|
|
|
|
value: 'Sending',
|
|
|
|
)
|
|
|
|
watch_for_disappear(
|
|
|
|
css: 'body div.modal',
|
|
|
|
value: 'Sending',
|
|
|
|
)
|
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2016-03-10 07:39:41 +00:00
|
|
|
|
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',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2016-03-07 06:46:11 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# 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(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.newTicket',
|
2016-06-09 22:25:13 +00:00
|
|
|
value: 'New Ticket',
|
|
|
|
)
|
2021-06-15 06:26:52 +00:00
|
|
|
exists(css: '.newTicket .form-group.hide select[name="group_id"]')
|
2016-03-07 06:46:11 +00:00
|
|
|
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.newTicket input[name="title"]',
|
2016-03-07 06:46:11 +00:00
|
|
|
value: 'one group',
|
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.newTicket [data-name="body"]',
|
2016-03-07 06:46:11 +00:00
|
|
|
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(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active div.ticket-article',
|
|
|
|
value: 'one group body',
|
2016-03-07 06:46:11 +00:00
|
|
|
no_quote: true,
|
|
|
|
)
|
|
|
|
|
|
|
|
# update ticket
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="body"]',
|
|
|
|
value: 'one group - some body 1234 äöüß',
|
2016-03-07 06:46:11 +00:00
|
|
|
no_click: true,
|
|
|
|
)
|
|
|
|
|
|
|
|
task_type(
|
|
|
|
type: 'stayOnTab',
|
|
|
|
)
|
|
|
|
|
|
|
|
click(css: '.active .js-submit')
|
|
|
|
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active div.ticket-article',
|
2016-03-07 06:46:11 +00:00
|
|
|
value: 'one group - some body 1234 äöüß',
|
|
|
|
)
|
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2016-03-10 07:39:41 +00:00
|
|
|
|
2016-03-07 06:46:11 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_ccc_agent_ticket_create_with_more_groups
|
|
|
|
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
2021-08-17 12:10:02 +00:00
|
|
|
username: 'admin@example.com',
|
2016-03-07 06:46:11 +00:00
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2016-03-07 06:46:11 +00:00
|
|
|
)
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2016-03-07 06:46:11 +00:00
|
|
|
|
|
|
|
group_create(
|
|
|
|
data: {
|
2021-09-20 10:47:05 +00:00
|
|
|
name: "some group #{SecureRandom.uuid}",
|
2016-03-07 06:46:11 +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',
|
|
|
|
},
|
|
|
|
{
|
2018-12-19 17:31:51 +00:00
|
|
|
login: 'agent1@example.com',
|
2017-06-16 20:43:09 +00:00
|
|
|
access: 'full',
|
|
|
|
},
|
2016-03-07 06:46:11 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2018-08-06 10:21:44 +00:00
|
|
|
# wait to push new group dependencies to browser (to show group selection)
|
|
|
|
sleep 12
|
|
|
|
|
2016-03-07 06:46:11 +00:00
|
|
|
# create new ticket
|
2019-06-28 11:38:49 +00:00
|
|
|
ticket_create(
|
2016-03-07 06:46:11 +00:00
|
|
|
data: {
|
|
|
|
customer: 'nico',
|
2018-12-19 17:31:51 +00:00
|
|
|
group: 'Users',
|
|
|
|
title: 'some subject 123äöü - one group 2',
|
|
|
|
body: 'some body 123äöü - one group 2',
|
2016-03-07 06:46:11 +00:00
|
|
|
},
|
|
|
|
)
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
# update ticket
|
|
|
|
ticket_update(
|
|
|
|
data: {
|
2018-12-19 17:31:51 +00:00
|
|
|
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
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2016-03-07 06:46:11 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|