trabajo-afectivo/test/browser/switch_to_user_test.rb

54 lines
1.3 KiB
Ruby
Raw Normal View History

# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
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"]')
click(css: '.content.active a[href="#manage/users"]')
set(
css: '.content.active .js-search',
value: 'nicole',
)
sleep 3
@browser.action.move_to(@browser.find_elements({ css: '.content.active .table-overview tbody tr:first-child' })[0]).release.perform
2015-11-21 06:50:53 +00:00
sleep 0.5
click(
css: '.content.active .dropdown--actions',
)
click(
css: '.content.active .icon-switchView',
ajax: false
)
2016-01-25 08:17:49 +00:00
sleep 3
watch_for(
css: '.switchBackToUser',
value: 'zammad looks like',
)
2015-06-08 18:01:31 +00:00
watch_for(
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')
assert_equal(login, 'nicole.braun@zammad.org')
click(css: '.switchBackToUser .js-close', ajax: false)
sleep 5
2016-09-05 13:18:22 +00:00
login = @browser.find_elements({ css: '.user-menu .user a' })[0].attribute('title')
assert_equal(login, 'master@example.com')
end
end