2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2015-02-20 23:17:49 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class AgentTicketOverviewLevel1Test < TestCase
|
2015-04-27 19:56:07 +00:00
|
|
|
def test_i
|
2021-09-20 10:47:05 +00:00
|
|
|
name1 = "name_low_#{SecureRandom.uuid}"
|
|
|
|
name2 = "name_high_#{SecureRandom.uuid}"
|
2015-02-20 23:17:49 +00:00
|
|
|
|
2015-02-22 12:28:34 +00:00
|
|
|
browser1 = browser_instance
|
|
|
|
login(
|
2018-12-19 17:31:51 +00:00
|
|
|
browser: browser1,
|
2021-08-17 12:10:02 +00:00
|
|
|
username: 'admin@example.com',
|
2015-04-27 13:42:53 +00:00
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2015-02-22 12:28:34 +00:00
|
|
|
)
|
2016-02-29 15:00:11 +00:00
|
|
|
tasks_close_all(browser: browser1)
|
2015-02-20 23:17:49 +00:00
|
|
|
|
2015-02-22 12:28:34 +00:00
|
|
|
browser2 = browser_instance
|
|
|
|
login(
|
2018-12-19 17:31:51 +00:00
|
|
|
browser: browser2,
|
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-22 12:28:34 +00:00
|
|
|
)
|
2016-02-29 15:00:11 +00:00
|
|
|
tasks_close_all(browser: browser2)
|
2015-02-20 23:17:49 +00:00
|
|
|
|
2015-02-22 12:28:34 +00:00
|
|
|
# create new overview
|
2015-04-27 19:56:07 +00:00
|
|
|
overview_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser1,
|
2018-12-19 17:31:51 +00:00
|
|
|
data: {
|
2015-10-07 05:39:58 +00:00
|
|
|
name: name1,
|
2017-04-19 19:54:04 +00:00
|
|
|
roles: ['Agent'],
|
2015-10-07 05:39:58 +00:00
|
|
|
selector: {
|
2015-09-21 20:51:10 +00:00
|
|
|
'Priority' => '1 low',
|
|
|
|
},
|
2015-02-22 12:28:34 +00:00
|
|
|
'order::direction' => 'down',
|
|
|
|
}
|
|
|
|
)
|
2015-09-21 20:51:10 +00:00
|
|
|
overview_create(
|
|
|
|
browser: browser1,
|
2018-12-19 17:31:51 +00:00
|
|
|
data: {
|
2015-10-07 05:39:58 +00:00
|
|
|
name: name2,
|
2017-04-19 19:54:04 +00:00
|
|
|
roles: ['Agent'],
|
2015-10-07 05:39:58 +00:00
|
|
|
selector: {
|
2015-09-21 20:51:10 +00:00
|
|
|
'Priority' => '3 high',
|
|
|
|
},
|
|
|
|
'order::direction' => 'down',
|
|
|
|
}
|
|
|
|
)
|
2015-02-20 23:17:49 +00:00
|
|
|
|
2015-02-22 12:28:34 +00:00
|
|
|
# create tickets
|
|
|
|
ticket1 = ticket_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser1,
|
2018-12-19 17:31:51 +00:00
|
|
|
data: {
|
2016-03-14 22:29:39 +00:00
|
|
|
customer: 'nico',
|
2015-09-21 20:51:10 +00:00
|
|
|
priority: '1 low',
|
2018-12-19 17:31:51 +00:00
|
|
|
group: 'Users',
|
|
|
|
title: 'overview #1',
|
|
|
|
body: 'overview #1',
|
2015-02-22 12:28:34 +00:00
|
|
|
}
|
|
|
|
)
|
2015-02-20 23:17:49 +00:00
|
|
|
|
2015-02-23 00:02:38 +00:00
|
|
|
# keep connection alive
|
|
|
|
click(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.search-holder',
|
2015-02-23 00:02:38 +00:00
|
|
|
)
|
|
|
|
|
2015-02-22 12:28:34 +00:00
|
|
|
ticket2 = ticket_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser1,
|
2018-12-19 17:31:51 +00:00
|
|
|
data: {
|
2016-03-14 22:29:39 +00:00
|
|
|
customer: 'nico',
|
2015-09-21 20:51:10 +00:00
|
|
|
priority: '1 low',
|
2018-12-19 17:31:51 +00:00
|
|
|
group: 'Users',
|
|
|
|
title: 'overview #2',
|
|
|
|
body: 'overview #2',
|
2015-02-22 12:28:34 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
ticket3 = ticket_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser1,
|
2018-12-19 17:31:51 +00:00
|
|
|
data: {
|
2016-03-14 22:29:39 +00:00
|
|
|
customer: 'nico',
|
2015-09-21 20:51:10 +00:00
|
|
|
priority: '1 low',
|
2018-12-19 17:31:51 +00:00
|
|
|
group: 'Users',
|
|
|
|
title: 'overview #3',
|
|
|
|
body: 'overview #3',
|
2015-02-22 12:28:34 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
# click on #1 on overview
|
|
|
|
ticket_open_by_overview(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
number: ticket3[:number],
|
|
|
|
link: "#ticket/view/#{name1}",
|
2015-02-22 12:28:34 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# use overview navigation to got to #2 & #3
|
2015-02-22 22:51:44 +00:00
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom .ticketZoom-controls .overview-navigator .pagination-counter .pagination-item-current',
|
|
|
|
value: '1',
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom-header .ticket-number',
|
|
|
|
value: ticket3[:number],
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
2015-02-20 23:17:49 +00:00
|
|
|
|
2015-02-22 22:51:44 +00:00
|
|
|
click(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom .ticketZoom-controls .overview-navigator .next',
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom .ticketZoom-controls .overview-navigator .pagination-counter .pagination-item-current',
|
|
|
|
value: '2',
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom-header .ticket-number',
|
|
|
|
value: ticket2[:number],
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
click(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom .ticketZoom-controls .overview-navigator .next',
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom .ticketZoom-controls .overview-navigator .pagination-counter .pagination-item-current',
|
|
|
|
value: '3',
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom-header .ticket-number',
|
|
|
|
value: ticket1[:number],
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
2015-02-20 23:17:49 +00:00
|
|
|
|
2015-02-22 22:51:44 +00:00
|
|
|
# close ticket
|
2015-02-23 15:35:48 +00:00
|
|
|
sleep 2 # needed to selenium cache issues
|
2015-02-22 22:51:44 +00:00
|
|
|
ticket_update(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
data: {
|
2015-04-27 13:42:53 +00:00
|
|
|
state: 'closed',
|
2015-02-22 22:51:44 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
sleep 8
|
|
|
|
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom .ticketZoom-controls .overview-navigator .pagination-counter .pagination-item-current',
|
|
|
|
value: '3',
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom-header .ticket-number',
|
|
|
|
value: ticket1[:number],
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
|
|
|
click(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom .ticketZoom-controls .overview-navigator .previous',
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom .ticketZoom-controls .overview-navigator .pagination-counter .pagination-item-current',
|
|
|
|
value: '2',
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom-header .ticket-number',
|
|
|
|
value: ticket2[:number],
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
2015-09-21 20:51:10 +00:00
|
|
|
click(
|
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom .ticketZoom-controls .overview-navigator .next',
|
2015-09-21 20:51:10 +00:00
|
|
|
)
|
|
|
|
match(
|
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom-header .ticket-number',
|
|
|
|
value: ticket1[:number],
|
2015-09-21 20:51:10 +00:00
|
|
|
)
|
|
|
|
sleep 2 # needed to selenium cache issues
|
|
|
|
ticket_update(
|
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
data: {
|
|
|
|
state: 'closed',
|
2015-09-21 20:51:10 +00:00
|
|
|
priority: '3 high',
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2015-11-06 00:29:51 +00:00
|
|
|
watch_for_disappear(
|
2015-09-21 20:51:10 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom .ticketZoom-controls .overview-navigator .pagination-counter .pagination-item-current',
|
2015-09-21 20:51:10 +00:00
|
|
|
)
|
|
|
|
match(
|
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .ticketZoom-header .ticket-number',
|
|
|
|
value: ticket1[:number],
|
2015-09-21 20:51:10 +00:00
|
|
|
)
|
|
|
|
|
2015-02-20 23:17:49 +00:00
|
|
|
end
|
2015-04-27 14:15:29 +00:00
|
|
|
end
|