trabajo-afectivo/test/browser/agent_ticket_actions_level1_test.rb

191 lines
5.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_create
2013-04-23 18:36:09 +00:00
tests = [
{
: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',
2013-06-10 09:46:07 +00:00
:css => '.active div.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',
2013-09-18 18:45:32 +00:00
:css => '.active .ticket_info h3',
:value => '^#(.*)$',
2013-04-23 18:36:09 +00:00
:no_quote => true,
:match_result => true,
},
# update ticket
2013-05-31 11:34:11 +00:00
{
:execute => 'select',
2013-06-10 09:46:07 +00:00
:css => '.active select[name="ticket_article_type_id"]',
2013-05-31 11:34:11 +00:00
:value => 'note',
},
2013-04-23 18:36:09 +00:00
{
:execute => 'check',
2013-06-10 09:46:07 +00:00
:css => '.active textarea[name="body"]',
2013-04-23 18:36:09 +00:00
:result => true,
},
{
:execute => 'set',
2013-06-10 09:46:07 +00:00
:css => '.active textarea[name="body"]',
2013-04-23 18:36:09 +00:00
:value => 'some body 1234 äöüß',
},
{
:execute => 'click',
2013-08-06 20:08:32 +00:00
:css => '.active button.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',
:area => 'body',
:value => 'some body 1234 äöüß',
2013-04-23 18:36:09 +00:00
},
{
:execute => 'click',
:css => '#task [data-type="close"]',
},
],
},
{
: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',
2013-04-23 18:36:09 +00:00
},
# check ticket
{
:execute => 'match',
:css => '.content_permanent.active',
2013-04-23 18:36:09 +00:00
:value => 'some body 123äöü 222',
:match_result => true,
},
# update ticket
2013-05-31 11:34:11 +00:00
{
:execute => 'select',
:css => '.content_permanent.active select[name="ticket_article_type_id"]',
2013-05-31 11:34:11 +00:00
:value => 'note',
},
2013-04-23 18:36:09 +00:00
{
:execute => 'check',
:css => '.content_permanent.active textarea[name="body"]',
2013-04-23 18:36:09 +00:00
:result => true,
},
{
:execute => 'set',
:css => '.content_permanent.active textarea[name="body"]',
2013-04-23 18:36:09 +00:00
:value => 'some body 1234 äöüß 222',
},
{
:execute => 'click',
2013-08-06 20:08:32 +00:00
:css => '.content_permanent.active button.submit',
2013-04-23 18:36:09 +00:00
},
{
:execute => 'wait',
:value => 5,
2013-04-23 18:36:09 +00:00
},
{
:execute => 'match',
:css => '.content_permanent.active .ticket-answer',
2013-04-23 18:36:09 +00:00
:value => 'some body 1234 äöüß 222',
:match_result => true,
},
# check if task is shown
{
:execute => 'match',
:css => 'body',
:value => 'test to merge',
:match_result => true,
},
],
},
{
:name => 'agent ticket merge',
:action => [
2013-08-06 20:08:32 +00:00
{
:execute => 'click',
:css => '.active .action',
},
2013-04-23 18:36:09 +00:00
{
:execute => 'click',
2013-06-10 09:46:07 +00:00
:css => '.active a[data-type="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
},
# check if megred to ticket is shown now
{
:execute => 'match',
2013-09-18 18:45:32 +00:00
:css => '.active .ticket_info h3',
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
{
:execute => 'click',
:css => '#task [data-type="close"]',
},
2013-04-23 18:36:09 +00:00
],
},
]
browser_signle_test_with_login(tests, { :username => 'agent1@example.com' })
end
end