Fixed switch to user feature and added browser tests.

This commit is contained in:
Martin Edenhofer 2015-06-08 10:59:23 +02:00
parent f09195787b
commit 14f267fa82
3 changed files with 44 additions and 3 deletions

View file

@ -54,8 +54,8 @@ class Index extends App.Controller
header
callbackAttributes = (value, object, attribute, header, refObject) ->
value = ' '
attribute.class = 'glyphicon glyphicon-user'
value = ' <svg class="icon-user"><use xlink:href="#icon-user"></use></svg>'
attribute.class = ''
attribute.link = '#'
attribute.title = App.i18n.translateInline('Switch to')
value

View file

@ -4006,7 +4006,7 @@ footer {
color: #fff;
height: 45px;
padding: 0 17px;
top: -45px !important;
/*top: -45px !important;*/
border-bottom: 5px solid hsl(205,90%,60%);
}
.switchBackToUser-icon {

View 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