trabajo-afectivo/test/browser/aaa_getting_started_test.rb

119 lines
3.1 KiB
Ruby
Raw Normal View History

# encoding: utf-8
require 'browser_test_helper'
class AaaGettingStartedTest < TestCase
def test_getting_started
tests = [
{
:name => 'start',
:instance => browser_instance,
2013-04-21 23:03:19 +00:00
:url => browser_url + '/',
:action => [
{
:execute => 'check',
:css => '#form-master',
:result => true,
},
],
},
{
2013-04-21 23:03:19 +00:00
:name => 'getting started - master agent',
:action => [
{
:execute => 'set',
2013-04-21 23:03:19 +00:00
:css => '#form-master input[name="firstname"]',
:value => 'Test Master',
},
{
:execute => 'set',
2013-04-21 23:03:19 +00:00
:css => '#form-master input[name="lastname"]',
:value => 'Agent',
},
{
:execute => 'set',
2013-04-21 23:03:19 +00:00
:css => '#form-master input[name="email"]',
:value => 'master@example.com',
},
{
:execute => 'set',
2013-04-21 23:03:19 +00:00
:css => '#form-master input[name="password"]',
:value => 'test1234äöüß',
},
{
:execute => 'set',
2013-04-21 23:03:19 +00:00
:css => '#form-master input[name="password_confirm"]',
:value => 'test1234äöüß',
},
{
:execute => 'click',
:css => '#form-master button[type="submit"]',
},
{
:execute => 'wait',
2013-08-11 12:06:44 +00:00
:value => 3,
},
{
: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 => '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-08-27 21:05:33 +00:00
:execute => 'watch_for',
:area => 'body',
:value => 'Invitation sent',
2013-04-21 23:03:19 +00:00
},
{
:execute => 'match',
:css => 'body',
:value => 'Invite Agents',
:match_result => true,
},
2013-04-21 23:03:19 +00:00
],
},
]
browser_single_test(tests)
end
end