2013-06-08 22:35:18 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class TaskbarTaskTest < TestCase
|
|
|
|
def test_persistant_task_a
|
2015-02-22 22:20:05 +00:00
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
|
|
|
:username => 'agent1@example.com',
|
|
|
|
:password => 'test',
|
|
|
|
:url => browser_url,
|
|
|
|
)
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
# persistant task
|
|
|
|
click( :css => 'a[href="#new"]' )
|
|
|
|
click( :css => 'a[href="#ticket/create"]' )
|
|
|
|
set(
|
|
|
|
:css => '.active .newTicket input[name="title"]',
|
|
|
|
:value => 'some test AAA',
|
|
|
|
)
|
|
|
|
sleep 10
|
2013-06-08 22:35:18 +00:00
|
|
|
end
|
|
|
|
def test_persistant_task_b
|
2015-02-22 22:20:05 +00:00
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
|
|
|
:username => 'agent1@example.com',
|
|
|
|
:password => 'test',
|
|
|
|
:url => browser_url,
|
|
|
|
)
|
|
|
|
sleep 3
|
|
|
|
|
|
|
|
# check if task still exists
|
|
|
|
click( :css => '.task' )
|
|
|
|
|
|
|
|
match(
|
|
|
|
:css => '.active .newTicket input[name="title"]',
|
|
|
|
:value => 'some test AAA',
|
|
|
|
)
|
|
|
|
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
exists_not( :css => '.active .newTicket input[name="title"]' )
|
2013-06-08 22:35:18 +00:00
|
|
|
end
|
2013-06-25 12:46:19 +00:00
|
|
|
def test_persistant_task_with_relogin
|
2015-02-22 22:20:05 +00:00
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
|
|
|
:username => 'agent1@example.com',
|
|
|
|
:password => 'test',
|
|
|
|
:url => browser_url,
|
|
|
|
)
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
click( :css => 'a[href="#new"]' )
|
|
|
|
click( :css => 'a[href="#ticket/create"]' )
|
|
|
|
set(
|
|
|
|
:css => '.active .newTicket input[name="title"]',
|
|
|
|
:value => 'INBOUND TEST#1',
|
|
|
|
)
|
|
|
|
set(
|
|
|
|
:css => '.active .newTicket [data-name="body"]',
|
|
|
|
:value => 'INBOUND BODY TEST#1',
|
|
|
|
)
|
|
|
|
|
|
|
|
click( :css => 'a[href="#new"]' )
|
|
|
|
click( :css => 'a[href="#ticket/create"]' )
|
|
|
|
set(
|
|
|
|
:css => '.active .newTicket input[name="title"]',
|
|
|
|
:value => 'OUTBOUND TEST#1',
|
|
|
|
)
|
|
|
|
set(
|
|
|
|
:css => '.active .newTicket [data-name="body"]',
|
|
|
|
:value => 'OUTBOUND BODY TEST#1',
|
|
|
|
)
|
|
|
|
sleep 10
|
|
|
|
|
|
|
|
logout()
|
|
|
|
sleep 4
|
|
|
|
|
|
|
|
# relogin with master - task are not viewable
|
|
|
|
login(
|
|
|
|
:username => 'master@example.com',
|
|
|
|
:password => 'test',
|
|
|
|
:url => browser_url,
|
|
|
|
)
|
|
|
|
sleep 3
|
|
|
|
|
|
|
|
match_not(
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'INBOUND TEST#1',
|
|
|
|
)
|
|
|
|
match_not(
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'OUTBOUND TEST#1',
|
|
|
|
)
|
|
|
|
logout()
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
match_not(
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'INBOUND TEST#1',
|
|
|
|
)
|
|
|
|
match_not(
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'OUTBOUND TEST#1',
|
|
|
|
)
|
|
|
|
|
|
|
|
# relogin with agent - task are viewable
|
|
|
|
login(
|
|
|
|
:username => 'agent1@example.com',
|
|
|
|
:password => 'test',
|
|
|
|
:url => browser_url,
|
|
|
|
)
|
|
|
|
sleep 3
|
|
|
|
|
|
|
|
match(
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'INBOUND TEST#1',
|
|
|
|
)
|
|
|
|
match(
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'OUTBOUND TEST#1',
|
|
|
|
)
|
2013-06-25 12:46:19 +00:00
|
|
|
end
|
2015-02-22 22:20:05 +00:00
|
|
|
end
|