So only show dashboard clues if dashboard is visible.

This commit is contained in:
Martin Edenhofer 2016-02-03 15:21:59 +01:00
parent 29ff4e6fd3
commit 51e8fc0ef2
3 changed files with 45 additions and 14 deletions

View file

@ -18,10 +18,7 @@ class App.Dashboard extends App.Controller
return if !@authenticate(true)
@render()
# start intro
preferences = @Session.get('preferences')
if !preferences['intro']
@clues()
@mayBeClues()
render: ->
@ -39,6 +36,12 @@ class App.Dashboard extends App.Controller
limit: 25
)
mayBeClues: =>
preferences = @Session.get('preferences')
return if preferences['intro']
return if !@el.is(':visible')
@clues()
clues: (e) =>
if e
e.preventDefault()
@ -56,6 +59,8 @@ class App.Dashboard extends App.Controller
active: (state) =>
@activeState = state
if state
@mayBeClues()
isActive: =>
@activeState

View file

@ -157,11 +157,10 @@ class TestCase < Test::Unit::TestCase
end
assert(true, 'auto wizard login ok')
# remove clues
clues = instance.find_elements({ css: '.js-modal--clue .js-close' })[0]
if clues
clues.click
end
clues_close(
browser: instance,
optional: true,
)
return
end
@ -190,11 +189,10 @@ class TestCase < Test::Unit::TestCase
fail 'login failed'
end
# remove clues
clues = instance.find_elements({ css: '.js-modal--clue .js-close' })[0]
if clues
clues.click
end
clues_close(
browser: instance,
optional: true,
)
screenshot(browser: instance, comment: 'login_ok')
assert(true, 'login ok')
@ -231,6 +229,32 @@ class TestCase < Test::Unit::TestCase
fail 'no login box found, seems logout was not successfully!'
end
=begin
clues_close(
browser: browser1,
optional: false,
)
=end
def clues_close(params)
switch_window_focus(params)
log('clues_close', params)
instance = params[:browser] || @browser
clues = instance.find_elements({ css: '.js-modal--clue .js-close' })[0]
if !params[:optional] && !clues
screenshot(browser: instance, comment: 'no_clues')
fail 'Unable to closes clues, no clues found!'
end
return if !clues
instance.execute_script("$('.js-modal--clue .js-close').click()")
assert(true, 'clues closed')
sleep 4
end
=begin
location(

View file

@ -29,6 +29,8 @@ class AutoWizardTest < TestCase
timeout: 20,
)
clues_close
organization_open_by_search(
value: 'Demo Organization',
)