So only show dashboard clues if dashboard is visible.
This commit is contained in:
parent
29ff4e6fd3
commit
51e8fc0ef2
3 changed files with 45 additions and 14 deletions
|
@ -18,10 +18,7 @@ class App.Dashboard extends App.Controller
|
||||||
return if !@authenticate(true)
|
return if !@authenticate(true)
|
||||||
@render()
|
@render()
|
||||||
|
|
||||||
# start intro
|
@mayBeClues()
|
||||||
preferences = @Session.get('preferences')
|
|
||||||
if !preferences['intro']
|
|
||||||
@clues()
|
|
||||||
|
|
||||||
render: ->
|
render: ->
|
||||||
|
|
||||||
|
@ -39,6 +36,12 @@ class App.Dashboard extends App.Controller
|
||||||
limit: 25
|
limit: 25
|
||||||
)
|
)
|
||||||
|
|
||||||
|
mayBeClues: =>
|
||||||
|
preferences = @Session.get('preferences')
|
||||||
|
return if preferences['intro']
|
||||||
|
return if !@el.is(':visible')
|
||||||
|
@clues()
|
||||||
|
|
||||||
clues: (e) =>
|
clues: (e) =>
|
||||||
if e
|
if e
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
@ -56,6 +59,8 @@ class App.Dashboard extends App.Controller
|
||||||
|
|
||||||
active: (state) =>
|
active: (state) =>
|
||||||
@activeState = state
|
@activeState = state
|
||||||
|
if state
|
||||||
|
@mayBeClues()
|
||||||
|
|
||||||
isActive: =>
|
isActive: =>
|
||||||
@activeState
|
@activeState
|
||||||
|
|
|
@ -157,11 +157,10 @@ class TestCase < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
assert(true, 'auto wizard login ok')
|
assert(true, 'auto wizard login ok')
|
||||||
|
|
||||||
# remove clues
|
clues_close(
|
||||||
clues = instance.find_elements({ css: '.js-modal--clue .js-close' })[0]
|
browser: instance,
|
||||||
if clues
|
optional: true,
|
||||||
clues.click
|
)
|
||||||
end
|
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -190,11 +189,10 @@ class TestCase < Test::Unit::TestCase
|
||||||
fail 'login failed'
|
fail 'login failed'
|
||||||
end
|
end
|
||||||
|
|
||||||
# remove clues
|
clues_close(
|
||||||
clues = instance.find_elements({ css: '.js-modal--clue .js-close' })[0]
|
browser: instance,
|
||||||
if clues
|
optional: true,
|
||||||
clues.click
|
)
|
||||||
end
|
|
||||||
|
|
||||||
screenshot(browser: instance, comment: 'login_ok')
|
screenshot(browser: instance, comment: 'login_ok')
|
||||||
assert(true, '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!'
|
fail 'no login box found, seems logout was not successfully!'
|
||||||
end
|
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
|
=begin
|
||||||
|
|
||||||
location(
|
location(
|
||||||
|
|
|
@ -29,6 +29,8 @@ class AutoWizardTest < TestCase
|
||||||
timeout: 20,
|
timeout: 20,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
clues_close
|
||||||
|
|
||||||
organization_open_by_search(
|
organization_open_by_search(
|
||||||
value: 'Demo Organization',
|
value: 'Demo Organization',
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue