2017-11-23 08:09:44 +00:00
|
|
|
|
2015-02-20 13:40:51 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class AgentTicketOverviewLevel0Test < TestCase
|
2015-04-27 19:56:07 +00:00
|
|
|
def test_i
|
2015-02-22 12:28:34 +00:00
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
2015-04-27 13:42:53 +00:00
|
|
|
username: 'master@example.com',
|
|
|
|
password: 'test',
|
|
|
|
url: browser_url,
|
2015-02-22 12:28:34 +00:00
|
|
|
)
|
|
|
|
tasks_close_all()
|
2015-02-20 13:40:51 +00:00
|
|
|
|
2015-02-24 20:22:45 +00:00
|
|
|
# test bulk action
|
|
|
|
|
|
|
|
# create new ticket
|
|
|
|
ticket1 = ticket_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
2016-03-14 22:29:39 +00:00
|
|
|
customer: 'nico',
|
2015-04-27 13:42:53 +00:00
|
|
|
group: 'Users',
|
|
|
|
title: 'overview count test #1',
|
|
|
|
body: 'overview count test #1',
|
2015-02-24 20:22:45 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
ticket2 = ticket_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
2016-03-14 22:29:39 +00:00
|
|
|
customer: 'nico',
|
2015-04-27 13:42:53 +00:00
|
|
|
group: 'Users',
|
|
|
|
title: 'overview count test #2',
|
|
|
|
body: 'overview count test #2',
|
2015-02-24 20:22:45 +00:00
|
|
|
}
|
|
|
|
)
|
2016-03-12 16:23:51 +00:00
|
|
|
click(text: 'Overviews')
|
2015-11-05 12:34:22 +00:00
|
|
|
|
|
|
|
# enable full overviews
|
|
|
|
execute(
|
|
|
|
js: '$(".content.active .sidebar").css("display", "block")',
|
|
|
|
)
|
|
|
|
|
2016-03-12 16:23:51 +00:00
|
|
|
click(text: 'Unassigned & Open')
|
2016-03-04 15:37:11 +00:00
|
|
|
sleep 8 # till overview is rendered
|
2015-02-24 20:22:45 +00:00
|
|
|
|
|
|
|
# select both via bulk action
|
|
|
|
click(
|
2015-06-06 09:45:43 +00:00
|
|
|
css: '.active table tr td input[value="' + ticket1[:id] + '"] + .icon-checkbox.icon-unchecked',
|
2015-04-27 13:42:53 +00:00
|
|
|
fast: true,
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
2015-11-17 18:57:15 +00:00
|
|
|
|
|
|
|
# scroll to reply - needed for chrome
|
|
|
|
scroll_to(
|
|
|
|
position: 'top',
|
|
|
|
css: '.active table tr td input[value="' + ticket2[:id] + '"] + .icon-checkbox.icon-unchecked',
|
|
|
|
)
|
2015-02-24 20:22:45 +00:00
|
|
|
click(
|
2015-06-06 09:45:43 +00:00
|
|
|
css: '.active table tr td input[value="' + ticket2[:id] + '"] + .icon-checkbox.icon-unchecked',
|
2015-04-27 13:42:53 +00:00
|
|
|
fast: true,
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
2015-11-17 09:03:51 +00:00
|
|
|
|
2015-02-24 20:22:45 +00:00
|
|
|
exists(
|
2015-06-06 09:45:43 +00:00
|
|
|
css: '.active table tr td input[value="' + ticket1[:id] + '"][type="checkbox"]:checked',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
|
|
|
exists(
|
2015-06-06 09:45:43 +00:00
|
|
|
css: '.active table tr td input[value="' + ticket2[:id] + '"][type="checkbox"]:checked',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# select close state & submit
|
|
|
|
select(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active .bulkAction [name="state_id"]',
|
|
|
|
value: 'closed',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
|
|
|
click(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active .bulkAction .js-confirm',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
|
|
|
click(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active .bulkAction .js-submit',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
2016-04-08 07:15:24 +00:00
|
|
|
sleep 6
|
2015-02-24 20:22:45 +00:00
|
|
|
|
|
|
|
exists_not(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active table tr td input[value="' + ticket1[:id] + '"]',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
|
|
|
exists_not(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active table tr td input[value="' + ticket2[:id] + '"]',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
|
|
|
|
2015-02-22 12:28:34 +00:00
|
|
|
# remember current overview count
|
|
|
|
overview_counter_before = overview_counter()
|
2015-02-20 13:40:51 +00:00
|
|
|
|
2015-02-24 20:22:45 +00:00
|
|
|
# click options and enable number and article count
|
2016-03-12 16:23:51 +00:00
|
|
|
click(css: '.active [data-type="settings"]')
|
2015-02-24 20:22:45 +00:00
|
|
|
|
|
|
|
watch_for(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.modal h1',
|
|
|
|
value: 'Edit',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
|
|
|
check(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.modal input[value="number"]',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
2015-03-01 23:16:36 +00:00
|
|
|
check(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.modal input[value="title"]',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
check(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.modal input[value="customer"]',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
check(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.modal input[value="group"]',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
|
|
|
check(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.modal input[value="created_at"]',
|
2015-03-01 23:16:36 +00:00
|
|
|
)
|
2015-02-24 20:22:45 +00:00
|
|
|
check(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.modal input[value="article_count"]',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
2016-03-12 16:23:51 +00:00
|
|
|
click(css: '.modal .js-submit')
|
2017-06-16 20:43:09 +00:00
|
|
|
modal_disappear
|
2015-02-24 20:22:45 +00:00
|
|
|
|
|
|
|
# check if number and article count is shown
|
|
|
|
match(
|
2015-09-29 06:24:51 +00:00
|
|
|
css: '.active table th:nth-child(3)',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: '#',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
|
|
|
match(
|
2015-07-16 13:14:47 +00:00
|
|
|
css: '.active table th:nth-child(4)',
|
2015-09-29 06:24:51 +00:00
|
|
|
value: 'Title',
|
|
|
|
)
|
|
|
|
match(
|
|
|
|
css: '.active table th:nth-child(7)',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'Article#',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# reload browser
|
|
|
|
reload()
|
2015-03-01 23:16:36 +00:00
|
|
|
sleep 4
|
2015-02-24 20:22:45 +00:00
|
|
|
|
|
|
|
# check if number and article count is shown
|
|
|
|
match(
|
2015-09-29 06:24:51 +00:00
|
|
|
css: '.active table th:nth-child(3)',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: '#',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
|
|
|
match(
|
2015-07-16 13:14:47 +00:00
|
|
|
css: '.active table th:nth-child(4)',
|
2015-09-29 06:24:51 +00:00
|
|
|
value: 'Title',
|
|
|
|
)
|
|
|
|
match(
|
|
|
|
css: '.active table th:nth-child(7)',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'Article#',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# disable number and article count
|
2016-03-12 16:23:51 +00:00
|
|
|
click(css: '.active [data-type="settings"]')
|
2015-02-24 20:22:45 +00:00
|
|
|
|
|
|
|
watch_for(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.modal h1',
|
|
|
|
value: 'Edit',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
|
|
|
uncheck(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.modal input[value="number"]',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
|
|
|
uncheck(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.modal input[value="article_count"]',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
2016-03-12 16:23:51 +00:00
|
|
|
click(css: '.modal .js-submit')
|
2017-06-16 20:43:09 +00:00
|
|
|
modal_disappear
|
2015-02-24 20:22:45 +00:00
|
|
|
|
|
|
|
# check if number and article count is gone
|
|
|
|
match_not(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active table th:nth-child(3)',
|
|
|
|
value: '#',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
2015-09-29 06:24:51 +00:00
|
|
|
match(
|
|
|
|
css: '.active table th:nth-child(3)',
|
|
|
|
value: 'Title',
|
|
|
|
)
|
2015-02-24 20:22:45 +00:00
|
|
|
exists_not(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active table th:nth-child(8)',
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
|
|
|
|
2015-02-22 12:28:34 +00:00
|
|
|
# create new ticket
|
2015-02-24 20:22:45 +00:00
|
|
|
ticket3 = ticket_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
2016-03-14 22:29:39 +00:00
|
|
|
customer: 'nico',
|
2015-04-27 13:42:53 +00:00
|
|
|
group: 'Users',
|
|
|
|
title: 'overview count test #3',
|
|
|
|
body: 'overview count test #3',
|
2015-02-22 12:28:34 +00:00
|
|
|
}
|
|
|
|
)
|
2015-11-17 09:03:51 +00:00
|
|
|
sleep 6
|
2015-02-20 13:40:51 +00:00
|
|
|
|
2015-02-22 12:28:34 +00:00
|
|
|
# get new overview count
|
|
|
|
overview_counter_new = overview_counter()
|
2016-03-12 16:23:51 +00:00
|
|
|
assert_equal(overview_counter_before['#ticket/view/all_unassigned'] + 1, overview_counter_new['#ticket/view/all_unassigned'])
|
2015-02-20 13:40:51 +00:00
|
|
|
|
2015-02-22 12:28:34 +00:00
|
|
|
# open ticket by search
|
|
|
|
ticket_open_by_search(
|
2015-04-27 13:42:53 +00:00
|
|
|
number: ticket3[:number],
|
2015-02-22 12:28:34 +00:00
|
|
|
)
|
2015-02-23 09:21:39 +00:00
|
|
|
sleep 1
|
2015-02-20 13:40:51 +00:00
|
|
|
|
2015-02-22 12:28:34 +00:00
|
|
|
# close ticket
|
|
|
|
ticket_update(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
|
|
|
state: 'closed',
|
2015-02-22 12:28:34 +00:00
|
|
|
}
|
|
|
|
)
|
2015-11-17 09:03:51 +00:00
|
|
|
sleep 6
|
2015-02-20 13:40:51 +00:00
|
|
|
|
2015-02-22 12:28:34 +00:00
|
|
|
# get current overview count
|
|
|
|
overview_counter_after = overview_counter()
|
2016-03-12 16:23:51 +00:00
|
|
|
assert_equal(overview_counter_before['#ticket/view/all_unassigned'], overview_counter_after['#ticket/view/all_unassigned'])
|
2015-03-01 23:16:36 +00:00
|
|
|
|
|
|
|
# cleanup
|
|
|
|
tasks_close_all()
|
2015-02-20 13:40:51 +00:00
|
|
|
end
|
2015-04-27 14:15:29 +00:00
|
|
|
end
|