trabajo-afectivo/test/browser/agent_ticket_actions_level1_test.rb

175 lines
4.7 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_create
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äöü',
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',
2013-04-23 18:36:09 +00:00
:value => 'some body 123äöü',
: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 äöüß',
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',
2013-08-27 21:05:33 +00:00
:value => 'some body 1234 äöüß',
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',
2014-10-03 22:39:54 +00:00
:body => 'some body 123äöü 222 - test to merge',
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',
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',
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',
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',
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
end