2013-06-08 22:35:18 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class TaskbarTaskTest < TestCase
|
|
|
|
def test_persistant_task_a
|
|
|
|
tests = [
|
|
|
|
{
|
|
|
|
:name => 'persistant task',
|
|
|
|
:action => [
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
|
|
|
:value => 2,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'close_all_tasks',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
|
|
|
:value => 1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'click',
|
|
|
|
:css => 'a[href="#new"]',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'click',
|
2014-09-15 09:06:13 +00:00
|
|
|
:css => 'a[href="#ticket/create"]',
|
2013-06-08 22:35:18 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
|
|
|
:value => 3,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'check',
|
2014-09-09 23:42:20 +00:00
|
|
|
:css => '.active .ticket-create',
|
2013-06-08 22:35:18 +00:00
|
|
|
:result => true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'set',
|
2014-09-09 23:42:20 +00:00
|
|
|
:css => '.active .ticket-create input[name="title"]',
|
2013-06-08 22:35:18 +00:00
|
|
|
:value => 'some test AAA',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
2013-07-24 18:09:20 +00:00
|
|
|
:value => 12,
|
2013-06-08 22:35:18 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
]
|
|
|
|
browser_signle_test_with_login(tests, { :username => 'agent1@example.com' })
|
|
|
|
end
|
|
|
|
def test_persistant_task_b
|
|
|
|
tests = [
|
|
|
|
{
|
|
|
|
:name => 'persistant task',
|
|
|
|
:action => [
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
|
|
|
:value => 4,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'click',
|
|
|
|
:css => '.task',
|
|
|
|
},
|
2013-07-14 14:01:58 +00:00
|
|
|
{
|
|
|
|
:execute => 'wait',
|
|
|
|
:value => 1,
|
|
|
|
},
|
2013-06-08 22:35:18 +00:00
|
|
|
{
|
|
|
|
:execute => 'match',
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'some test AAA',
|
|
|
|
:match_result => true,
|
|
|
|
},
|
|
|
|
{
|
2014-09-15 09:06:13 +00:00
|
|
|
:execute => 'close_all_tasks',
|
2013-06-08 22:35:18 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'match',
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'some test AAA',
|
|
|
|
:match_result => false,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
]
|
|
|
|
browser_signle_test_with_login(tests, { :username => 'agent1@example.com' })
|
|
|
|
end
|
2013-06-25 12:46:19 +00:00
|
|
|
def test_persistant_task_with_relogin
|
|
|
|
tests = [
|
|
|
|
{
|
2013-07-17 15:30:54 +00:00
|
|
|
:name => 'agent1 - create persistant task',
|
2013-06-25 12:46:19 +00:00
|
|
|
:action => [
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
|
|
|
:value => 2,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'close_all_tasks',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'click',
|
|
|
|
:css => 'a[href="#new"]',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'click',
|
2014-09-15 09:06:13 +00:00
|
|
|
:css => 'a[href="#ticket/create"]',
|
2013-06-25 12:46:19 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
2013-07-24 20:17:26 +00:00
|
|
|
:value => 2,
|
2013-06-25 12:46:19 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'set',
|
2014-09-09 23:42:20 +00:00
|
|
|
:css => '.active .ticket-create input[name="title"]',
|
2013-06-25 12:46:19 +00:00
|
|
|
:value => 'INBOUND TEST#1',
|
|
|
|
},
|
2013-07-24 20:17:26 +00:00
|
|
|
{
|
|
|
|
:execute => 'wait',
|
2013-07-25 09:11:20 +00:00
|
|
|
:value => 4,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'set',
|
2014-09-09 23:42:20 +00:00
|
|
|
:css => '.active .ticket-create textarea[name="body"]',
|
2013-07-25 09:11:20 +00:00
|
|
|
:value => 'INBOUND BODY TEST#1',
|
2013-07-24 20:17:26 +00:00
|
|
|
},
|
2013-06-25 12:46:19 +00:00
|
|
|
{
|
|
|
|
:execute => 'click',
|
|
|
|
:css => 'a[href="#new"]',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'click',
|
2014-09-15 09:06:13 +00:00
|
|
|
:css => 'a[href="#ticket/create"]',
|
2013-06-25 12:46:19 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
2013-07-24 20:17:26 +00:00
|
|
|
:value => 2,
|
2013-06-25 12:46:19 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'set',
|
2014-09-09 23:42:20 +00:00
|
|
|
:css => '.active .ticket-create input[name="title"]',
|
2013-06-25 12:46:19 +00:00
|
|
|
:value => 'OUTBOUND TEST#1',
|
|
|
|
},
|
2013-07-25 09:11:20 +00:00
|
|
|
{
|
|
|
|
:execute => 'wait',
|
|
|
|
:value => 1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'set',
|
2014-09-09 23:42:20 +00:00
|
|
|
:css => '.active .ticket-create textarea[name="body"]',
|
2013-07-25 09:11:20 +00:00
|
|
|
:value => 'OUTBOUND BODY TEST#1',
|
|
|
|
},
|
2013-06-25 12:46:19 +00:00
|
|
|
{
|
|
|
|
:execute => 'wait',
|
2013-07-24 18:09:20 +00:00
|
|
|
:value => 12,
|
2013-06-25 12:46:19 +00:00
|
|
|
},
|
2013-07-17 15:30:54 +00:00
|
|
|
{
|
2013-07-26 07:25:12 +00:00
|
|
|
:execute => 'logout',
|
2013-06-25 12:46:19 +00:00
|
|
|
},
|
2013-07-17 15:30:54 +00:00
|
|
|
{
|
|
|
|
:execute => 'check',
|
|
|
|
:css => '#login',
|
|
|
|
:result => true,
|
|
|
|
},
|
2013-06-25 12:46:19 +00:00
|
|
|
{
|
|
|
|
:execute => 'wait',
|
2013-07-17 15:30:54 +00:00
|
|
|
:value => 10,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:name => 'relogin with master - task are not viewable',
|
|
|
|
:action => [
|
|
|
|
{
|
2013-07-26 07:25:12 +00:00
|
|
|
:execute => 'login',
|
|
|
|
:username => 'master@example.com',
|
|
|
|
:password => 'test',
|
2013-07-17 15:30:54 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
|
|
|
:value => 6,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'match',
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'INBOUND TEST#1',
|
|
|
|
:match_result => false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'match',
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'OUTBOUND TEST#1',
|
|
|
|
:match_result => false,
|
|
|
|
},
|
|
|
|
{
|
2013-07-26 07:25:12 +00:00
|
|
|
:execute => 'logout',
|
2013-06-25 12:46:19 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'check',
|
|
|
|
:css => '#login',
|
|
|
|
:result => true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'match',
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'INBOUND TEST#1',
|
|
|
|
:match_result => false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'match',
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'OUTBOUND TEST#1',
|
|
|
|
:match_result => false,
|
|
|
|
},
|
2013-07-17 15:30:54 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:name => 'relogin with agent - task are viewable',
|
|
|
|
:action => [
|
2013-06-25 12:46:19 +00:00
|
|
|
{
|
2013-07-26 07:25:12 +00:00
|
|
|
:execute => 'login',
|
|
|
|
:username => 'agent1@example.com',
|
|
|
|
:password => 'test',
|
2013-06-25 12:46:19 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
2013-07-26 07:25:12 +00:00
|
|
|
:value => 3,
|
2013-06-25 12:46:19 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'match',
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'INBOUND TEST#1',
|
|
|
|
:match_result => true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'match',
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'OUTBOUND TEST#1',
|
|
|
|
:match_result => true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
]
|
|
|
|
browser_signle_test_with_login(tests, { :username => 'agent1@example.com' })
|
|
|
|
end
|
2013-06-08 22:35:18 +00:00
|
|
|
end
|