2015-06-08 08:59:23 +00:00
|
|
|
# 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',
|
|
|
|
)
|
2015-06-08 18:01:31 +00:00
|
|
|
watch_for(
|
|
|
|
:css => '#app .switchBackToUser',
|
|
|
|
:value => 'Nicole',
|
|
|
|
)
|
2015-06-08 08:59:23 +00:00
|
|
|
login = @browser.find_elements( { css: '.user-menu .user a' } )[0].attribute('title')
|
|
|
|
assert_equal(login, 'nicole.braun@zammad.org')
|
|
|
|
|
2015-06-08 18:01:31 +00:00
|
|
|
click( css: '#app .switchBackToUser .js-close' )
|
2015-06-08 08:59:23 +00:00
|
|
|
|
|
|
|
login = @browser.find_elements( { css: '.user-menu .user a' } )[0].attribute('title')
|
|
|
|
assert_equal(login, 'master@example.com')
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|