trabajo-afectivo/test/browser/aaa_getting_started_test.rb

238 lines
6.2 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',
2014-11-16 23:46:39 +00:00
:css => '.setup.wizard',
:result => true,
},
],
},
{
2013-04-21 23:03:19 +00:00
:name => 'getting started - master agent',
:action => [
2014-11-16 23:46:39 +00:00
{
:execute => 'click',
:css => '.js-start .btn--primary',
},
{
:execute => 'set',
2014-11-16 23:46:39 +00:00
:css => '.js-admin input[name="firstname"]',
:value => 'Test Master',
},
{
:execute => 'set',
2014-11-16 23:46:39 +00:00
:css => '.js-admin input[name="lastname"]',
:value => 'Agent',
},
{
:execute => 'set',
2014-11-16 23:46:39 +00:00
:css => '.js-admin input[name="email"]',
:value => 'master@example.com',
},
{
:execute => 'set',
2014-11-16 23:46:39 +00:00
:css => '.js-admin input[name="password"]',
:value => 'test1234äöüß',
},
{
:execute => 'set',
2014-11-16 23:46:39 +00:00
:css => '.js-admin input[name="password_confirm"]',
:value => 'test1234äöüß',
},
{
:execute => 'click',
2014-11-16 23:46:39 +00:00
:css => '.js-admin .btn--success',
},
{
: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
],
},
2014-11-16 23:46:39 +00:00
# set base
{
:name => 'getting started - base',
:action => [
{
:execute => 'match',
:css => '.js-base h2',
:value => 'Organization',
:match_result => true,
},
{
:execute => 'set',
:css => '.js-base input[name="organization"]',
:value => 'Some Organization',
},
{
:execute => 'set',
:css => '.js-base input[name="url"]',
:value => 'some host',
},
{
:execute => 'click',
:css => '.js-base .btn--primary',
},
{
:execute => 'watch_for',
:area => 'body',
:value => 'A URL looks like',
},
{
:execute => 'set',
:css => '.js-base input[name="url"]',
:value => 'http://localhost:3333',
},
{
:execute => 'click',
:css => '.js-base .btn--primary',
},
{
:execute => 'watch_for',
:area => 'body',
:value => 'channel',
},
{
:execute => 'check',
:element => :url,
:result => '#getting_started/channel',
},
],
},
# create email account
{
:name => 'getting started - base',
:action => [
{
:execute => 'match',
:css => '.js-channel h2',
:value => 'Connect Channels',
:match_result => true,
},
{
:execute => 'click',
:css => '.js-channel .email .provider_name',
},
{
:execute => 'set',
:css => '.js-intro input[name="realname"]',
:value => 'Some Realname',
},
{
:execute => 'set',
:css => '.js-intro input[name="email"]',
:value => 'otest01@znuny.com',
},
{
:execute => 'set',
:css => '.js-intro input[name="password"]',
:value => 'otest0142',
},
{
:execute => 'click',
:css => '.js-intro .btn--primary',
},
{
:execute => 'watch_for',
:area => 'body',
:value => 'testing',
},
{
:execute => 'watch_for',
:area => 'body',
:value => 'verify',
},
{
:execute => 'watch_for',
:area => 'body',
:value => 'invite',
},
{
:execute => 'check',
:element => :url,
:result => '#getting_started/agents',
},
],
},
# invite agent1
2013-04-21 23:03:19 +00:00
{
:name => 'getting started - agent 1',
:action => [
{
:execute => 'match',
:css => 'body',
2014-11-16 23:46:39 +00:00
:value => 'Invite',
2013-04-21 23:03:19 +00:00
:match_result => true,
},
{
:execute => 'set',
2014-11-16 23:46:39 +00:00
:css => '.js-agent input[name="firstname"]',
2013-04-21 23:03:19 +00:00
:value => 'Agent 1',
},
{
:execute => 'set',
2014-11-16 23:46:39 +00:00
:css => '.js-agent input[name="lastname"]',
2013-04-21 23:03:19 +00:00
:value => 'Test',
},
{
:execute => 'set',
2014-11-16 23:46:39 +00:00
:css => '.js-agent input[name="email"]',
2013-04-21 23:03:19 +00:00
:value => 'agent1@example.com',
},
{
:execute => 'click',
2014-11-16 23:46:39 +00:00
:css => '.js-agent input[name="group_ids"][value="1"]',
2013-04-21 23:03:19 +00:00
},
{
:execute => 'click',
2014-11-16 23:46:39 +00:00
:css => '.js-agent .btn--success',
2013-04-21 23:03:19 +00:00
},
{
2013-08-27 21:05:33 +00:00
:execute => 'watch_for',
:area => 'body',
:value => 'Invitation sent',
2013-04-21 23:03:19 +00:00
},
2013-08-27 21:26:43 +00:00
{
:execute => 'check',
:element => :url,
2014-11-16 23:46:39 +00:00
:result => '#getting_started/agents',
2013-08-27 21:26:43 +00:00
},
{
2014-11-16 23:46:39 +00:00
:execute => 'click',
:css => '.js-agent .btn--primary',
},
{
:execute => 'watch_for',
:area => 'body',
:value => 'Activity Stream',
},
{
:execute => 'check',
:element => :url,
:result => '#dashboard',
},
],
},
]
browser_single_test(tests)
end
end