2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2015-06-08 08:59:23 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class SwitchToUserTest < TestCase
|
|
|
|
def test_agent_user
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
2021-08-17 12:10:02 +00:00
|
|
|
username: 'admin@example.com',
|
2015-06-08 08:59:23 +00:00
|
|
|
password: 'test',
|
|
|
|
url: browser_url,
|
|
|
|
)
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2015-06-08 08:59:23 +00:00
|
|
|
|
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
|
|
|
|
|
2021-07-16 13:38:01 +00:00
|
|
|
@browser.action.move_to(@browser.find_elements({ css: '.content.active .table-overview tbody tr:first-child' })[0]).release.perform
|
2018-03-28 05:33:41 +00:00
|
|
|
|
2015-11-21 06:50:53 +00:00
|
|
|
sleep 0.5
|
2020-09-08 15:06:23 +00:00
|
|
|
click(
|
|
|
|
css: '.content.active .dropdown--actions',
|
|
|
|
)
|
2015-06-08 08:59:23 +00:00
|
|
|
click(
|
2021-06-15 06:26:52 +00:00
|
|
|
css: '.content.active .icon-switchView',
|
|
|
|
ajax: false
|
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(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.switchBackToUser',
|
2015-07-03 15:31:27 +00:00
|
|
|
value: 'zammad looks like',
|
2015-06-08 08:59:23 +00:00
|
|
|
)
|
2015-06-08 18:01:31 +00:00
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.switchBackToUser',
|
2015-07-03 15:31:27 +00:00
|
|
|
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')
|
2021-06-15 06:26:52 +00:00
|
|
|
click(css: '.switchBackToUser .js-close', ajax: false)
|
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')
|
2021-08-17 12:10:02 +00:00
|
|
|
assert_equal(login, 'admin@example.com')
|
2015-06-08 08:59:23 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
end
|