2013-02-22 10:36:00 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
require 'browser_test_helper'
|
|
|
|
|
2013-02-23 22:54:48 +00:00
|
|
|
class AaaGettingStartedTest < TestCase
|
|
|
|
def test_getting_started
|
2013-02-22 10:36:00 +00:00
|
|
|
tests = [
|
|
|
|
{
|
|
|
|
:name => 'start',
|
2013-02-23 22:54:48 +00:00
|
|
|
:instance => browser_instance,
|
2013-04-21 23:03:19 +00:00
|
|
|
:url => browser_url + '/',
|
2013-02-22 10:36:00 +00:00
|
|
|
:action => [
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
2013-02-23 22:54:48 +00:00
|
|
|
:value => 1,
|
2013-02-22 10:36:00 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'check',
|
|
|
|
:css => '#form-master',
|
|
|
|
:result => true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2013-04-21 23:03:19 +00:00
|
|
|
:name => 'getting started - master agent',
|
2013-02-22 10:36:00 +00:00
|
|
|
:action => [
|
|
|
|
{
|
|
|
|
:execute => 'set',
|
2013-04-21 23:03:19 +00:00
|
|
|
:css => '#form-master input[name="firstname"]',
|
2013-02-22 10:36:00 +00:00
|
|
|
:value => 'Test Master',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'set',
|
2013-04-21 23:03:19 +00:00
|
|
|
:css => '#form-master input[name="lastname"]',
|
2013-02-22 10:36:00 +00:00
|
|
|
:value => 'Agent',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'set',
|
2013-04-21 23:03:19 +00:00
|
|
|
:css => '#form-master input[name="email"]',
|
2013-02-22 10:36:00 +00:00
|
|
|
:value => 'master@example.com',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'set',
|
2013-04-21 23:03:19 +00:00
|
|
|
:css => '#form-master input[name="password"]',
|
2013-02-22 10:36:00 +00:00
|
|
|
:value => 'test1234äöüß',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'set',
|
2013-04-21 23:03:19 +00:00
|
|
|
:css => '#form-master input[name="password_confirm"]',
|
2013-02-22 10:36:00 +00:00
|
|
|
:value => 'test1234äöüß',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'click',
|
|
|
|
:css => '#form-master button[type="submit"]',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
2013-02-27 00:11:00 +00:00
|
|
|
:value => 4,
|
2013-02-22 10:36:00 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'check',
|
|
|
|
:css => '#login',
|
|
|
|
:result => false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'check',
|
|
|
|
:element => :url,
|
|
|
|
:result => '#getting_started',
|
|
|
|
},
|
2013-04-21 23:03:19 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
# create agent1
|
|
|
|
{
|
|
|
|
:name => 'getting started - agent 1',
|
|
|
|
:action => [
|
|
|
|
|
|
|
|
{
|
|
|
|
:execute => 'match',
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'Invite Agents',
|
|
|
|
:match_result => true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
|
|
|
:value => 4,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'set',
|
|
|
|
:css => '#form-agent input[name="firstname"]',
|
|
|
|
:value => 'Agent 1',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'set',
|
|
|
|
:css => '#form-agent input[name="lastname"]',
|
|
|
|
:value => 'Test',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'set',
|
|
|
|
:css => '#form-agent input[name="email"]',
|
|
|
|
:value => 'agent1@example.com',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'click',
|
|
|
|
:css => '#form-agent input[name="group_ids"][value="1"]',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'click',
|
|
|
|
:css => '#form-agent button[type="submit"]',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'check',
|
|
|
|
:element => :url,
|
|
|
|
:result => '#getting_started',
|
|
|
|
},
|
2013-07-15 10:22:02 +00:00
|
|
|
{
|
|
|
|
:execute => 'wait',
|
|
|
|
:value => 2,
|
|
|
|
},
|
2013-02-22 10:36:00 +00:00
|
|
|
|
|
|
|
# check action
|
2013-04-21 23:03:19 +00:00
|
|
|
{
|
|
|
|
:execute => 'match',
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'Invitation sent',
|
|
|
|
:match_result => true,
|
|
|
|
},
|
2013-02-22 10:36:00 +00:00
|
|
|
{
|
|
|
|
:execute => 'match',
|
|
|
|
:css => 'body',
|
|
|
|
:value => 'Invite Agents',
|
|
|
|
:match_result => true,
|
|
|
|
},
|
2013-04-21 23:03:19 +00:00
|
|
|
|
2013-02-22 10:36:00 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
]
|
|
|
|
browser_single_test(tests)
|
|
|
|
end
|
|
|
|
end
|