2013-06-07 22:31:41 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
require 'browser_test_helper'
|
|
|
|
|
2013-06-08 22:35:18 +00:00
|
|
|
class TaskbarSessionTest < TestCase
|
2013-06-07 22:31:41 +00:00
|
|
|
def test_current_session_a_same_agent
|
|
|
|
tests = [
|
|
|
|
{
|
|
|
|
:name => 'start',
|
|
|
|
:instance1 => browser_instance,
|
|
|
|
:instance2 => browser_instance,
|
2013-06-10 20:19:11 +00:00
|
|
|
:instance1_username => 'agent1@example.com',
|
2013-06-07 22:31:41 +00:00
|
|
|
:instance1_password => 'test',
|
2013-06-10 20:19:11 +00:00
|
|
|
:instance2_username => 'agent1@example.com',
|
2013-06-07 22:31:41 +00:00
|
|
|
:instance2_password => 'test',
|
|
|
|
:url => browser_url,
|
|
|
|
:action => [
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
2013-07-24 18:09:20 +00:00
|
|
|
:value => 12,
|
2013-06-07 22:31:41 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
:where => :instance1,
|
|
|
|
:execute => 'match',
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'Reload application',
|
|
|
|
:match_result => true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:where => :instance2,
|
|
|
|
:execute => 'match',
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'Reload application',
|
|
|
|
:match_result => false,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
]
|
|
|
|
browser_double_test(tests)
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_current_session_b_different_agent
|
|
|
|
tests = [
|
|
|
|
{
|
|
|
|
:name => 'start',
|
|
|
|
:instance1 => browser_instance,
|
|
|
|
:instance2 => browser_instance,
|
|
|
|
:instance1_username => 'master@example.com',
|
|
|
|
:instance1_password => 'test',
|
|
|
|
:instance2_username => 'agent1@example.com',
|
|
|
|
:instance2_password => 'test',
|
|
|
|
:url => browser_url,
|
|
|
|
:action => [
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
2013-07-24 18:09:20 +00:00
|
|
|
:value => 12,
|
2013-06-07 22:31:41 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
:where => :instance1,
|
|
|
|
:execute => 'match',
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'Reload application',
|
|
|
|
:match_result => false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:where => :instance2,
|
|
|
|
:execute => 'match',
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'Reload application',
|
|
|
|
:match_result => false,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
]
|
|
|
|
browser_double_test(tests)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|