2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2016-09-05 13:18:22 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class AgentTicketLinkTest < TestCase
|
|
|
|
|
|
|
|
def test_c_link
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
|
|
|
username: 'agent1@example.com',
|
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2016-09-05 13:18:22 +00:00
|
|
|
)
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2016-09-05 13:18:22 +00:00
|
|
|
|
|
|
|
ticket1 = ticket_create(
|
|
|
|
data: {
|
|
|
|
customer: 'nico',
|
2018-12-19 17:31:51 +00:00
|
|
|
group: 'Users',
|
|
|
|
title: 'some subject - link#1',
|
|
|
|
body: 'some body - link#1',
|
2016-09-05 13:18:22 +00:00
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
ticket2 = ticket_create(
|
|
|
|
data: {
|
|
|
|
customer: 'nico',
|
2018-12-19 17:31:51 +00:00
|
|
|
group: 'Users',
|
|
|
|
title: 'some subject - link#2',
|
|
|
|
body: 'some body - link#2',
|
2016-09-05 13:18:22 +00:00
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
# verify changes in second browser
|
|
|
|
browser2 = browser_instance
|
|
|
|
login(
|
2018-12-19 17:31:51 +00:00
|
|
|
browser: browser2,
|
2021-08-17 12:10:02 +00:00
|
|
|
username: 'admin@example.com',
|
2016-09-05 13:18:22 +00:00
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2016-09-05 13:18:22 +00:00
|
|
|
)
|
|
|
|
ticket_open_by_search(
|
|
|
|
browser: browser2,
|
|
|
|
number: ticket1[:number],
|
|
|
|
)
|
|
|
|
|
|
|
|
click(
|
2021-03-22 13:25:43 +00:00
|
|
|
css: '.content.active .js-links .js-add',
|
2016-09-05 13:18:22 +00:00
|
|
|
)
|
2018-07-25 07:27:36 +00:00
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
modal_ready
|
2016-09-05 13:18:22 +00:00
|
|
|
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .modal-body [name="ticket_number"]',
|
2016-09-05 13:18:22 +00:00
|
|
|
value: ticket1[:number],
|
|
|
|
)
|
|
|
|
select(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .modal-body [name="link_type"]',
|
2016-09-05 13:18:22 +00:00
|
|
|
value: 'Normal',
|
|
|
|
)
|
|
|
|
click(
|
|
|
|
css: '.content.active .modal-footer .js-submit',
|
|
|
|
)
|
|
|
|
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .ticketLinks',
|
2016-09-05 13:18:22 +00:00
|
|
|
value: ticket1[:title],
|
|
|
|
)
|
|
|
|
|
|
|
|
watch_for(
|
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .ticketLinks',
|
|
|
|
value: ticket2[:title],
|
2016-09-05 13:18:22 +00:00
|
|
|
)
|
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
reload
|
2016-09-05 13:18:22 +00:00
|
|
|
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .ticketLinks',
|
2016-09-05 13:18:22 +00:00
|
|
|
value: ticket1[:title],
|
|
|
|
)
|
|
|
|
click(
|
|
|
|
css: '.content.active .ticketLinks .js-delete'
|
|
|
|
)
|
|
|
|
watch_for_disappear(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .ticketLinks',
|
2016-09-05 13:18:22 +00:00
|
|
|
value: ticket1[:title],
|
|
|
|
)
|
|
|
|
watch_for_disappear(
|
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .ticketLinks',
|
|
|
|
value: ticket2[:title],
|
2016-09-05 13:18:22 +00:00
|
|
|
)
|
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
reload
|
2016-09-05 13:18:22 +00:00
|
|
|
|
|
|
|
watch_for_disappear(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .ticketLinks',
|
2016-09-05 13:18:22 +00:00
|
|
|
value: ticket1[:title],
|
|
|
|
)
|
|
|
|
watch_for_disappear(
|
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .ticketLinks',
|
|
|
|
value: ticket2[:title],
|
2016-09-05 13:18:22 +00:00
|
|
|
)
|
2019-11-28 06:59:22 +00:00
|
|
|
|
|
|
|
# cleanup
|
|
|
|
ticket_open_by_search(
|
|
|
|
browser: browser2,
|
|
|
|
number: ticket1[:number],
|
|
|
|
)
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
ticket_update(
|
|
|
|
browser: browser2,
|
|
|
|
data: {
|
|
|
|
state: 'closed',
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2019-11-28 06:59:22 +00:00
|
|
|
|
|
|
|
ticket_open_by_search(
|
|
|
|
browser: browser2,
|
|
|
|
number: ticket2[:number],
|
|
|
|
)
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
ticket_update(
|
|
|
|
browser: browser2,
|
|
|
|
data: {
|
|
|
|
state: 'closed',
|
|
|
|
}
|
|
|
|
)
|
2016-09-05 13:18:22 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|