diff --git a/app/assets/javascripts/app/controllers/getting_started.js.coffee b/app/assets/javascripts/app/controllers/getting_started.js.coffee index 0a70cf205..650846215 100644 --- a/app/assets/javascripts/app/controllers/getting_started.js.coffee +++ b/app/assets/javascripts/app/controllers/getting_started.js.coffee @@ -103,7 +103,7 @@ class Admin extends App.ControllerContent @html App.view('getting_started/admin')() new App.ControllerForm( - el: @$('.js-admin') + el: @$('.js-admin-form') model: App.User screen: 'signup' autofocus: true @@ -623,7 +623,7 @@ class Agent extends App.ControllerContent @html App.view('getting_started/agent')() new App.ControllerForm( - el: @$('.js-agent') + el: @$('.js-agent-form') model: App.User screen: 'invite_agent' autofocus: true diff --git a/app/assets/javascripts/app/views/getting_started/admin.jst.eco b/app/assets/javascripts/app/views/getting_started/admin.jst.eco index 246956835..dd6b52e70 100644 --- a/app/assets/javascripts/app/views/getting_started/admin.jst.eco +++ b/app/assets/javascripts/app/views/getting_started/admin.jst.eco @@ -1,9 +1,9 @@
-
+

<%- @T('Administrator Account') %>

-
+
<%- @T('Go Back') %> diff --git a/app/assets/javascripts/app/views/getting_started/agent.jst.eco b/app/assets/javascripts/app/views/getting_started/agent.jst.eco index 05c62a866..e0f09aff7 100644 --- a/app/assets/javascripts/app/views/getting_started/agent.jst.eco +++ b/app/assets/javascripts/app/views/getting_started/agent.jst.eco @@ -1,9 +1,9 @@
- +

<%- @T('Invite Colleagues') %>

-
+
<%- @T( 'Continue' ) %> diff --git a/app/assets/javascripts/app/views/getting_started/base.jst.eco b/app/assets/javascripts/app/views/getting_started/base.jst.eco index 8338e834e..00b090368 100644 --- a/app/assets/javascripts/app/views/getting_started/base.jst.eco +++ b/app/assets/javascripts/app/views/getting_started/base.jst.eco @@ -1,6 +1,6 @@
- +

<%- @T('Organization') %>

diff --git a/app/assets/javascripts/app/views/getting_started/channel.jst.eco b/app/assets/javascripts/app/views/getting_started/channel.jst.eco index 415307a9b..d246149d6 100644 --- a/app/assets/javascripts/app/views/getting_started/channel.jst.eco +++ b/app/assets/javascripts/app/views/getting_started/channel.jst.eco @@ -1,6 +1,6 @@
- +

<%- @T('Connect Channels') %>

diff --git a/app/assets/javascripts/app/views/getting_started/index.jst.eco b/app/assets/javascripts/app/views/getting_started/index.jst.eco index c7ca42bae..617c6754d 100644 --- a/app/assets/javascripts/app/views/getting_started/index.jst.eco +++ b/app/assets/javascripts/app/views/getting_started/index.jst.eco @@ -1,6 +1,6 @@
-
+
<%- @T('Setup new System') %> diff --git a/test/browser/aaa_getting_started_test.rb b/test/browser/aaa_getting_started_test.rb index f44281558..7c2d0e9fb 100644 --- a/test/browser/aaa_getting_started_test.rb +++ b/test/browser/aaa_getting_started_test.rb @@ -11,7 +11,7 @@ class AaaGettingStartedTest < TestCase :action => [ { :execute => 'check', - :css => '#form-master', + :css => '.setup.wizard', :result => true, }, ], @@ -19,34 +19,39 @@ class AaaGettingStartedTest < TestCase { :name => 'getting started - master agent', :action => [ + { + :execute => 'click', + :css => '.js-start .btn--primary', + }, + { :execute => 'set', - :css => '#form-master input[name="firstname"]', + :css => '.js-admin input[name="firstname"]', :value => 'Test Master', }, { :execute => 'set', - :css => '#form-master input[name="lastname"]', + :css => '.js-admin input[name="lastname"]', :value => 'Agent', }, { :execute => 'set', - :css => '#form-master input[name="email"]', + :css => '.js-admin input[name="email"]', :value => 'master@example.com', }, { :execute => 'set', - :css => '#form-master input[name="password"]', + :css => '.js-admin input[name="password"]', :value => 'test1234äöüß', }, { :execute => 'set', - :css => '#form-master input[name="password_confirm"]', + :css => '.js-admin input[name="password_confirm"]', :value => 'test1234äöüß', }, { :execute => 'click', - :css => '#form-master button[type="submit"]', + :css => '.js-admin .btn--success', }, { :execute => 'wait', @@ -60,38 +65,145 @@ class AaaGettingStartedTest < TestCase ], }, - # create agent1 + # 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 { :name => 'getting started - agent 1', :action => [ { :execute => 'match', :css => 'body', - :value => 'Invite Agents', + :value => 'Invite', :match_result => true, }, { :execute => 'set', - :css => '#form-agent input[name="firstname"]', + :css => '.js-agent input[name="firstname"]', :value => 'Agent 1', }, { :execute => 'set', - :css => '#form-agent input[name="lastname"]', + :css => '.js-agent input[name="lastname"]', :value => 'Test', }, { :execute => 'set', - :css => '#form-agent input[name="email"]', + :css => '.js-agent input[name="email"]', :value => 'agent1@example.com', }, { :execute => 'click', - :css => '#form-agent input[name="group_ids"][value="1"]', + :css => '.js-agent input[name="group_ids"][value="1"]', }, { :execute => 'click', - :css => '#form-agent button[type="submit"]', + :css => '.js-agent .btn--success', }, { :execute => 'watch_for', @@ -101,15 +213,22 @@ class AaaGettingStartedTest < TestCase { :execute => 'check', :element => :url, - :result => '#getting_started', + :result => '#getting_started/agents', }, { - :execute => 'match', - :css => 'body', - :value => 'Invite Agents', - :match_result => true, + :execute => 'click', + :css => '.js-agent .btn--primary', + }, + { + :execute => 'watch_for', + :area => 'body', + :value => 'Activity Stream', + }, + { + :execute => 'check', + :element => :url, + :result => '#dashboard', }, - ], }, ] diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index 317ac127c..076d9ef1f 100644 --- a/test/browser_test_helper.rb +++ b/test/browser_test_helper.rb @@ -253,11 +253,14 @@ class TestCase < Test::Unit::TestCase text = '' (1..36).each { |loop| element = instance.find_element( { :css => action[:area] } ) - text = element.text - if text =~ /#{action[:value]}/i - assert( true, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" ) - sleep 0.4 - return + if element.displayed? + text = element.text + puts "T: #{text}" + if text =~ /#{action[:value]}/i + assert( true, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" ) + sleep 0.4 + return + end end sleep 0.33 }