Fixed switch to user feature and added browser tests.
This commit is contained in:
parent
f09195787b
commit
14f267fa82
3 changed files with 44 additions and 3 deletions
|
@ -54,8 +54,8 @@ class Index extends App.Controller
|
||||||
header
|
header
|
||||||
|
|
||||||
callbackAttributes = (value, object, attribute, header, refObject) ->
|
callbackAttributes = (value, object, attribute, header, refObject) ->
|
||||||
value = ' '
|
value = ' <svg class="icon-user"><use xlink:href="#icon-user"></use></svg>'
|
||||||
attribute.class = 'glyphicon glyphicon-user'
|
attribute.class = ''
|
||||||
attribute.link = '#'
|
attribute.link = '#'
|
||||||
attribute.title = App.i18n.translateInline('Switch to')
|
attribute.title = App.i18n.translateInline('Switch to')
|
||||||
value
|
value
|
||||||
|
|
|
@ -4006,7 +4006,7 @@ footer {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
height: 45px;
|
height: 45px;
|
||||||
padding: 0 17px;
|
padding: 0 17px;
|
||||||
top: -45px !important;
|
/*top: -45px !important;*/
|
||||||
border-bottom: 5px solid hsl(205,90%,60%);
|
border-bottom: 5px solid hsl(205,90%,60%);
|
||||||
}
|
}
|
||||||
.switchBackToUser-icon {
|
.switchBackToUser-icon {
|
||||||
|
|
41
test/browser/switch_to_user_test.rb
Normal file
41
test/browser/switch_to_user_test.rb
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
# encoding: utf-8
|
||||||
|
require 'browser_test_helper'
|
||||||
|
|
||||||
|
class SwitchToUserTest < TestCase
|
||||||
|
def test_agent_user
|
||||||
|
@browser = browser_instance
|
||||||
|
login(
|
||||||
|
username: 'master@example.com',
|
||||||
|
password: 'test',
|
||||||
|
url: browser_url,
|
||||||
|
)
|
||||||
|
tasks_close_all()
|
||||||
|
|
||||||
|
click( css: 'a[href="#manage"]' )
|
||||||
|
click( css: 'a[href="#manage/users"]' )
|
||||||
|
|
||||||
|
set(
|
||||||
|
css: '#content .js-search',
|
||||||
|
value: 'nicole',
|
||||||
|
)
|
||||||
|
sleep 3
|
||||||
|
|
||||||
|
click(
|
||||||
|
css: '#content .icon-user',
|
||||||
|
)
|
||||||
|
|
||||||
|
watch_for(
|
||||||
|
:css => '#app',
|
||||||
|
:value => 'zammad looks like',
|
||||||
|
)
|
||||||
|
login = @browser.find_elements( { css: '.user-menu .user a' } )[0].attribute('title')
|
||||||
|
assert_equal(login, 'nicole.braun@zammad.org')
|
||||||
|
|
||||||
|
click( css: '#app .js-close' )
|
||||||
|
|
||||||
|
login = @browser.find_elements( { css: '.user-menu .user a' } )[0].attribute('title')
|
||||||
|
assert_equal(login, 'master@example.com')
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
Loading…
Reference in a new issue