Improved object manager browser tests.
This commit is contained in:
parent
740e1dcfe8
commit
ed48d92a16
3 changed files with 117 additions and 6 deletions
|
@ -209,6 +209,7 @@ send via account
|
||||||
# ignore notifications in developer mode
|
# ignore notifications in developer mode
|
||||||
if notification == true && Setting.get('developer_mode') == true
|
if notification == true && Setting.get('developer_mode') == true
|
||||||
logger.notice "Do not send notification #{mail_params.inspect} because of enabled developer_mode"
|
logger.notice "Do not send notification #{mail_params.inspect} because of enabled developer_mode"
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
adapter = options[:adapter]
|
adapter = options[:adapter]
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
require 'browser_test_helper'
|
require 'browser_test_helper'
|
||||||
|
|
||||||
class AdminObjectManagerTest < TestCase
|
class AdminObjectManagerTest < TestCase
|
||||||
def test_basic
|
def test_basic_a
|
||||||
name = "some overview #{rand(99_999_999)}"
|
|
||||||
|
|
||||||
@browser = browser_instance
|
@browser = browser_instance
|
||||||
login(
|
login(
|
||||||
|
@ -114,11 +113,38 @@ class AdminObjectManagerTest < TestCase
|
||||||
click(css: '.modal button.js-submit')
|
click(css: '.modal button.js-submit')
|
||||||
|
|
||||||
# create new ticket
|
# create new ticket
|
||||||
|
ticket = ticket_create(
|
||||||
|
data: {
|
||||||
|
customer: 'nico',
|
||||||
|
group: 'Users',
|
||||||
|
priority: '2 normal',
|
||||||
|
state: 'open',
|
||||||
|
title: 'ticket attribute test #1',
|
||||||
|
body: 'ticket attribute test #1',
|
||||||
|
},
|
||||||
|
#custom_data_select: {
|
||||||
|
# key1: 'some value',
|
||||||
|
#},
|
||||||
|
custom_data_input: {
|
||||||
|
browser_test1: 'some value öäüß',
|
||||||
|
},
|
||||||
|
disable_group_check: true,
|
||||||
|
)
|
||||||
|
|
||||||
# update ticket
|
# update ticket
|
||||||
|
ticket_update(
|
||||||
|
data: {},
|
||||||
|
#custom_data_select: {
|
||||||
|
# key1: 'some value',
|
||||||
|
#},
|
||||||
|
custom_data_input: {
|
||||||
|
browser_test1: 'some value ABC',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
# discard new attribute
|
# discard new attribute
|
||||||
|
click(css: 'a[href="#manage"]')
|
||||||
|
click(css: 'a[href="#system/object_manager"]')
|
||||||
watch_for(
|
watch_for(
|
||||||
css: '#content table',
|
css: '#content table',
|
||||||
value: 'browser_test1',
|
value: 'browser_test1',
|
||||||
|
|
|
@ -1620,6 +1620,25 @@ wait untill text in selector disabppears
|
||||||
title: 'overview #1',
|
title: 'overview #1',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ticket = ticket_create(
|
||||||
|
browser: browser1,
|
||||||
|
data: {
|
||||||
|
customer: 'nico',
|
||||||
|
group: 'Users', # optional / '-NONE-' # if group selection should not be shown
|
||||||
|
priority: '2 normal',
|
||||||
|
state: 'open',
|
||||||
|
title: 'overview #1',
|
||||||
|
body: 'overview #1',
|
||||||
|
},
|
||||||
|
custom_data_select: {
|
||||||
|
key1: 'some value',
|
||||||
|
},
|
||||||
|
custom_data_input: {
|
||||||
|
key1: 'some value',
|
||||||
|
},
|
||||||
|
disable_group_check: true,
|
||||||
|
)
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
def ticket_create(params)
|
def ticket_create(params)
|
||||||
|
@ -1668,8 +1687,10 @@ wait untill text in selector disabppears
|
||||||
else
|
else
|
||||||
|
|
||||||
# check count of agents, should be only 1 / - selection on init screen
|
# check count of agents, should be only 1 / - selection on init screen
|
||||||
|
if !params[:disable_group_check]
|
||||||
count = instance.find_elements(css: '.active .newTicket select[name="owner_id"] option').count
|
count = instance.find_elements(css: '.active .newTicket select[name="owner_id"] option').count
|
||||||
assert_equal(1, count, 'check if owner selection is empty per default')
|
assert_equal(1, count, 'check if owner selection is empty per default')
|
||||||
|
end
|
||||||
select(
|
select(
|
||||||
browser: instance,
|
browser: instance,
|
||||||
css: '.active .newTicket select[name="group_id"]',
|
css: '.active .newTicket select[name="group_id"]',
|
||||||
|
@ -1735,6 +1756,28 @@ wait untill text in selector disabppears
|
||||||
sleep 0.4
|
sleep 0.4
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if params[:custom_data_select]
|
||||||
|
params[:custom_data_select].each {|local_key, local_value|
|
||||||
|
select(
|
||||||
|
browser: instance,
|
||||||
|
css: ".active .newTicket select[name=\"#{local_key}\"]",
|
||||||
|
value: local_value,
|
||||||
|
mute_log: true,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
end
|
||||||
|
if params[:custom_data_input]
|
||||||
|
params[:custom_data_input].each {|local_key, local_value|
|
||||||
|
set(
|
||||||
|
browser: instance,
|
||||||
|
css: ".active .newTicket input[name=\"#{local_key}\"]",
|
||||||
|
value: local_value,
|
||||||
|
clear: true,
|
||||||
|
mute_log: true,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
if data[:attachment]
|
if data[:attachment]
|
||||||
file_upload(
|
file_upload(
|
||||||
browser: instance,
|
browser: instance,
|
||||||
|
@ -1798,6 +1841,25 @@ wait untill text in selector disabppears
|
||||||
do_not_submit: true,
|
do_not_submit: true,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ticket_update(
|
||||||
|
browser: browser1,
|
||||||
|
data: {
|
||||||
|
title: '',
|
||||||
|
customer: 'some_customer@example.com',
|
||||||
|
body: 'some body',
|
||||||
|
group: 'some group', # optional
|
||||||
|
priority: '1 low',
|
||||||
|
state: 'closed',
|
||||||
|
},
|
||||||
|
custom_data_select: {
|
||||||
|
key1: 'some value',
|
||||||
|
},
|
||||||
|
custom_data_input: {
|
||||||
|
key1: 'some value',
|
||||||
|
},
|
||||||
|
do_not_submit: true,
|
||||||
|
)
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
def ticket_update(params)
|
def ticket_update(params)
|
||||||
|
@ -1933,7 +1995,29 @@ wait untill text in selector disabppears
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
if data[:state] || data[:group] || data[:body]
|
if params[:custom_data_select]
|
||||||
|
params[:custom_data_select].each {|local_key, local_value|
|
||||||
|
select(
|
||||||
|
browser: instance,
|
||||||
|
css: ".active .sidebar select[name=\"#{local_key}\"]",
|
||||||
|
value: local_value,
|
||||||
|
mute_log: true,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
end
|
||||||
|
if params[:custom_data_input]
|
||||||
|
params[:custom_data_input].each {|local_key, local_value|
|
||||||
|
set(
|
||||||
|
browser: instance,
|
||||||
|
css: ".active .sidebar input[name=\"#{local_key}\"]",
|
||||||
|
value: local_value,
|
||||||
|
clear: true,
|
||||||
|
mute_log: true,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
if data[:state] || data[:group] || data[:body] || !params[:custom_data_select].empty? || !params[:custom_data_input].empty?
|
||||||
found = nil
|
found = nil
|
||||||
(1..10).each {
|
(1..10).each {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue