2017-11-23 08:09:44 +00:00
|
|
|
|
2015-06-08 08:59:23 +00:00
|
|
|
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()
|
|
|
|
|
2016-09-05 13:18:22 +00:00
|
|
|
click(css: 'a[href="#manage"]')
|
2016-09-27 17:46:23 +00:00
|
|
|
click(css: '.content.active a[href="#manage/users"]')
|
2015-06-08 08:59:23 +00:00
|
|
|
|
|
|
|
set(
|
2016-09-27 17:46:23 +00:00
|
|
|
css: '.content.active .js-search',
|
2015-06-08 08:59:23 +00:00
|
|
|
value: 'nicole',
|
|
|
|
)
|
|
|
|
sleep 3
|
|
|
|
|
2016-09-27 17:46:23 +00:00
|
|
|
@browser.mouse.move_to(@browser.find_elements({ css: '.content.active .table-overview tbody tr:first-child' } )[0])
|
2015-11-21 06:50:53 +00:00
|
|
|
sleep 0.5
|
2015-06-08 08:59:23 +00:00
|
|
|
click(
|
2016-09-27 17:46:23 +00:00
|
|
|
css: '.content.active .icon-switchView',
|
2015-06-08 08:59:23 +00:00
|
|
|
)
|
2016-01-25 08:17:49 +00:00
|
|
|
sleep 3
|
2015-06-08 08:59:23 +00:00
|
|
|
|
|
|
|
watch_for(
|
2015-07-03 15:31:27 +00:00
|
|
|
css: '.switchBackToUser',
|
|
|
|
value: 'zammad looks like',
|
2015-06-08 08:59:23 +00:00
|
|
|
)
|
2015-06-08 18:01:31 +00:00
|
|
|
watch_for(
|
2015-07-03 15:31:27 +00:00
|
|
|
css: '.switchBackToUser',
|
|
|
|
value: 'Nicole',
|
2015-06-08 18:01:31 +00:00
|
|
|
)
|
2016-09-05 13:18:22 +00:00
|
|
|
login = @browser.find_elements({ css: '.user-menu .user a' })[0].attribute('title')
|
2015-06-08 08:59:23 +00:00
|
|
|
assert_equal(login, 'nicole.braun@zammad.org')
|
2016-09-05 13:18:22 +00:00
|
|
|
click(css: '.switchBackToUser .js-close')
|
2015-06-08 08:59:23 +00:00
|
|
|
|
2016-01-26 06:56:51 +00:00
|
|
|
sleep 5
|
2016-09-05 13:18:22 +00:00
|
|
|
login = @browser.find_elements({ css: '.user-menu .user a' })[0].attribute('title')
|
2015-06-08 08:59:23 +00:00
|
|
|
assert_equal(login, 'master@example.com')
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|