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 AgentOrganizationProfileTest < TestCase
|
2015-02-23 15:35:48 +00:00
|
|
|
def test_org_profile
|
|
|
|
# work in one browser window
|
2020-09-30 09:07:01 +00:00
|
|
|
message = "1 #{rand(99_999_999)}"
|
|
|
|
note = "some note #{rand(99_999_999)}"
|
2015-02-23 13:49:40 +00:00
|
|
|
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
2015-04-27 13:42:53 +00:00
|
|
|
username: 'master@example.com',
|
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2015-02-23 13:49:40 +00:00
|
|
|
)
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
# search and open org
|
|
|
|
organization_open_by_search(
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'Zammad Foundation',
|
2015-02-23 13:49:40 +00:00
|
|
|
)
|
2016-04-30 08:23:53 +00:00
|
|
|
|
|
|
|
verify_task(
|
|
|
|
data: {
|
|
|
|
title: 'Zammad Foundation',
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2015-02-23 13:49:40 +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:49:40 +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: 'member',
|
2015-02-23 13:49:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# update note
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .profile [data-name="note"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: note,
|
2015-02-23 13:49:40 +00:00
|
|
|
)
|
2016-03-15 11:47:26 +00:00
|
|
|
empty_search()
|
2015-02-26 12:41:09 +00:00
|
|
|
sleep 2
|
2015-02-23 13:49:40 +00:00
|
|
|
|
|
|
|
# check and change note again in edit screen
|
2016-03-15 11:47:26 +00:00
|
|
|
click(css: '.active .js-action .icon-arrow-down', fast: true)
|
|
|
|
click(css: '.active .js-action [data-type="edit"]')
|
2015-02-23 13:49:40 +00:00
|
|
|
|
2018-07-25 07:27:36 +00:00
|
|
|
modal_ready()
|
2015-02-23 13:49:40 +00:00
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .modal',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: note,
|
2015-02-23 13:49:40 +00:00
|
|
|
)
|
|
|
|
|
2016-04-30 08:23:53 +00:00
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.modal [name="name"]',
|
2016-04-30 08:23:53 +00:00
|
|
|
value: 'Z2',
|
|
|
|
)
|
2015-02-23 13:49:40 +00:00
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .modal [data-name="note"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some note abc',
|
2015-02-23 13:49:40 +00:00
|
|
|
)
|
2016-03-15 11:47:26 +00:00
|
|
|
click(css: '.active .modal button.js-submit')
|
2018-07-25 07:27:36 +00:00
|
|
|
modal_disappear()
|
2015-02-23 13:49:40 +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:49:40 +00:00
|
|
|
)
|
|
|
|
|
2016-04-30 08:23:53 +00:00
|
|
|
verify_task(
|
|
|
|
data: {
|
|
|
|
title: 'Z2',
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
modal_ready()
|
2016-04-30 08:23:53 +00:00
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.modal [name="name"]',
|
2016-04-30 08:23:53 +00:00
|
|
|
value: 'Zammad Foundation',
|
|
|
|
)
|
|
|
|
click(css: '.active .modal button.js-submit')
|
2018-07-25 07:27:36 +00:00
|
|
|
modal_disappear()
|
2016-04-30 08:23:53 +00:00
|
|
|
|
|
|
|
verify_task(
|
|
|
|
data: {
|
|
|
|
title: 'Zammad Foundation',
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2015-02-23 13:49:40 +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: "org profile check #{message}",
|
|
|
|
body: "org profile check #{message}",
|
2015-02-06 08:59:08 +00:00
|
|
|
},
|
2015-02-23 13:49:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# switch to org tab, verify if ticket is shown
|
|
|
|
organization_open_by_search(
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'Zammad Foundation',
|
2015-02-23 13:49:40 +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: "org profile check #{message}",
|
2015-02-23 13:49:40 +00:00
|
|
|
)
|
2015-02-23 15:35:48 +00:00
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
# work with two browser windows
|
2020-09-30 09:07:01 +00:00
|
|
|
message = "comment 1 #{rand(99_999_999_999_999_999)}"
|
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
|
|
|
)
|
|
|
|
|
|
|
|
organization_open_by_search(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser1,
|
2018-12-19 17:31:51 +00:00
|
|
|
value: 'Zammad Foundation',
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
organization_open_by_search(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
2018-12-19 17:31:51 +00:00
|
|
|
value: 'Zammad Foundation',
|
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 .profile [data-name="note"]',
|
2019-12-23 09:37:47 +00:00
|
|
|
slow: true,
|
2018-12-19 17:31:51 +00:00
|
|
|
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
|
|
|
)
|
|
|
|
|
|
|
|
# verify
|
|
|
|
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
|
2018-08-03 12:55:15 +00:00
|
|
|
|
|
|
|
def test_org_profile_user_active_update
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
|
|
|
username: 'master@example.com',
|
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2018-08-03 12:55:15 +00:00
|
|
|
)
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
# search and open org
|
|
|
|
organization_open_by_search(
|
|
|
|
value: 'Zammad Foundation',
|
|
|
|
)
|
|
|
|
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .profile-window .userList-entry a.user-popover',
|
2018-08-03 12:55:15 +00:00
|
|
|
value: 'Nicole Braun',
|
|
|
|
)
|
|
|
|
|
|
|
|
exists(
|
|
|
|
css: '.active .profile-window .userList-entry .avatar--unique',
|
|
|
|
)
|
|
|
|
|
|
|
|
# open user and change status to inactive
|
|
|
|
click(
|
|
|
|
css: '.active .profile-window .userList-entry a.user-popover',
|
|
|
|
)
|
|
|
|
click(
|
|
|
|
css: '.active .profile-window .dropdown #userAction',
|
|
|
|
)
|
|
|
|
click(
|
|
|
|
css: '.active .profile-window .dropdown li[data-type="edit"]',
|
|
|
|
)
|
|
|
|
modal_ready()
|
|
|
|
|
|
|
|
select(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .modal select[name="active"]',
|
2018-08-03 12:55:15 +00:00
|
|
|
value: 'inactive'
|
|
|
|
)
|
|
|
|
|
|
|
|
click(
|
|
|
|
css: '.modal .js-submit',
|
|
|
|
)
|
|
|
|
|
|
|
|
modal_disappear()
|
|
|
|
|
|
|
|
# go back to the org and check for inactive status update
|
|
|
|
click(
|
|
|
|
css: '#navigation .nav-tab[data-key="Organization-1"]',
|
|
|
|
)
|
|
|
|
|
|
|
|
watch_for(
|
|
|
|
css: '.active .profile-window .userList-entry .avatar--unique.avatar--inactive',
|
|
|
|
)
|
|
|
|
|
|
|
|
# open user and change status to active again
|
|
|
|
click(
|
|
|
|
css: '.active .profile-window .userList-entry a.user-popover',
|
|
|
|
)
|
|
|
|
click(
|
|
|
|
css: '.active .profile-window .dropdown #userAction',
|
|
|
|
)
|
|
|
|
click(
|
|
|
|
css: '.active .profile-window .dropdown li[data-type="edit"]',
|
|
|
|
)
|
|
|
|
modal_ready()
|
|
|
|
|
|
|
|
select(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .modal select[name="active"]',
|
2018-08-03 12:55:15 +00:00
|
|
|
value: 'active'
|
|
|
|
)
|
|
|
|
|
|
|
|
click(
|
|
|
|
css: '.modal .js-submit',
|
|
|
|
)
|
|
|
|
|
|
|
|
modal_disappear()
|
|
|
|
|
|
|
|
# go back to the org and check for active status update
|
|
|
|
click(
|
|
|
|
css: '#navigation .nav-tab[data-key="Organization-1"]',
|
|
|
|
)
|
|
|
|
|
|
|
|
watch_for(
|
|
|
|
css: '.active .profile-window .userList-entry .avatar--unique',
|
|
|
|
)
|
|
|
|
|
|
|
|
exists_not(
|
|
|
|
css: '.active .profile-window .userList-entry .avatar--unique.avatar--inactive',
|
|
|
|
)
|
|
|
|
end
|
2015-04-27 14:15:29 +00:00
|
|
|
end
|