2015-02-20 23:17:49 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class AgentTicketOverviewLevel1Test < TestCase
|
2015-04-27 19:56:07 +00:00
|
|
|
def test_i
|
2015-04-27 13:43:34 +00:00
|
|
|
name = 'name-' + rand(999_999).to_s
|
2015-02-20 23:17:49 +00:00
|
|
|
|
2015-02-22 12:28:34 +00:00
|
|
|
browser1 = browser_instance
|
|
|
|
login(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser1,
|
|
|
|
username: 'master@example.com',
|
|
|
|
password: 'test',
|
|
|
|
url: browser_url,
|
2015-02-22 12:28:34 +00:00
|
|
|
)
|
2015-04-27 13:42:53 +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(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
|
|
|
username: 'agent1@example.com',
|
|
|
|
password: 'test',
|
|
|
|
url: browser_url,
|
2015-02-22 12:28:34 +00:00
|
|
|
)
|
2015-04-27 13:42:53 +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,
|
|
|
|
data: {
|
2015-02-22 12:28:34 +00:00
|
|
|
:name => name,
|
|
|
|
:link => name,
|
|
|
|
:role => 'Agent',
|
|
|
|
:prio => 1000,
|
|
|
|
'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,
|
|
|
|
data: {
|
|
|
|
customer: 'nico*',
|
|
|
|
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,
|
|
|
|
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,
|
|
|
|
data: {
|
|
|
|
customer: 'nico*',
|
|
|
|
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,
|
|
|
|
data: {
|
|
|
|
customer: 'nico*',
|
|
|
|
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,
|
|
|
|
number: ticket3[:number],
|
|
|
|
link: '#ticket/view/' + name,
|
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,
|
|
|
|
css: '.active .ticketZoom .overview-navigator.horizontal .pagination-counter',
|
|
|
|
value: '1/',
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
|
|
|
css: '.active .page-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,
|
|
|
|
css: '.active .ticketZoom .overview-navigator.horizontal .next',
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
|
|
|
css: '.active .ticketZoom .overview-navigator.horizontal .pagination-counter',
|
|
|
|
value: '2/',
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
|
|
|
css: '.active .page-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,
|
|
|
|
css: '.active .ticketZoom .overview-navigator.horizontal .next',
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
|
|
|
css: '.active .ticketZoom .overview-navigator.horizontal .pagination-counter',
|
|
|
|
value: '3/',
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
|
|
|
css: '.active .page-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,
|
|
|
|
data: {
|
|
|
|
state: 'closed',
|
2015-02-22 22:51:44 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
sleep 8
|
|
|
|
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
|
|
|
css: '.active .ticketZoom .overview-navigator.horizontal .pagination-counter',
|
|
|
|
value: '3/',
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
|
|
|
css: '.active .page-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,
|
|
|
|
css: '.active .ticketZoom .overview-navigator.horizontal .previous',
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
|
|
|
css: '.active .ticketZoom .overview-navigator.horizontal .pagination-counter',
|
|
|
|
value: '2/',
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
|
|
|
css: '.active .page-header .ticket-number',
|
|
|
|
value: ticket2[:number],
|
2015-02-22 22:51:44 +00:00
|
|
|
)
|
2015-02-20 23:17:49 +00:00
|
|
|
end
|
2015-04-27 14:15:29 +00:00
|
|
|
end
|