2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2015-02-06 08:59:08 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class AgentUserProfileTest < TestCase
|
2015-02-23 15:35:48 +00:00
|
|
|
def test_user_profile
|
2021-09-20 10:47:05 +00:00
|
|
|
message = "1 #{SecureRandom.uuid}"
|
2015-02-23 13:02:46 +00:00
|
|
|
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
2021-08-17 12:10:02 +00:00
|
|
|
username: 'admin@example.com',
|
2015-04-27 13:42:53 +00:00
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2015-02-23 13:02:46 +00:00
|
|
|
)
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2015-02-23 13:02:46 +00:00
|
|
|
|
|
|
|
# search and open user
|
2016-03-15 11:47:26 +00:00
|
|
|
user_open_by_search(value: 'Braun')
|
2015-02-23 13:02:46 +00:00
|
|
|
|
2016-04-30 08:23:53 +00:00
|
|
|
verify_task(
|
|
|
|
data: {
|
|
|
|
title: 'Nicole Braun',
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2015-02-23 13:02:46 +00:00
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .profile-window',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'note',
|
2015-02-23 13:02:46 +00:00
|
|
|
)
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .profile-window',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'email',
|
2015-02-23 13:02:46 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# update note
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="note"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some note 123',
|
2015-02-26 12:41:09 +00:00
|
|
|
)
|
2021-07-16 13:29:38 +00:00
|
|
|
empty_search
|
2015-02-23 13:02:46 +00:00
|
|
|
sleep 2
|
|
|
|
|
|
|
|
# check and change note again in edit screen
|
2016-04-30 08:23:53 +00:00
|
|
|
click(css: '.active .js-action .icon-arrow-down', fast: true)
|
2016-03-15 11:47:26 +00:00
|
|
|
click(css: '.active .js-action [data-type="edit"]')
|
2015-02-23 13:02:46 +00:00
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
modal_ready
|
2015-02-23 13:02:46 +00:00
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .modal',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some note 123',
|
2015-02-23 13:02:46 +00:00
|
|
|
)
|
|
|
|
|
2016-04-30 08:23:53 +00:00
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.modal [name="lastname"]',
|
2016-04-30 08:23:53 +00:00
|
|
|
value: 'B2',
|
|
|
|
)
|
2015-02-23 13:02:46 +00:00
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.modal [data-name="note"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some note abc',
|
2015-02-23 13:02:46 +00:00
|
|
|
)
|
2016-03-15 11:47:26 +00:00
|
|
|
click(css: '.active .modal button.js-submit')
|
2021-07-16 13:29:38 +00:00
|
|
|
modal_disappear
|
2015-02-23 13:02:46 +00:00
|
|
|
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .profile-window',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some note abc',
|
2015-02-23 13:02:46 +00:00
|
|
|
)
|
|
|
|
|
2016-04-30 08:23:53 +00:00
|
|
|
verify_task(
|
|
|
|
data: {
|
|
|
|
title: 'Nicole B2',
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
# change lastname back
|
|
|
|
click(css: '.active .js-action .icon-arrow-down', fast: true)
|
|
|
|
click(css: '.active .js-action [data-type="edit"]')
|
2018-07-25 07:27:36 +00:00
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
modal_ready
|
2016-04-30 08:23:53 +00:00
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.modal [name="lastname"]',
|
2016-04-30 08:23:53 +00:00
|
|
|
value: 'Braun',
|
|
|
|
)
|
|
|
|
click(css: '.active .modal button.js-submit')
|
2021-07-16 13:29:38 +00:00
|
|
|
modal_disappear
|
2016-04-30 08:23:53 +00:00
|
|
|
|
|
|
|
verify_task(
|
|
|
|
data: {
|
|
|
|
title: 'Nicole Braun',
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2015-02-23 13:02:46 +00:00
|
|
|
# create new ticket
|
|
|
|
ticket_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
|
|
|
customer: 'nico',
|
2018-12-19 17:31:51 +00:00
|
|
|
group: 'Users',
|
2020-09-30 09:07:01 +00:00
|
|
|
title: "user profile check #{message}",
|
|
|
|
body: "user profile check #{message}",
|
2015-02-06 08:59:08 +00:00
|
|
|
},
|
2015-02-23 13:02:46 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# switch to org tab, verify if ticket is shown
|
2016-03-15 11:47:26 +00:00
|
|
|
user_open_by_search(value: 'Braun')
|
2015-02-23 13:02:46 +00:00
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .profile-window',
|
2020-09-30 09:07:01 +00:00
|
|
|
value: "user profile check #{message}",
|
2015-02-23 13:02:46 +00:00
|
|
|
)
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2015-02-23 15:35:48 +00:00
|
|
|
|
|
|
|
# work with two browser windows
|
2021-09-20 10:47:05 +00:00
|
|
|
message = "comment 1 #{SecureRandom.uuid}"
|
2015-02-23 15:35:48 +00:00
|
|
|
|
|
|
|
# use current session
|
|
|
|
browser1 = @browser
|
|
|
|
|
|
|
|
browser2 = browser_instance
|
|
|
|
login(
|
2018-12-19 17:31:51 +00:00
|
|
|
browser: browser2,
|
2015-04-27 13:42:53 +00:00
|
|
|
username: 'agent1@example.com',
|
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
tasks_close_all(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
user_open_by_search(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser1,
|
2018-12-19 17:31:51 +00:00
|
|
|
value: 'Braun',
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
user_open_by_search(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
value: 'Braun',
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# update note
|
|
|
|
set(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser1,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active [data-name="note"]',
|
|
|
|
value: message,
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
2016-03-15 11:47:26 +00:00
|
|
|
empty_search(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser1,
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
watch_for(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .profile-window',
|
|
|
|
value: message,
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
|
2015-02-06 08:59:08 +00:00
|
|
|
end
|
2015-04-27 14:15:29 +00:00
|
|
|
end
|