trabajo-afectivo/test/browser/agent_ticket_link_test.rb

138 lines
2.7 KiB
Ruby
Raw Permalink Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://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',
url: browser_url,
2016-09-05 13:18:22 +00:00
)
tasks_close_all
2016-09-05 13:18:22 +00:00
ticket1 = ticket_create(
data: {
customer: 'nico',
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',
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(
browser: browser2,
2021-08-17 12:10:02 +00:00
username: 'admin@example.com',
2016-09-05 13:18:22 +00:00
password: 'test',
url: browser_url,
2016-09-05 13:18:22 +00:00
)
ticket_open_by_search(
browser: browser2,
number: ticket1[:number],
)
click(
css: '.content.active .js-links .js-add',
2016-09-05 13:18:22 +00:00
)
modal_ready
2016-09-05 13:18:22 +00:00
set(
css: '.content.active .modal-body [name="ticket_number"]',
2016-09-05 13:18:22 +00:00
value: ticket1[:number],
)
select(
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(
css: '.content.active .ticketLinks',
2016-09-05 13:18:22 +00:00
value: ticket1[:title],
)
watch_for(
browser: browser2,
css: '.content.active .ticketLinks',
value: ticket2[:title],
2016-09-05 13:18:22 +00:00
)
reload
2016-09-05 13:18:22 +00:00
watch_for(
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(
css: '.content.active .ticketLinks',
2016-09-05 13:18:22 +00:00
value: ticket1[:title],
)
watch_for_disappear(
browser: browser2,
css: '.content.active .ticketLinks',
value: ticket2[:title],
2016-09-05 13:18:22 +00:00
)
reload
2016-09-05 13:18:22 +00:00
watch_for_disappear(
css: '.content.active .ticketLinks',
2016-09-05 13:18:22 +00:00
value: ticket1[:title],
)
watch_for_disappear(
browser: browser2,
css: '.content.active .ticketLinks',
value: ticket2[:title],
2016-09-05 13:18:22 +00:00
)
# cleanup
ticket_open_by_search(
browser: browser2,
number: ticket1[:number],
)
sleep 1
ticket_update(
browser: browser2,
data: {
state: 'closed',
}
)
tasks_close_all
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