2015-02-06 08:59:08 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class AgentOrganizationProfileTest < TestCase
|
2015-02-23 15:35:48 +00:00
|
|
|
def test_org_profile
|
|
|
|
# work in one browser window
|
2015-04-27 13:43:34 +00:00
|
|
|
message = '1 ' + rand(99_999_999).to_s
|
|
|
|
note = 'some note ' + rand(99_999_999).to_s
|
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',
|
|
|
|
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
|
|
|
)
|
|
|
|
watch_for(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active .profile-window',
|
|
|
|
value: 'note',
|
2015-02-23 13:49:40 +00:00
|
|
|
)
|
|
|
|
watch_for(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active .profile-window',
|
|
|
|
value: 'member',
|
2015-02-23 13:49:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# update note
|
|
|
|
set(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active .profile [data-name="note"]',
|
|
|
|
value: note,
|
|
|
|
contenteditable: true,
|
2015-02-23 13:49:40 +00:00
|
|
|
)
|
2015-04-27 13:42:53 +00:00
|
|
|
click( css: '#global-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
|
2015-05-31 22:47:53 +00:00
|
|
|
click( css: '.active .js-action .icon-arrow-down', fast: true )
|
2015-04-27 13:42:53 +00:00
|
|
|
click( css: '.active .js-action a[data-type="edit"]' )
|
2015-02-23 13:49:40 +00:00
|
|
|
|
|
|
|
watch_for(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active .modal',
|
|
|
|
value: 'note',
|
2015-02-23 13:49:40 +00:00
|
|
|
)
|
|
|
|
watch_for(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active .modal',
|
|
|
|
value: note,
|
2015-02-23 13:49:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
set(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active .modal [data-name="note"]',
|
|
|
|
value: 'some note abc',
|
2015-02-23 13:49:40 +00:00
|
|
|
)
|
2015-04-27 13:42:53 +00:00
|
|
|
click( css: '.active .modal button.js-submit' )
|
2015-02-23 13:49:40 +00:00
|
|
|
|
|
|
|
watch_for(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active .profile-window',
|
|
|
|
value: 'some note abc',
|
2015-02-23 13:49:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# create new ticket
|
|
|
|
ticket_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
|
|
|
customer: 'nico',
|
|
|
|
group: 'Users',
|
|
|
|
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(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active .profile-window',
|
|
|
|
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
|
2015-04-27 13:43:34 +00:00
|
|
|
message = 'comment 1 ' + rand(99_999_999_999_999_999).to_s
|
2015-02-23 15:35:48 +00:00
|
|
|
|
|
|
|
# use current session
|
|
|
|
browser1 = @browser
|
|
|
|
|
|
|
|
browser2 = browser_instance
|
|
|
|
login(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
|
|
|
username: 'agent1@example.com',
|
|
|
|
password: 'test',
|
|
|
|
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,
|
|
|
|
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,
|
|
|
|
value: 'Zammad Foundation',
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# update note
|
|
|
|
set(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser1,
|
|
|
|
css: '.active .profile [data-name="note"]',
|
|
|
|
value: message,
|
|
|
|
contenteditable: true,
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
click(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser1,
|
|
|
|
css: '#global-search',
|
2015-02-23 15:35:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# verify
|
|
|
|
watch_for(
|
2015-04-27 13:42:53 +00:00
|
|
|
browser: browser2,
|
|
|
|
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
|