Some small setup improvements.
This commit is contained in:
parent
006e28d95b
commit
7e9f246ee7
7 changed files with 304 additions and 54 deletions
|
@ -221,6 +221,7 @@ class Base extends App.ControllerContent
|
||||||
url: url
|
url: url
|
||||||
organization: organization
|
organization: organization
|
||||||
)
|
)
|
||||||
|
@$("input, select").first().focus()
|
||||||
|
|
||||||
onLogoPick: (event) =>
|
onLogoPick: (event) =>
|
||||||
reader = new FileReader()
|
reader = new FileReader()
|
||||||
|
@ -352,6 +353,7 @@ class ChannelEmail extends App.ControllerContent
|
||||||
'submit .js-inbound': 'probeInbound'
|
'submit .js-inbound': 'probeInbound'
|
||||||
'change .js-outbound [name=adapter]': 'toggleOutboundAdapter'
|
'change .js-outbound [name=adapter]': 'toggleOutboundAdapter'
|
||||||
'submit .js-outbound': 'probleOutbound'
|
'submit .js-outbound': 'probleOutbound'
|
||||||
|
'click .js-back': 'goToSlide'
|
||||||
|
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
|
@ -397,6 +399,7 @@ class ChannelEmail extends App.ControllerContent
|
||||||
render: ->
|
render: ->
|
||||||
|
|
||||||
@html App.view('getting_started/email')()
|
@html App.view('getting_started/email')()
|
||||||
|
@showSlide('js-intro')
|
||||||
|
|
||||||
# outbound
|
# outbound
|
||||||
adapters =
|
adapters =
|
||||||
|
@ -417,8 +420,7 @@ class ChannelEmail extends App.ControllerContent
|
||||||
{ name: 'adapter', display: 'Type', tag: 'select', multiple: false, null: false, options: { imap: 'IMAP', pop3: 'POP3' } },
|
{ name: 'adapter', display: 'Type', tag: 'select', multiple: false, null: false, options: { imap: 'IMAP', pop3: 'POP3' } },
|
||||||
{ name: 'options::host', display: 'Host', tag: 'input', type: 'text', limit: 120, null: false, autocapitalize: false },
|
{ name: 'options::host', display: 'Host', tag: 'input', type: 'text', limit: 120, null: false, autocapitalize: false },
|
||||||
{ name: 'options::user', display: 'User', tag: 'input', type: 'text', limit: 120, null: false, autocapitalize: false },
|
{ name: 'options::user', display: 'User', tag: 'input', type: 'text', limit: 120, null: false, autocapitalize: false },
|
||||||
{ name: 'options::password', display: 'Password', tag: 'input', type: 'text', limit: 120, null: false, autocapitalize: false },
|
{ name: 'options::password', display: 'Password', tag: 'input', type: 'password', limit: 120, null: false, autocapitalize: false, single: true },
|
||||||
{ name: 'options::ssl', display: 'SSL', tag: 'select', multiple: false, null: false, options: { true: 'yes', false: 'no' }, translate: true, default: true},
|
|
||||||
]
|
]
|
||||||
new App.ControllerForm(
|
new App.ControllerForm(
|
||||||
el: @$('.base-inbound-settings'),
|
el: @$('.base-inbound-settings'),
|
||||||
|
@ -437,11 +439,9 @@ class ChannelEmail extends App.ControllerContent
|
||||||
adapter = @$('.js-outbound [name=adapter]').val()
|
adapter = @$('.js-outbound [name=adapter]').val()
|
||||||
if adapter is 'smtp'
|
if adapter is 'smtp'
|
||||||
configureAttributesOutbound = [
|
configureAttributesOutbound = [
|
||||||
{ name: 'options::host', display: 'Host', tag: 'input', type: 'text', limit: 120, null: false, autocapitalize: false, default: (channel_used['options']&&channel_used['options']['host']) },
|
{ name: 'options::host', display: 'Host', tag: 'input', type: 'text', limit: 120, null: false, autocapitalize: false, autofocus: true, default: (channel_used['options']&&channel_used['options']['host']) },
|
||||||
{ name: 'options::user', display: 'User', tag: 'input', type: 'text', limit: 120, null: true, autocapitalize: false, default: (channel_used['options']&&channel_used['options']['user']) },
|
{ name: 'options::user', display: 'User', tag: 'input', type: 'text', limit: 120, null: true, autocapitalize: false, default: (channel_used['options']&&channel_used['options']['user']) },
|
||||||
{ name: 'options::password', display: 'Password', tag: 'input', type: 'text', limit: 120, null: true, autocapitalize: false, default: (channel_used['options']&&channel_used['options']['password']) },
|
{ name: 'options::password', display: 'Password', tag: 'input', type: 'password', limit: 120, null: true, autocapitalize: false, single: true, default: (channel_used['options']&&channel_used['options']['password']) },
|
||||||
{ name: 'options::ssl', display: 'SSL', tag: 'select', multiple: false, null: false, options: { true: 'yes', false: 'no' } , translate: true, default: (channel_used['options']&&channel_used['options']['ssl']||true) },
|
|
||||||
{ name: 'options::port', display: 'Port', tag: 'input', type: 'text', limit: 5, null: false, class: 'span1', autocapitalize: false, default: ((channel_used['options']&&channel_used['options']['port']) || 25) },
|
|
||||||
]
|
]
|
||||||
@form = new App.ControllerForm(
|
@form = new App.ControllerForm(
|
||||||
el: @$('.base-outbound-settings')
|
el: @$('.base-outbound-settings')
|
||||||
|
@ -492,6 +492,8 @@ class ChannelEmail extends App.ControllerContent
|
||||||
params = @formParam(e.target)
|
params = @formParam(e.target)
|
||||||
@disable(e)
|
@disable(e)
|
||||||
|
|
||||||
|
@showSlide('js-test')
|
||||||
|
|
||||||
@ajax(
|
@ajax(
|
||||||
id: 'email_inbound'
|
id: 'email_inbound'
|
||||||
type: 'POST'
|
type: 'POST'
|
||||||
|
@ -509,9 +511,12 @@ class ChannelEmail extends App.ControllerContent
|
||||||
@$('.js-outbound [name="options::password"]').val( @account['meta']['password'] )
|
@$('.js-outbound [name="options::password"]').val( @account['meta']['password'] )
|
||||||
|
|
||||||
else
|
else
|
||||||
|
@showSlide('js-inbound')
|
||||||
@showAlert('js-inbound', data.message_human || data.message )
|
@showAlert('js-inbound', data.message_human || data.message )
|
||||||
@enable(e)
|
@enable(e)
|
||||||
fail: =>
|
fail: =>
|
||||||
|
@showSlide('js-inbound')
|
||||||
|
@showAlert('js-inbound', data.message_human || data.message )
|
||||||
@enable(e)
|
@enable(e)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -523,6 +528,8 @@ class ChannelEmail extends App.ControllerContent
|
||||||
params['email'] = @account['meta']['email']
|
params['email'] = @account['meta']['email']
|
||||||
@disable(e)
|
@disable(e)
|
||||||
|
|
||||||
|
@showSlide('js-test')
|
||||||
|
|
||||||
@ajax(
|
@ajax(
|
||||||
id: 'email_outbound'
|
id: 'email_outbound'
|
||||||
type: 'POST'
|
type: 'POST'
|
||||||
|
@ -537,9 +544,12 @@ class ChannelEmail extends App.ControllerContent
|
||||||
|
|
||||||
@verify(@account)
|
@verify(@account)
|
||||||
else
|
else
|
||||||
|
@showSlide('js-outbound')
|
||||||
@showAlert('js-outbound', data.message_human || data.message )
|
@showAlert('js-outbound', data.message_human || data.message )
|
||||||
@enable(e)
|
@enable(e)
|
||||||
fail: =>
|
fail: =>
|
||||||
|
@showSlide('js-outbound')
|
||||||
|
@showAlert('js-outbound', data.message_human || data.message )
|
||||||
@enable(e)
|
@enable(e)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -566,20 +576,24 @@ class ChannelEmail extends App.ControllerContent
|
||||||
2300
|
2300
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
console.log('r', data, @account)
|
|
||||||
if data.subject && @account
|
if data.subject && @account
|
||||||
@account.subject = data.subject
|
@account.subject = data.subject
|
||||||
@verify( @account, count + 1 )
|
@verify( @account, count + 1 )
|
||||||
#@enable(e)
|
|
||||||
fail: =>
|
fail: =>
|
||||||
#@enable(e)
|
@showSlide('js-intro')
|
||||||
|
@showAlert('js-intro', 'Unable to verify sending and receiving. Please check your settings.' )
|
||||||
)
|
)
|
||||||
|
|
||||||
|
goToSlide: (e) =>
|
||||||
|
e.preventDefault()
|
||||||
|
slide = $(e.target).data('slide')
|
||||||
|
@showSlide(slide)
|
||||||
|
|
||||||
showSlide: (name) =>
|
showSlide: (name) =>
|
||||||
@hideAlert(name)
|
@hideAlert(name)
|
||||||
@$('.setup.wizard').addClass('hide')
|
@$('.setup.wizard').addClass('hide')
|
||||||
@$(".setup.wizard.#{name}").removeClass('hide')
|
@$(".setup.wizard.#{name}").removeClass('hide')
|
||||||
|
@$(".setup.wizard.#{name} input, .setup.wizard.#{name} select").first().focus()
|
||||||
|
|
||||||
showAlert: (screen, message) =>
|
showAlert: (screen, message) =>
|
||||||
@$(".#{screen}").find('.alert').removeClass('hide').text( App.i18n.translateInline( message ) )
|
@$(".#{screen}").find('.alert').removeClass('hide').text( App.i18n.translateInline( message ) )
|
||||||
|
|
|
@ -9,15 +9,15 @@
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><%- @T('Full Name') %></label>
|
<label><%- @T('Full Name') %></label>
|
||||||
<input type="text" class="form-control" value="" name="realname" placeholder="<%- @T('Organization Support') %>">
|
<input type="text" class="form-control" value="" name="realname" placeholder="<%- @T('Organization Support') %>" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><%- @T('Email') %></label>
|
<label><%- @T('Email') %></label>
|
||||||
<input type="email" class="form-control" value="" name="email" placeholder="<%- @T('support@example.com') %>">
|
<input type="email" class="form-control" value="" name="email" placeholder="<%- @T('support@example.com') %>" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><%- @T('Password') %></label>
|
<label><%- @T('Password') %></label>
|
||||||
<input type="password" class="form-control" name="password" value="">
|
<input type="password" class="form-control" name="password" value="" required>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
@ -39,6 +39,17 @@
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<form class="setup wizard hide js-test">
|
||||||
|
<div class="wizard-slide">
|
||||||
|
<h2><%- @T('Email Account') %></h2>
|
||||||
|
<div class="wizard-body vertical justified">
|
||||||
|
<p class="wizard-loadingText">
|
||||||
|
<span class="loading icon"></span> <%- @T('Verifying...') %>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
<form class="setup wizard hide js-verify">
|
<form class="setup wizard hide js-verify">
|
||||||
<div class="wizard-slide">
|
<div class="wizard-slide">
|
||||||
<h2><%- @T('Email Account') %></h2>
|
<h2><%- @T('Email Account') %></h2>
|
||||||
|
@ -59,7 +70,7 @@
|
||||||
<div class="base-inbound-settings"></div>
|
<div class="base-inbound-settings"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="wizard-controls center">
|
<div class="wizard-controls center">
|
||||||
<a class="subtle-link" href="#getting_started/channel"><%- @T('Go Back') %></a>
|
<a class="subtle-link js-back" data-slide="js-intro"><%- @T('Go Back') %></a>
|
||||||
<button class="btn btn--primary align-right"><%- @T( 'Continue' ) %></button>
|
<button class="btn btn--primary align-right"><%- @T( 'Continue' ) %></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -74,7 +85,7 @@
|
||||||
<div class="base-outbound-settings"></div>
|
<div class="base-outbound-settings"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="wizard-controls center">
|
<div class="wizard-controls center">
|
||||||
<a class="subtle-link" href="#getting_started/channel"><%- @T('Go Back') %></a>
|
<a class="subtle-link js-back" data-slide="js-inbound"><%- @T('Go Back') %></a>
|
||||||
<button class="btn btn--primary align-right"><%- @T( 'Continue' ) %></button>
|
<button class="btn btn--primary align-right"><%- @T( 'Continue' ) %></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -187,7 +187,7 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
|
||||||
domains = [domain]
|
domains = [domain]
|
||||||
mail_exchangers = mxers(domain)
|
mail_exchangers = mxers(domain)
|
||||||
if mail_exchangers && mail_exchangers[0]
|
if mail_exchangers && mail_exchangers[0]
|
||||||
puts "MX #{mail_exchangers} - #{mail_exchangers[0][0]}"
|
logger.info "MX for #{domain}: #{mail_exchangers} - #{mail_exchangers[0][0]}"
|
||||||
end
|
end
|
||||||
if mail_exchangers && mail_exchangers[0] && mail_exchangers[0][0]
|
if mail_exchangers && mail_exchangers[0] && mail_exchangers[0][0]
|
||||||
domains.push mail_exchangers[0][0]
|
domains.push mail_exchangers[0][0]
|
||||||
|
@ -352,9 +352,9 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
|
||||||
settings = {}
|
settings = {}
|
||||||
success = false
|
success = false
|
||||||
inboundMap.each {|config|
|
inboundMap.each {|config|
|
||||||
puts "PROBE: #{config.inspect}"
|
logger.info "INBOUND PROBE: #{config.inspect}"
|
||||||
result = email_probe_inbound( config )
|
result = email_probe_inbound( config )
|
||||||
puts "RESULT: #{result.inspect}"
|
logger.info "INBOUND RESULT: #{result.inspect}"
|
||||||
if result[:result] == 'ok'
|
if result[:result] == 'ok'
|
||||||
success = true
|
success = true
|
||||||
settings[:inbound] = config
|
settings[:inbound] = config
|
||||||
|
@ -501,9 +501,9 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
|
||||||
|
|
||||||
success = false
|
success = false
|
||||||
outboundMap.each {|config|
|
outboundMap.each {|config|
|
||||||
puts "PROBE: #{config.inspect}"
|
logger.info "OUTBOUND PROBE: #{config.inspect}"
|
||||||
result = email_probe_outbound( config, params[:email] )
|
result = email_probe_outbound( config, params[:email] )
|
||||||
puts "RESULT: #{result.inspect}"
|
logger.info "OUTBOUND RESULT: #{result.inspect}"
|
||||||
if result[:result] == 'ok'
|
if result[:result] == 'ok'
|
||||||
success = true
|
success = true
|
||||||
settings[:outbound] = config
|
settings[:outbound] = config
|
||||||
|
@ -576,16 +576,26 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
|
||||||
end
|
end
|
||||||
result = email_probe_outbound( params[:outbound], params[:meta][:email], subject )
|
result = email_probe_outbound( params[:outbound], params[:meta][:email], subject )
|
||||||
|
|
||||||
(1..7).each {|loop|
|
(1..5).each {|loop|
|
||||||
sleep 7
|
sleep 10
|
||||||
|
|
||||||
# fetch mailbox
|
# fetch mailbox
|
||||||
found = nil
|
found = nil
|
||||||
|
|
||||||
|
begin
|
||||||
if params[:inbound][:adapter] =~ /^imap$/i
|
if params[:inbound][:adapter] =~ /^imap$/i
|
||||||
found = Channel::IMAP.new.fetch( { :options => params[:inbound][:options] }, 'verify', subject )
|
found = Channel::IMAP.new.fetch( { :options => params[:inbound][:options] }, 'verify', subject )
|
||||||
else
|
else
|
||||||
found = Channel::POP3.new.fetch( { :options => params[:inbound][:options] }, 'verify', subject )
|
found = Channel::POP3.new.fetch( { :options => params[:inbound][:options] }, 'verify', subject )
|
||||||
end
|
end
|
||||||
|
rescue Exception => e
|
||||||
|
render :json => {
|
||||||
|
:result => 'invalid',
|
||||||
|
:message => e.to_s,
|
||||||
|
:subject => subject,
|
||||||
|
}
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if found && found == 'verify ok'
|
if found && found == 'verify ok'
|
||||||
|
|
||||||
|
@ -646,7 +656,7 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
# check dilivery for 30 sek.
|
# check delivery for 30 sek.
|
||||||
render :json => {
|
render :json => {
|
||||||
:result => 'invalid',
|
:result => 'invalid',
|
||||||
:message => 'Verification Email not found in mailbox.',
|
:message => 'Verification Email not found in mailbox.',
|
||||||
|
@ -687,11 +697,21 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
|
||||||
# test connection
|
# test connection
|
||||||
translationMap = {
|
translationMap = {
|
||||||
'authentication failed' => 'Authentication failed!',
|
'authentication failed' => 'Authentication failed!',
|
||||||
|
'Incorrect username' => 'Authentication failed!',
|
||||||
'getaddrinfo: nodename nor servname provided, or not known' => 'Hostname not found!',
|
'getaddrinfo: nodename nor servname provided, or not known' => 'Hostname not found!',
|
||||||
'No route to host' => 'No route to host!',
|
'No route to host' => 'No route to host!',
|
||||||
'Connection refused' => 'Connection refused!',
|
'Connection refused' => 'Connection refused!',
|
||||||
}
|
}
|
||||||
if params[:adapter] =~ /^smtp$/i
|
if params[:adapter] =~ /^smtp$/i
|
||||||
|
|
||||||
|
# in case, fill missing params
|
||||||
|
if !params[:options].has_key?(:port)
|
||||||
|
params[:options][:port] = 25
|
||||||
|
end
|
||||||
|
if !params[:options].has_key?(:ssl)
|
||||||
|
params[:options][:ssl] = true
|
||||||
|
end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Channel::SMTP.new.send(
|
Channel::SMTP.new.send(
|
||||||
mail,
|
mail,
|
||||||
|
@ -773,11 +793,13 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
|
||||||
# connection test
|
# connection test
|
||||||
translationMap = {
|
translationMap = {
|
||||||
'authentication failed' => 'Authentication failed!',
|
'authentication failed' => 'Authentication failed!',
|
||||||
|
'Incorrect username' => 'Authentication failed!',
|
||||||
'getaddrinfo: nodename nor servname provided, or not known' => 'Hostname not found!',
|
'getaddrinfo: nodename nor servname provided, or not known' => 'Hostname not found!',
|
||||||
'No route to host' => 'No route to host!',
|
'No route to host' => 'No route to host!',
|
||||||
'Connection refused' => 'Connection refused!',
|
'Connection refused' => 'Connection refused!',
|
||||||
}
|
}
|
||||||
if params[:adapter] =~ /^imap$/i
|
if params[:adapter] =~ /^imap$/i
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Channel::IMAP.new.fetch( { :options => params[:options] }, 'check' )
|
Channel::IMAP.new.fetch( { :options => params[:options] }, 'check' )
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
|
|
|
@ -5,11 +5,11 @@ require 'net/imap'
|
||||||
class Channel::IMAP < Channel::EmailParser
|
class Channel::IMAP < Channel::EmailParser
|
||||||
|
|
||||||
def fetch (channel, check_type = '', verify_string = '')
|
def fetch (channel, check_type = '', verify_string = '')
|
||||||
ssl = false
|
|
||||||
port = 143
|
|
||||||
if channel[:options][:ssl].to_s == 'true'
|
|
||||||
ssl = true
|
ssl = true
|
||||||
port = 993
|
port = 993
|
||||||
|
if channel[:options].has_key?(:ssl) && channel[:options][:ssl].to_s == 'false'
|
||||||
|
ssl = false
|
||||||
|
port = 143
|
||||||
end
|
end
|
||||||
|
|
||||||
puts "fetching imap (#{channel[:options][:host]}/#{channel[:options][:user]} port=#{port},ssl=#{ssl})"
|
puts "fetching imap (#{channel[:options][:host]}/#{channel[:options][:user]} port=#{port},ssl=#{ssl})"
|
||||||
|
|
|
@ -5,11 +5,11 @@ require 'net/pop'
|
||||||
class Channel::POP3 < Channel::EmailParser
|
class Channel::POP3 < Channel::EmailParser
|
||||||
|
|
||||||
def fetch (channel, check_type = '', verify_string = '')
|
def fetch (channel, check_type = '', verify_string = '')
|
||||||
ssl = false
|
|
||||||
port = 110
|
|
||||||
if channel[:options][:ssl].to_s == 'true'
|
|
||||||
ssl = true
|
ssl = true
|
||||||
port = 995
|
port = 995
|
||||||
|
if channel[:options].has_key?(:ssl) && channel[:options][:ssl].to_s == 'false'
|
||||||
|
ssl = false
|
||||||
|
port = 110
|
||||||
end
|
end
|
||||||
|
|
||||||
puts "fetching pop3 (#{channel[:options][:host]}/#{channel[:options][:user]} port=#{port},ssl=#{ssl})"
|
puts "fetching pop3 (#{channel[:options][:host]}/#{channel[:options][:user]} port=#{port},ssl=#{ssl})"
|
||||||
|
|
|
@ -2,7 +2,12 @@
|
||||||
require 'browser_test_helper'
|
require 'browser_test_helper'
|
||||||
|
|
||||||
class AaaGettingStartedTest < TestCase
|
class AaaGettingStartedTest < TestCase
|
||||||
def test_getting_started
|
def test_a_getting_started
|
||||||
|
if !ENV['MAILBOX_INIT']
|
||||||
|
raise "Need MAILBOX_INIT as ENV variable like export MAILBOX_INIT='unittest01@znuny.com:somepass'"
|
||||||
|
end
|
||||||
|
mailbox_user = ENV['MAILBOX_INIT'].split(':')[0]
|
||||||
|
mailbox_password = ENV['MAILBOX_INIT'].split(':')[1]
|
||||||
tests = [
|
tests = [
|
||||||
{
|
{
|
||||||
:name => 'start',
|
:name => 'start',
|
||||||
|
@ -138,12 +143,12 @@ class AaaGettingStartedTest < TestCase
|
||||||
{
|
{
|
||||||
:execute => 'set',
|
:execute => 'set',
|
||||||
:css => '.js-intro input[name="email"]',
|
:css => '.js-intro input[name="email"]',
|
||||||
:value => 'otest01@znuny.com',
|
:value => mailbox_user,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
:execute => 'set',
|
:execute => 'set',
|
||||||
:css => '.js-intro input[name="password"]',
|
:css => '.js-intro input[name="password"]',
|
||||||
:value => 'otest0142',
|
:value => mailbox_password,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
:execute => 'click',
|
:execute => 'click',
|
||||||
|
@ -153,16 +158,19 @@ class AaaGettingStartedTest < TestCase
|
||||||
:execute => 'watch_for',
|
:execute => 'watch_for',
|
||||||
:area => 'body',
|
:area => 'body',
|
||||||
:value => 'testing',
|
:value => 'testing',
|
||||||
|
:timeout => 60,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
:execute => 'watch_for',
|
:execute => 'watch_for',
|
||||||
:area => 'body',
|
:area => 'body',
|
||||||
:value => 'verify',
|
:value => 'verify',
|
||||||
|
:timeout => 70,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
:execute => 'watch_for',
|
:execute => 'watch_for',
|
||||||
:area => 'body',
|
:area => 'body',
|
||||||
:value => 'invite',
|
:value => 'invite',
|
||||||
|
:timeout => 60,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
:execute => 'check',
|
:execute => 'check',
|
||||||
|
@ -234,4 +242,199 @@ class AaaGettingStartedTest < TestCase
|
||||||
]
|
]
|
||||||
browser_single_test(tests)
|
browser_single_test(tests)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_b_accounts_auto
|
||||||
|
if !ENV['MAILBOX_AUTO1']
|
||||||
|
raise "Need MAILBOX_AUTO1 as ENV variable like export MAILBOX_AUTO1='nicole.braun2015@gmail.com:somepass'"
|
||||||
|
end
|
||||||
|
mailbox_user = ENV['MAILBOX_AUTO1'].split(':')[0]
|
||||||
|
mailbox_password = ENV['MAILBOX_AUTO1'].split(':')[1]
|
||||||
|
accounts = [
|
||||||
|
{
|
||||||
|
:realname => 'gmail',
|
||||||
|
:email => mailbox_user,
|
||||||
|
:password => mailbox_password,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
accounts.each {|account|
|
||||||
|
tests = [
|
||||||
|
{
|
||||||
|
:name => 'getting started - auto mail',
|
||||||
|
:action => [
|
||||||
|
{
|
||||||
|
:execute => 'navigate',
|
||||||
|
:to => browser_url + '/#getting_started/channel',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'click',
|
||||||
|
:css => '.js-channel .email .provider_name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'set',
|
||||||
|
:css => '.js-intro input[name="realname"]',
|
||||||
|
:value => account[:realname],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'set',
|
||||||
|
:css => '.js-intro input[name="email"]',
|
||||||
|
:value => account[:email],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'set',
|
||||||
|
:css => '.js-intro input[name="password"]',
|
||||||
|
:value => account[:password],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'click',
|
||||||
|
:css => '.js-intro .btn--primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'watch_for',
|
||||||
|
:area => 'body',
|
||||||
|
:value => 'testing',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'watch_for',
|
||||||
|
:area => 'body',
|
||||||
|
:value => 'verify',
|
||||||
|
:timeout => 80,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'watch_for',
|
||||||
|
:area => 'body',
|
||||||
|
:value => 'invite',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'check',
|
||||||
|
:element => :url,
|
||||||
|
:result => '#getting_started/agents',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]
|
||||||
|
browser_signle_test_with_login(tests, { :username => 'master@example.com' })
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_b_accounts_manual
|
||||||
|
if !ENV['MAILBOX_MANUAL1']
|
||||||
|
raise "Need MAILBOX_AUTO1 as ENV variable like export MAILBOX_MANUAL1='nicole.bauer2015@yahoo.de:somepass:imap.mail.yahoo.com:smtp.mail.yahoo.com'"
|
||||||
|
end
|
||||||
|
mailbox_user = ENV['MAILBOX_MANUAL1'].split(':')[0]
|
||||||
|
mailbox_password = ENV['MAILBOX_MANUAL1'].split(':')[1]
|
||||||
|
mailbox_inbound = ENV['MAILBOX_MANUAL1'].split(':')[2]
|
||||||
|
mailbox_outbound = ENV['MAILBOX_MANUAL1'].split(':')[3]
|
||||||
|
|
||||||
|
accounts = [
|
||||||
|
{
|
||||||
|
:realname => 'yahoo',
|
||||||
|
:email => mailbox_user,
|
||||||
|
:password => mailbox_password,
|
||||||
|
:inbound => {
|
||||||
|
'options::host' => mailbox_inbound,
|
||||||
|
},
|
||||||
|
:outbound => {
|
||||||
|
'options::host' => mailbox_outbound,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
accounts.each {|account|
|
||||||
|
tests = [
|
||||||
|
{
|
||||||
|
:name => 'getting started - manual mail',
|
||||||
|
:action => [
|
||||||
|
{
|
||||||
|
:execute => 'navigate',
|
||||||
|
:to => browser_url + '/#getting_started/channel',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'click',
|
||||||
|
:css => '.js-channel .email .provider_name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'set',
|
||||||
|
:css => '.js-intro input[name="realname"]',
|
||||||
|
:value => account[:realname],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'set',
|
||||||
|
:css => '.js-intro input[name="email"]',
|
||||||
|
:value => account[:email],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'set',
|
||||||
|
:css => '.js-intro input[name="password"]',
|
||||||
|
:value => account[:password],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'click',
|
||||||
|
:css => '.js-intro .btn--primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'watch_for',
|
||||||
|
:area => '.js-probe',
|
||||||
|
:value => 'testing',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'watch_for',
|
||||||
|
:area => '.js-inbound h2',
|
||||||
|
:value => 'inbound',
|
||||||
|
:timeout => 220,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'watch_for',
|
||||||
|
:area => '.js-inbound',
|
||||||
|
:value => 'manual',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'set',
|
||||||
|
:css => '.js-inbound input[name="options::host"]',
|
||||||
|
:value => account[:inbound]['options::host'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'click',
|
||||||
|
:css => '.js-inbound .btn--primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'watch_for',
|
||||||
|
:area => '.js-outbound h2',
|
||||||
|
:value => 'outbound',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'select',
|
||||||
|
:css => '.js-outbound select[name="adapter"]',
|
||||||
|
:value => 'SMTP - configure your own outgoing SMTP settings',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'set',
|
||||||
|
:css => '.js-outbound input[name="options::host"]',
|
||||||
|
:value => account[:outbound]['options::host'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'click',
|
||||||
|
:css => '.js-outbound .btn--primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'watch_for',
|
||||||
|
:area => 'body',
|
||||||
|
:value => 'verify',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'watch_for',
|
||||||
|
:area => 'body',
|
||||||
|
:value => 'invite',
|
||||||
|
:timeout => 190,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'check',
|
||||||
|
:element => :url,
|
||||||
|
:result => '#getting_started/agents',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]
|
||||||
|
browser_signle_test_with_login(tests, { :username => 'master@example.com' })
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -254,7 +254,7 @@ class TestCase < Test::Unit::TestCase
|
||||||
if action[:timeout]
|
if action[:timeout]
|
||||||
timeout = action[:timeout]
|
timeout = action[:timeout]
|
||||||
end
|
end
|
||||||
loops = timeout / 0.33
|
loops = (timeout / 0.5).to_i
|
||||||
text = ''
|
text = ''
|
||||||
(1..loops).each { |loop|
|
(1..loops).each { |loop|
|
||||||
element = instance.find_element( { :css => action[:area] } )
|
element = instance.find_element( { :css => action[:area] } )
|
||||||
|
@ -266,7 +266,7 @@ class TestCase < Test::Unit::TestCase
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
sleep 0.33
|
sleep 0.5
|
||||||
}
|
}
|
||||||
assert( false, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" )
|
assert( false, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" )
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue