2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2016-05-01 09:25:53 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class AgentNavigationAndTitleTest < TestCase
|
|
|
|
def test_highlight_and_title
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
|
|
|
username: 'master@example.com',
|
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2016-05-01 09:25:53 +00:00
|
|
|
)
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2016-05-01 09:25:53 +00:00
|
|
|
|
2020-09-11 14:45:49 +00:00
|
|
|
# since we run the basic functionality tests via Capybara now the clues are shown
|
|
|
|
# and closed after the login. This unfortunately removes the 'is-active' class from the
|
|
|
|
# dashboard link causing the following tests to fail.
|
|
|
|
# Because the browser tests are deprecated and there is no easy fix to change the
|
|
|
|
# behavior we refresh the page and wait for it to finish loading the app as a workaround.
|
|
|
|
# This will cause the 'is-active' class to be set on the menu item again
|
2021-07-16 13:29:38 +00:00
|
|
|
reload
|
2020-09-11 14:45:49 +00:00
|
|
|
sleep 4
|
2020-09-14 07:08:24 +00:00
|
|
|
|
2016-05-01 09:25:53 +00:00
|
|
|
# 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')
|
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
reload
|
2016-05-01 09:25:53 +00:00
|
|
|
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(
|
2018-12-19 17:31:51 +00:00
|
|
|
data: {
|
2016-05-01 09:25:53 +00:00
|
|
|
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')
|
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
reload
|
2016-05-01 09:25:53 +00:00
|
|
|
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
|
2019-06-28 11:38:49 +00:00
|
|
|
ticket_create(
|
2016-05-01 09:25:53 +00:00
|
|
|
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')
|
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
reload
|
2016-05-01 09:25:53 +00:00
|
|
|
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')
|
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
reload
|
2016-05-01 09:25:53 +00:00
|
|
|
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
|
2020-06-22 09:57:45 +00:00
|
|
|
click(css: 'a[href = "#manage"]')
|
2016-05-01 09:25:53 +00:00
|
|
|
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')
|
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
reload
|
2016-05-01 09:25:53 +00:00
|
|
|
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
|