trabajo-afectivo/test/browser/agent_ticket_actions_level1_test.rb

294 lines
8.1 KiB
Ruby
Raw Normal View History

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
def test_agent_ticket_merge_closed_tab
2013-04-23 18:36:09 +00:00
tests = [
{
2014-12-02 22:20:53 +00:00
:name => 'agent ticket create 1',
:action => [
2013-06-10 09:55:08 +00:00
{
:execute => 'close_all_tasks',
},
2013-07-25 09:11:20 +00:00
# create ticket
2013-04-23 18:36:09 +00:00
{
2013-07-25 09:11:20 +00:00
:execute => 'create_ticket',
:group => 'Users',
:subject => 'some subject 123äöü',
:body => 'some body 123äöü - with closed tab',
2013-04-23 18:36:09 +00:00
},
# check ticket
{
:execute => 'match',
2014-12-02 22:20:53 +00:00
:css => '.content.active .ticket-article',
:value => 'some body 123äöü - with closed tab',
2013-04-23 18:36:09 +00:00
:match_result => true,
},
# remember old ticket where we want to merge to
{
:execute => 'match',
2014-12-02 22:20:53 +00:00
:css => '.content.active .page-header .ticket-number',
2014-09-15 09:06:13 +00:00
:value => '^(.*)$',
2013-04-23 18:36:09 +00:00
:no_quote => true,
:match_result => true,
},
# update ticket
2014-10-03 22:39:54 +00:00
#{
# :execute => 'select',
# :css => '.active select[name="type_id"]',
# :value => 'note',
#},
2013-04-23 18:36:09 +00:00
{
2014-10-11 23:35:53 +00:00
:execute => 'set_ticket_attributes',
:body => 'some body 1234 äöüß - with closed tab',
2013-04-23 18:36:09 +00:00
},
{
:execute => 'click',
2014-10-11 23:35:53 +00:00
:css => '.content.active button.js-submit',
2013-04-23 18:36:09 +00:00
},
{
:execute => 'wait',
2013-08-27 21:05:33 +00:00
:value => 2,
2013-04-23 18:36:09 +00:00
},
{
2013-08-27 21:05:33 +00:00
:execute => 'watch_for',
2014-12-02 22:20:53 +00:00
:area => '.content.active .ticket-article',
:value => 'some body 1234 äöüß - with closed tab',
2013-04-23 18:36:09 +00:00
},
{
2014-10-03 22:39:54 +00:00
:execute => 'close_all_tasks',
2013-04-23 18:36:09 +00:00
},
],
},
{
2014-12-02 22:20:53 +00:00
:name => 'agent ticket create 2',
:action => [
2013-07-25 09:11:20 +00:00
# create ticket
2013-04-23 18:36:09 +00:00
{
2013-07-25 09:11:20 +00:00
:execute => 'create_ticket',
:group => 'Users',
:subject => 'test to merge',
:body => 'some body 123äöü 222 - test to merge - with closed tab',
2013-04-23 18:36:09 +00:00
},
# check ticket
{
2014-12-02 22:20:53 +00:00
:execute => 'watch_for',
:area => '.content.active .ticket-article',
:value => 'some body 123äöü 222 - test to merge - with closed tab',
2013-04-23 18:36:09 +00:00
},
# update ticket
2014-10-03 22:39:54 +00:00
#{
# :execute => 'select',
# :css => '.content_permanent.active select[name="type_id"]',
# :value => 'note',
#},
2013-04-23 18:36:09 +00:00
{
2014-10-11 23:35:53 +00:00
:execute => 'set_ticket_attributes',
:body => 'some body 1234 äöüß 333 - with closed tab',
2013-04-23 18:36:09 +00:00
},
{
:execute => 'click',
2014-10-11 23:35:53 +00:00
:css => '.content.active button.js-submit',
2013-04-23 18:36:09 +00:00
},
2014-12-09 19:10:38 +00:00
{
:execute => 'wait',
:value => 2,
},
2013-04-23 18:36:09 +00:00
{
2014-12-02 22:20:53 +00:00
:execute => 'watch_for',
:area => '.content.active .ticket-article',
:value => 'some body 1234 äöüß 333 - with closed tab',
2013-04-23 18:36:09 +00:00
},
# check if task is shown
{
:execute => 'match',
:css => 'body',
:value => 'test to merge',
:match_result => true,
},
],
},
{
2014-12-02 22:20:53 +00:00
:name => 'agent ticket merge',
:action => [
2013-08-06 20:08:32 +00:00
{
:execute => 'click',
2014-12-01 20:04:37 +00:00
:css => '.active div[data-tab="ticket"] .js-actions .select-arrow',
2013-08-06 20:08:32 +00:00
},
2013-04-23 18:36:09 +00:00
{
:execute => 'click',
2014-12-01 20:04:37 +00:00
:css => '.active div[data-tab="ticket"] .js-actions a[data-type="ticket-merge"]',
2013-04-23 18:36:09 +00:00
},
{
:execute => 'wait',
:value => 4,
},
{
:execute => 'set',
:css => '.modal input[name="master_ticket_number"]',
:value => '###stack###',
},
{
:execute => 'click',
:css => '.modal button[type="submit"]',
},
{
:execute => 'wait',
2013-04-24 07:16:51 +00:00
:value => 6,
2013-04-23 18:36:09 +00:00
},
2014-12-31 23:40:17 +00:00
# check if merged to ticket is shown now
2013-04-23 18:36:09 +00:00
{
:execute => 'match',
2014-10-03 22:39:54 +00:00
:css => '.active .page-header .ticket-number',
2013-04-23 18:36:09 +00:00
:value => '###stack###',
:match_result => true,
},
# check if task is now gone
{
:execute => 'match',
:css => 'body',
:value => 'test to merge - with closed tab',
2013-04-24 07:16:51 +00:00
:match_result => true,
2013-04-23 18:36:09 +00:00
},
2013-05-31 23:52:15 +00:00
# close task/cleanup
{
2014-10-03 22:39:54 +00:00
:execute => 'close_all_tasks',
2013-05-31 23:52:15 +00:00
},
2013-04-23 18:36:09 +00:00
],
},
]
browser_signle_test_with_login(tests, { :username => 'agent1@example.com' })
end
def test_agent_ticket_merge_open_tab
tests = [
{
:name => 'agent ticket create 1',
:action => [
{
:execute => 'close_all_tasks',
},
# create ticket
{
:execute => 'create_ticket',
:group => 'Users',
:subject => 'some subject 123äöü',
:body => 'some body 123äöü - with open tab',
},
# check ticket
{
:execute => 'match',
:css => '.content.active .ticket-article',
:value => 'some body 123äöü - with open tab',
:match_result => true,
},
# remember old ticket where we want to merge to
{
:execute => 'match',
:css => '.content.active .page-header .ticket-number',
:value => '^(.*)$',
:no_quote => true,
:match_result => true,
},
],
},
{
:name => 'agent ticket create 2',
:action => [
# create ticket
{
:execute => 'create_ticket',
:group => 'Users',
:subject => 'test to merge',
:body => 'some body 123äöü 222 - test to merge - with open tab',
},
# check ticket
{
:execute => 'watch_for',
:area => '.content.active .ticket-article',
:value => 'some body 123äöü 222 - test to merge - with open tab',
},
# check if task is shown
{
:execute => 'match',
:css => 'body',
:value => 'test to merge',
:match_result => true,
},
],
},
{
:name => 'agent ticket merge',
:action => [
{
:execute => 'click',
:css => '.active div[data-tab="ticket"] .js-actions .select-arrow',
},
{
:execute => 'click',
:css => '.active div[data-tab="ticket"] .js-actions a[data-type="ticket-merge"]',
},
{
:execute => 'wait',
:value => 4,
},
{
:execute => 'set',
:css => '.modal input[name="master_ticket_number"]',
:value => '###stack###',
},
{
:execute => 'click',
:css => '.modal button[type="submit"]',
},
{
:execute => 'wait',
:value => 6,
},
# check if merged to ticket is shown now
{
:execute => 'match',
:css => '.active .page-header .ticket-number',
:value => '###stack###',
:match_result => true,
},
# check if task is now gone
{
:execute => 'match',
:css => 'body',
:value => 'test to merge - with open tab',
:match_result => true,
},
# close task/cleanup
{
:execute => 'close_all_tasks',
},
],
},
]
browser_signle_test_with_login(tests, { :username => 'agent1@example.com' })
end
end