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
|
|
|
|
2013-04-23 18:36:09 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
2016-09-05 13:18:22 +00:00
|
|
|
class AgentTicketMergeTest < TestCase
|
2015-01-28 22:47:05 +00:00
|
|
|
def test_agent_ticket_merge_closed_tab
|
2013-07-25 09:11:20 +00:00
|
|
|
|
2015-02-23 15:35:48 +00:00
|
|
|
# merge ticket with closed tab
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
2015-04-27 13:42:53 +00:00
|
|
|
username: 'agent1@example.com',
|
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2015-02-23 15:35:48 +00:00
|
|
|
|
|
|
|
# create new ticket
|
|
|
|
ticket1 = ticket_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
|
|
|
customer: 'nico',
|
2018-12-19 17:31:51 +00:00
|
|
|
group: 'Users',
|
|
|
|
title: 'some subject 123äöü - with closed tab',
|
|
|
|
body: 'some body 123äöü - with closed tab',
|
2013-04-23 18:36:09 +00:00
|
|
|
},
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
sleep 1
|
2013-04-23 18:36:09 +00:00
|
|
|
|
2015-02-23 15:35:48 +00:00
|
|
|
# update ticket
|
|
|
|
ticket_update(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
|
|
|
body: 'some body 1234 äöüß - with closed tab',
|
2013-04-23 18:36:09 +00:00
|
|
|
},
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
2013-04-23 18:36:09 +00:00
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2013-05-31 23:52:15 +00:00
|
|
|
|
2015-02-23 15:35:48 +00:00
|
|
|
# create second ticket to merge
|
2015-04-27 19:56:07 +00:00
|
|
|
ticket_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
|
|
|
customer: 'nico',
|
2018-12-19 17:31:51 +00:00
|
|
|
group: 'Users',
|
|
|
|
title: 'test to merge - with closed tab',
|
|
|
|
body: 'some body 123äöü 222 - test to merge - with closed tab',
|
2013-04-23 18:36:09 +00:00
|
|
|
},
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
2015-01-28 22:47:05 +00:00
|
|
|
|
2015-02-23 15:35:48 +00:00
|
|
|
ticket_update(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
|
|
|
body: 'some body 1234 äöüß 333 - with closed tab',
|
2015-01-28 22:47:05 +00:00
|
|
|
},
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check if task is shown
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.tasks',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'test to merge - with closed tab',
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# merge tickets
|
2021-07-16 13:38:01 +00:00
|
|
|
click(css: '.active div[data-tab="ticket"] .js-actions .icon-arrow-down')
|
|
|
|
click(css: '.active div[data-tab="ticket"] .js-actions [data-type="ticket-merge"]')
|
2015-02-23 15:35:48 +00:00
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
modal_ready
|
2015-02-23 15:35:48 +00:00
|
|
|
set(
|
2021-07-12 13:18:31 +00:00
|
|
|
css: '.modal input[name="target_ticket_number"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: ticket1[:number],
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
|
2021-07-16 13:38:01 +00:00
|
|
|
click(css: '.modal button[type="submit"]')
|
2015-02-23 15:35:48 +00:00
|
|
|
|
|
|
|
# check if merged to ticket is shown now
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom-header .ticket-number',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: ticket1[:number],
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticket-article',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'test to merge - with closed tab',
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check if task is now gone
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.tasks',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'test to merge',
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.tasks',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some subject 123äöü - with closed tab',
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# close task/cleanup
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2015-02-23 15:35:48 +00:00
|
|
|
|
|
|
|
# merge ticket with open tabs
|
|
|
|
ticket3 = ticket_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
|
|
|
customer: 'nico',
|
2018-12-19 17:31:51 +00:00
|
|
|
group: 'Users',
|
|
|
|
title: 'some subject 123äöü - with open tab',
|
|
|
|
body: 'some body 123äöü - with open tab',
|
2015-01-28 22:47:05 +00:00
|
|
|
},
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
|
2015-04-27 19:56:07 +00:00
|
|
|
ticket_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
|
|
|
customer: 'nico',
|
2018-12-19 17:31:51 +00:00
|
|
|
group: 'Users',
|
|
|
|
title: 'test to merge - with open tab',
|
|
|
|
body: 'some body 123äöü 222 - test to merge - with open tab',
|
2015-01-28 22:47:05 +00:00
|
|
|
},
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# merge tickets
|
2021-07-16 13:38:01 +00:00
|
|
|
click(css: '.active div[data-tab="ticket"] .js-actions .icon-arrow-down')
|
|
|
|
click(css: '.active div[data-tab="ticket"] .js-actions [data-type="ticket-merge"]')
|
2015-02-23 15:35:48 +00:00
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
modal_ready
|
2015-02-23 15:35:48 +00:00
|
|
|
set(
|
2021-07-12 13:18:31 +00:00
|
|
|
css: '.modal input[name="target_ticket_number"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: ticket3[:number],
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
2021-07-16 13:38:01 +00:00
|
|
|
click(css: '.modal button[type="submit"]')
|
2015-02-23 15:35:48 +00:00
|
|
|
|
|
|
|
# check if merged to ticket is shown now
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom-header .ticket-number',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: ticket3[:number],
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticket-article',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'test to merge - with open tab',
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check if task is now gone
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.tasks',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'test to merge',
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.tasks',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some subject 123äöü - with open tab',
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
|
2015-01-28 22:47:05 +00:00
|
|
|
end
|
2015-04-27 14:15:29 +00:00
|
|
|
end
|