2015-02-20 13:40:51 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class AgentTicketOverviewLevel0Test < TestCase
|
|
|
|
def test_I
|
2015-02-22 12:28:34 +00:00
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
|
|
|
:username => 'master@example.com',
|
|
|
|
:password => 'test',
|
|
|
|
:url => browser_url,
|
|
|
|
)
|
|
|
|
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(
|
|
|
|
:data => {
|
|
|
|
:customer => 'nico*',
|
|
|
|
:group => 'Users',
|
2015-03-01 23:16:36 +00:00
|
|
|
:title => 'overview count test #1',
|
|
|
|
:body => 'overview count test #1',
|
2015-02-24 20:22:45 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
ticket2 = ticket_create(
|
|
|
|
:data => {
|
|
|
|
:customer => 'nico*',
|
|
|
|
:group => 'Users',
|
2015-03-01 23:16:36 +00:00
|
|
|
:title => 'overview count test #2',
|
|
|
|
:body => 'overview count test #2',
|
2015-02-24 20:22:45 +00:00
|
|
|
}
|
|
|
|
)
|
2015-03-01 18:30:14 +00:00
|
|
|
sleep 6 # till overview is updated
|
2015-02-24 20:22:45 +00:00
|
|
|
click( :css => '#navigation li.overviews a' )
|
|
|
|
click( :css => '.content.active .sidebar a[href="#ticket/view/all_unassigned"]' )
|
2015-03-01 23:16:36 +00:00
|
|
|
sleep 4 # till overview is rendered
|
2015-02-24 20:22:45 +00:00
|
|
|
|
|
|
|
# select both via bulk action
|
|
|
|
click(
|
2015-02-28 10:40:23 +00:00
|
|
|
:css => '.active table tr td input[value="' + ticket1[:id] + '"] + .checkbox',
|
|
|
|
:fast => true,
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
|
|
|
click(
|
2015-02-28 10:40:23 +00:00
|
|
|
:css => '.active table tr td input[value="' + ticket2[:id] + '"] + .checkbox',
|
|
|
|
:fast => true,
|
2015-02-24 20:22:45 +00:00
|
|
|
)
|
|
|
|
exists(
|
|
|
|
:css => '.active table tr td input[value="' + ticket1[:id] + '"]:checked',
|
|
|
|
)
|
|
|
|
exists(
|
|
|
|
:css => '.active table tr td input[value="' + ticket2[:id] + '"]:checked',
|
|
|
|
)
|
|
|
|
|
|
|
|
# select close state & submit
|
|
|
|
select(
|
|
|
|
:css => '.active .bulkAction [name="state_id"]',
|
|
|
|
:value => 'closed',
|
|
|
|
)
|
|
|
|
click(
|
|
|
|
:css => '.active .bulkAction .js-confirm',
|
|
|
|
)
|
|
|
|
click(
|
|
|
|
:css => '.active .bulkAction .js-submit',
|
|
|
|
)
|
2015-03-01 23:16:36 +00:00
|
|
|
sleep 6
|
2015-02-24 20:22:45 +00:00
|
|
|
|
|
|
|
exists_not(
|
|
|
|
:css => '.active table tr td input[value="' + ticket1[:id] + '"]',
|
|
|
|
)
|
|
|
|
exists_not(
|
|
|
|
:css => '.active table tr td input[value="' + ticket2[:id] + '"]',
|
|
|
|
)
|
|
|
|
|
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
|
|
|
|
click( :css => '.active [data-type="settings"]' )
|
|
|
|
|
|
|
|
watch_for(
|
|
|
|
:css => '.modal h1',
|
|
|
|
:value => 'Edit',
|
|
|
|
)
|
|
|
|
check(
|
|
|
|
:css => '.modal input[value="number"]',
|
|
|
|
)
|
2015-03-01 23:16:36 +00:00
|
|
|
check(
|
|
|
|
:css => '.modal input[value="title"]',
|
|
|
|
)
|
|
|
|
check(
|
|
|
|
:css => '.modal input[value="customer"]',
|
|
|
|
)
|
|
|
|
check(
|
|
|
|
:css => '.modal input[value="group"]',
|
|
|
|
)
|
|
|
|
check(
|
|
|
|
:css => '.modal input[value="created_at"]',
|
|
|
|
)
|
2015-02-24 20:22:45 +00:00
|
|
|
check(
|
|
|
|
:css => '.modal input[value="article_count"]',
|
|
|
|
)
|
|
|
|
click( :css => '.modal .js-submit' )
|
2015-03-02 07:16:34 +00:00
|
|
|
sleep 4
|
2015-02-24 20:22:45 +00:00
|
|
|
|
|
|
|
# check if number and article count is shown
|
|
|
|
match(
|
|
|
|
:css => '.active table th:nth-child(3)',
|
|
|
|
:value => '#',
|
|
|
|
)
|
|
|
|
match(
|
2015-02-28 10:40:23 +00:00
|
|
|
:css => '.active table th:nth-child(8)',
|
2015-02-24 20:22:45 +00:00
|
|
|
:value => 'Article#',
|
|
|
|
)
|
|
|
|
|
|
|
|
# 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(
|
|
|
|
:css => '.active table th:nth-child(3)',
|
|
|
|
:value => '#',
|
|
|
|
)
|
|
|
|
match(
|
2015-02-28 10:40:23 +00:00
|
|
|
:css => '.active table th:nth-child(8)',
|
2015-02-24 20:22:45 +00:00
|
|
|
:value => 'Article#',
|
|
|
|
)
|
|
|
|
|
|
|
|
# disable number and article count
|
|
|
|
click( :css => '.active [data-type="settings"]' )
|
|
|
|
|
|
|
|
watch_for(
|
|
|
|
:css => '.modal h1',
|
|
|
|
:value => 'Edit',
|
|
|
|
)
|
|
|
|
uncheck(
|
|
|
|
:css => '.modal input[value="number"]',
|
|
|
|
)
|
|
|
|
uncheck(
|
|
|
|
:css => '.modal input[value="article_count"]',
|
|
|
|
)
|
|
|
|
click( :css => '.modal .js-submit' )
|
2015-03-02 07:16:34 +00:00
|
|
|
sleep 4
|
2015-02-24 20:22:45 +00:00
|
|
|
|
|
|
|
# check if number and article count is gone
|
|
|
|
match_not(
|
|
|
|
:css => '.active table th:nth-child(3)',
|
|
|
|
:value => '#',
|
|
|
|
)
|
|
|
|
exists_not(
|
2015-02-28 10:40:23 +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(
|
|
|
|
:data => {
|
2015-02-22 12:28:34 +00:00
|
|
|
:customer => 'nico*',
|
|
|
|
:group => 'Users',
|
2015-03-01 23:16:36 +00:00
|
|
|
:title => 'overview count test #3',
|
|
|
|
:body => 'overview count test #3',
|
2015-02-22 12:28:34 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
sleep 8
|
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()
|
|
|
|
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-02-24 20:22:45 +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-02-24 20:22:45 +00:00
|
|
|
:data => {
|
2015-02-22 12:28:34 +00:00
|
|
|
:state => 'closed',
|
|
|
|
}
|
|
|
|
)
|
|
|
|
sleep 8
|
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()
|
|
|
|
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-02-22 12:28:34 +00:00
|
|
|
end
|