2013-04-23 18:36:09 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
require 'browser_test_helper'
|
|
|
|
|
2013-06-18 21:36:07 +00:00
|
|
|
class AgentTicketActionLevel1Test < TestCase
|
2015-01-28 22:47:05 +00:00
|
|
|
def test_agent_ticket_merge_closed_tab
|
2013-07-25 09:11:20 +00:00
|
|
|
|
2015-02-23 15:35:48 +00:00
|
|
|
# merge ticket with closed tab
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
|
|
|
:username => 'agent1@example.com',
|
|
|
|
:password => 'test',
|
|
|
|
:url => browser_url,
|
|
|
|
)
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
# create new ticket
|
|
|
|
ticket1 = ticket_create(
|
|
|
|
:data => {
|
|
|
|
:customer => 'nico',
|
|
|
|
:group => 'Users',
|
|
|
|
:title => 'some subject 123äöü - with closed tab',
|
|
|
|
:body => 'some body 123äöü - with closed tab',
|
2013-04-23 18:36:09 +00:00
|
|
|
},
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
sleep 1
|
2013-04-23 18:36:09 +00:00
|
|
|
|
2015-02-23 15:35:48 +00:00
|
|
|
# update ticket
|
|
|
|
ticket_update(
|
|
|
|
:data => {
|
|
|
|
:body => 'some body 1234 äöüß - with closed tab',
|
2013-04-23 18:36:09 +00:00
|
|
|
},
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
2013-04-23 18:36:09 +00:00
|
|
|
|
2015-02-23 15:35:48 +00:00
|
|
|
tasks_close_all()
|
2013-05-31 23:52:15 +00:00
|
|
|
|
2015-02-23 15:35:48 +00:00
|
|
|
# create second ticket to merge
|
|
|
|
ticket2 = ticket_create(
|
|
|
|
:data => {
|
|
|
|
:customer => 'nico',
|
|
|
|
:group => 'Users',
|
|
|
|
:title => 'test to merge - with closed tab',
|
|
|
|
:body => 'some body 123äöü 222 - test to merge - with closed tab',
|
2013-04-23 18:36:09 +00:00
|
|
|
},
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
2015-01-28 22:47:05 +00:00
|
|
|
|
2015-02-23 15:35:48 +00:00
|
|
|
ticket_update(
|
|
|
|
:data => {
|
|
|
|
:body => 'some body 1234 äöüß 333 - with closed tab',
|
2015-01-28 22:47:05 +00:00
|
|
|
},
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check if task is shown
|
|
|
|
match(
|
|
|
|
:css => '.tasks',
|
|
|
|
:value => 'test to merge - with closed tab',
|
|
|
|
)
|
|
|
|
|
|
|
|
# merge tickets
|
|
|
|
click( :css => '.active div[data-tab="ticket"] .js-actions .select-arrow' )
|
|
|
|
click( :css => '.active div[data-tab="ticket"] .js-actions a[data-type="ticket-merge"]' )
|
|
|
|
watch_for(
|
|
|
|
:css => '.modal',
|
|
|
|
:value => 'merge',
|
|
|
|
)
|
|
|
|
|
|
|
|
set(
|
|
|
|
:css => '.modal input[name="master_ticket_number"]',
|
|
|
|
:value => ticket1[:number],
|
|
|
|
)
|
|
|
|
|
|
|
|
click( :css => '.modal button[type="submit"]' )
|
|
|
|
|
|
|
|
# check if merged to ticket is shown now
|
|
|
|
watch_for(
|
|
|
|
:css => '.active .page-header .ticket-number',
|
|
|
|
:value => ticket1[:number],
|
|
|
|
)
|
|
|
|
watch_for(
|
|
|
|
:css => '.active .ticket-article',
|
|
|
|
:value => 'test to merge - with closed tab',
|
|
|
|
)
|
|
|
|
|
|
|
|
# check if task is now gone
|
|
|
|
match_not(
|
|
|
|
:css => '.tasks',
|
|
|
|
:value => 'test to merge',
|
|
|
|
)
|
|
|
|
match(
|
|
|
|
:css => '.tasks',
|
|
|
|
:value => 'some subject 123äöü - with closed tab',
|
|
|
|
)
|
|
|
|
|
|
|
|
# close task/cleanup
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# merge ticket with open tabs
|
|
|
|
ticket3 = ticket_create(
|
|
|
|
:data => {
|
|
|
|
:customer => 'nico',
|
|
|
|
:group => 'Users',
|
|
|
|
:title => 'some subject 123äöü - with open tab',
|
|
|
|
:body => 'some body 123äöü - with open tab',
|
2015-01-28 22:47:05 +00:00
|
|
|
},
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
ticket4 = ticket_create(
|
|
|
|
:data => {
|
|
|
|
:customer => 'nico',
|
|
|
|
:group => 'Users',
|
|
|
|
:title => 'test to merge - with open tab',
|
|
|
|
:body => 'some body 123äöü 222 - test to merge - with open tab',
|
2015-01-28 22:47:05 +00:00
|
|
|
},
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# merge tickets
|
|
|
|
click( :css => '.active div[data-tab="ticket"] .js-actions .select-arrow' )
|
|
|
|
click( :css => '.active div[data-tab="ticket"] .js-actions a[data-type="ticket-merge"]' )
|
|
|
|
watch_for(
|
|
|
|
:css => '.modal',
|
|
|
|
:value => 'merge',
|
|
|
|
)
|
|
|
|
|
|
|
|
set(
|
|
|
|
:css => '.modal input[name="master_ticket_number"]',
|
|
|
|
:value => ticket3[:number],
|
|
|
|
)
|
|
|
|
click( :css => '.modal button[type="submit"]' )
|
|
|
|
|
|
|
|
# check if merged to ticket is shown now
|
|
|
|
watch_for(
|
|
|
|
:css => '.active .page-header .ticket-number',
|
|
|
|
:value => ticket3[:number],
|
|
|
|
)
|
|
|
|
watch_for(
|
|
|
|
:css => '.active .ticket-article',
|
|
|
|
:value => 'test to merge - with open tab',
|
|
|
|
)
|
|
|
|
|
|
|
|
# check if task is now gone
|
|
|
|
match_not(
|
|
|
|
:css => '.tasks',
|
|
|
|
:value => 'test to merge',
|
|
|
|
)
|
|
|
|
match(
|
|
|
|
:css => '.tasks',
|
|
|
|
:value => 'some subject 123äöü - with open tab',
|
|
|
|
)
|
|
|
|
|
2015-01-28 22:47:05 +00:00
|
|
|
end
|
|
|
|
end
|