Tests for navigation and title.
This commit is contained in:
parent
508c101fbc
commit
ea4b7c4bd9
4 changed files with 164 additions and 0 deletions
|
@ -627,6 +627,7 @@ class App.ControllerContent extends App.Controller
|
|||
$('.content').addClass('hide')
|
||||
$('#content').removeClass('hide')
|
||||
@navShow()
|
||||
App.TaskManager.hideAll()
|
||||
|
||||
class App.ControllerModal extends App.Controller
|
||||
authenticateRequired: false
|
||||
|
|
|
@ -46,6 +46,9 @@ class App.TaskManager
|
|||
@TaskbarId: ->
|
||||
_instance.TaskbarId()
|
||||
|
||||
@hideAll: ->
|
||||
_instance.showControllerHideOthers()
|
||||
|
||||
class _taskManagerSingleton extends App.Controller
|
||||
@include App.LogInclude
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ elif [ "$LEVEL" == '2' ]; then
|
|||
rm test/browser/aab_basic_urls_test.rb
|
||||
rm test/browser/admin_channel_email_test.rb
|
||||
rm test/browser/admin_overview_test.rb
|
||||
rm test/browser/agent_navigation_and_title_test.rb
|
||||
rm test/browser/agent_organization_profile_test.rb
|
||||
rm test/browser/agent_user_*.rb
|
||||
rm test/browser/auth_test.rb
|
||||
|
@ -50,6 +51,7 @@ elif [ "$LEVEL" == '3' ]; then
|
|||
rm test/browser/aab_unit_test.rb
|
||||
rm test/browser/aac_basic_richtext_test.rb
|
||||
rm test/browser/aab_basic_urls_test.rb
|
||||
rm test/browser/agent_navigation_and_title_test.rb
|
||||
rm test/browser/agent_user_manage_test.rb
|
||||
rm test/browser/agent_ticket_*.rb
|
||||
rm test/browser/auth_test.rb
|
||||
|
|
158
test/browser/agent_navigation_and_title_test.rb
Normal file
158
test/browser/agent_navigation_and_title_test.rb
Normal file
|
@ -0,0 +1,158 @@
|
|||
# encoding: utf-8
|
||||
require 'browser_test_helper'
|
||||
|
||||
class AgentNavigationAndTitleTest < TestCase
|
||||
def test_highlight_and_title
|
||||
@browser = browser_instance
|
||||
login(
|
||||
username: 'master@example.com',
|
||||
password: 'test',
|
||||
url: browser_url,
|
||||
)
|
||||
tasks_close_all()
|
||||
|
||||
# dashboard after login
|
||||
verify_title(value: 'dashboard')
|
||||
exists(css: '#navigation .js-menu .js-dashboardMenuItem.is-active')
|
||||
exists_not(css: '#navigation .tasks .js-item.is-active')
|
||||
|
||||
execute(js: 'App.Event.trigger("ui:rerender")')
|
||||
sleep 1
|
||||
verify_title(value: 'dashboard')
|
||||
exists(css: '#navigation .js-menu .js-dashboardMenuItem.is-active')
|
||||
exists_not(css: '#navigation .tasks .js-item.is-active')
|
||||
|
||||
reload()
|
||||
sleep 2
|
||||
verify_title(value: 'dashboard')
|
||||
exists(css: '#navigation .js-menu .js-dashboardMenuItem.is-active')
|
||||
exists_not(css: '#navigation .tasks .js-item.is-active')
|
||||
|
||||
# ticket create screen
|
||||
ticket_create(
|
||||
data: {
|
||||
customer: 'nico',
|
||||
group: 'Users',
|
||||
title: 'ticket create #1',
|
||||
body: 'ticket create #1',
|
||||
},
|
||||
do_not_submit: true,
|
||||
)
|
||||
sleep 4
|
||||
verify_title(value: 'Call Inbound')
|
||||
verify_task(
|
||||
data: {
|
||||
title: 'Call Inbound: ticket create #1',
|
||||
}
|
||||
)
|
||||
exists_not(css: '#navigation .js-menu .is-active')
|
||||
|
||||
execute(js: 'App.Event.trigger("ui:rerender")')
|
||||
sleep 1
|
||||
verify_title(value: 'Call Inbound')
|
||||
verify_task(
|
||||
data: {
|
||||
title: 'Call Inbound: ticket create #1',
|
||||
}
|
||||
)
|
||||
exists_not(css: '#navigation .js-menu .is-active')
|
||||
|
||||
reload()
|
||||
sleep 2
|
||||
verify_title(value: 'Call Inbound')
|
||||
verify_task(
|
||||
data: {
|
||||
title: 'Call Inbound: ticket create #1',
|
||||
}
|
||||
)
|
||||
exists_not(css: '#navigation .js-menu .is-active')
|
||||
|
||||
# ticket zoom screen
|
||||
ticket1 = ticket_create(
|
||||
data: {
|
||||
customer: 'nico',
|
||||
group: 'Users',
|
||||
state: 'closed',
|
||||
title: 'ticket create #2',
|
||||
body: 'ticket create #2',
|
||||
},
|
||||
)
|
||||
verify_title(value: 'ticket create #2')
|
||||
verify_task(
|
||||
data: {
|
||||
title: 'ticket create #2',
|
||||
}
|
||||
)
|
||||
exists_not(css: '#navigation .js-menu .is-active')
|
||||
|
||||
execute(js: 'App.Event.trigger("ui:rerender")')
|
||||
sleep 1
|
||||
verify_title(value: 'ticket create #2')
|
||||
verify_task(
|
||||
data: {
|
||||
title: 'ticket create #2',
|
||||
}
|
||||
)
|
||||
exists_not(css: '#navigation .js-menu .is-active')
|
||||
|
||||
reload()
|
||||
sleep 2
|
||||
verify_title(value: 'ticket create #2')
|
||||
verify_task(
|
||||
data: {
|
||||
title: 'ticket create #2',
|
||||
}
|
||||
)
|
||||
exists_not(css: '#navigation .js-menu .is-active')
|
||||
|
||||
# dashboard again
|
||||
click(css: '#navigation a[href="#dashboard"]')
|
||||
verify_title(value: 'dashboard')
|
||||
exists(css: '#navigation .js-menu .js-dashboardMenuItem.is-active')
|
||||
exists_not(css: '#navigation .tasks .js-item.is-active')
|
||||
|
||||
execute(js: 'App.Event.trigger("ui:rerender")')
|
||||
sleep 1
|
||||
verify_title(value: 'dashboard')
|
||||
exists(css: '#navigation .js-menu .js-dashboardMenuItem.is-active')
|
||||
exists_not(css: '#navigation .tasks .js-item.is-active')
|
||||
|
||||
reload()
|
||||
sleep 2
|
||||
verify_title(value: 'dashboard')
|
||||
exists(css: '#navigation .js-menu .js-dashboardMenuItem.is-active')
|
||||
exists_not(css: '#navigation .tasks .js-item.is-active')
|
||||
|
||||
execute(js: 'App.Event.trigger("ui:rerender")')
|
||||
sleep 1
|
||||
verify_title(value: 'dashboard')
|
||||
exists(css: '#navigation .js-menu .js-dashboardMenuItem.is-active')
|
||||
exists_not(css: '#navigation .tasks .js-item.is-active')
|
||||
|
||||
# click on admin
|
||||
click(css: 'a[href = "#manage"]')
|
||||
verify_title(value: 'Users')
|
||||
exists_not(css: '#navigation .js-menu .is-active')
|
||||
exists_not(css: '#navigation .tasks .js-item.is-active')
|
||||
|
||||
execute(js: 'App.Event.trigger("ui:rerender")')
|
||||
sleep 1
|
||||
verify_title(value: 'Users')
|
||||
exists_not(css: '#navigation .js-menu .is-active')
|
||||
exists_not(css: '#navigation .tasks .js-item.is-active')
|
||||
|
||||
reload()
|
||||
sleep 2
|
||||
verify_title(value: 'Users')
|
||||
exists_not(css: '#navigation .js-menu .is-active')
|
||||
exists_not(css: '#navigation .tasks .js-item.is-active')
|
||||
|
||||
execute(js: 'App.Event.trigger("ui:rerender")')
|
||||
sleep 1
|
||||
verify_title(value: 'Users')
|
||||
exists_not(css: '#navigation .js-menu .is-active')
|
||||
exists_not(css: '#navigation .tasks .js-item.is-active')
|
||||
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in a new issue