123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- # encoding: utf-8
- require 'browser_test_helper'
- class AgentTicketOverviewLevel0Test < TestCase
- def test_i
- @browser = browser_instance
- login(
- username: 'master@example.com',
- password: 'test',
- url: browser_url,
- )
- tasks_close_all()
- # test bulk action
- # create new ticket
- ticket1 = ticket_create(
- data: {
- customer: 'nico*',
- group: 'Users',
- title: 'overview count test #1',
- body: 'overview count test #1',
- }
- )
- ticket2 = ticket_create(
- data: {
- customer: 'nico*',
- group: 'Users',
- title: 'overview count test #2',
- body: 'overview count test #2',
- }
- )
- sleep 6 # till overview is updated
- click( css: '#navigation li.overviews a' )
- click( css: '.content.active .sidebar a[href="#ticket/view/all_unassigned"]' )
- sleep 4 # till overview is rendered
- # select both via bulk action
- click(
- css: '.active table tr td input[value="' + ticket1[:id] + '"] + .icon-checkbox.icon-unchecked',
- fast: true,
- )
- click(
- css: '.active table tr td input[value="' + ticket2[:id] + '"] + .icon-checkbox.icon-unchecked',
- fast: true,
- )
- exists(
- css: '.active table tr td input[value="' + ticket1[:id] + '"][type="checkbox"]:checked',
- )
- exists(
- css: '.active table tr td input[value="' + ticket2[:id] + '"][type="checkbox"]: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',
- )
- sleep 6
- exists_not(
- css: '.active table tr td input[value="' + ticket1[:id] + '"]',
- )
- exists_not(
- css: '.active table tr td input[value="' + ticket2[:id] + '"]',
- )
- # remember current overview count
- overview_counter_before = overview_counter()
- # 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"]',
- )
- 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"]',
- )
- check(
- css: '.modal input[value="article_count"]',
- )
- click( css: '.modal .js-submit' )
- sleep 4
- # check if number and article count is shown
- match(
- css: '.active table th:nth-child(3)',
- value: '#',
- )
- match(
- css: '.active table th:nth-child(8)',
- value: 'Article#',
- )
- # reload browser
- reload()
- sleep 4
- # check if number and article count is shown
- match(
- css: '.active table th:nth-child(3)',
- value: '#',
- )
- match(
- css: '.active table th:nth-child(8)',
- 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' )
- sleep 4
- # check if number and article count is gone
- match_not(
- css: '.active table th:nth-child(3)',
- value: '#',
- )
- exists_not(
- css: '.active table th:nth-child(8)',
- )
- # create new ticket
- ticket3 = ticket_create(
- data: {
- customer: 'nico*',
- group: 'Users',
- title: 'overview count test #3',
- body: 'overview count test #3',
- }
- )
- sleep 8
- # 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'] )
- # open ticket by search
- ticket_open_by_search(
- number: ticket3[:number],
- )
- sleep 1
- # close ticket
- ticket_update(
- data: {
- state: 'closed',
- }
- )
- sleep 8
- # 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'] )
- # cleanup
- tasks_close_all()
- end
- end
|