2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2017-11-24 15:54:56 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class AgentTicketCreateResetCustomerSelectionTest < TestCase
|
|
|
|
def test_clear_customer
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
2021-08-17 12:10:02 +00:00
|
|
|
username: 'admin@example.com',
|
2017-11-24 15:54:56 +00:00
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2017-11-24 15:54:56 +00:00
|
|
|
)
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2017-11-24 15:54:56 +00:00
|
|
|
|
2018-03-06 05:30:12 +00:00
|
|
|
click(css: 'a[href="#new"]', only_if_exists: true)
|
2017-11-24 15:54:56 +00:00
|
|
|
click(css: 'a[href="#ticket/create"]')
|
2018-05-21 22:58:50 +00:00
|
|
|
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .newTicket',
|
2018-05-21 22:58:50 +00:00
|
|
|
timeout: 3,
|
|
|
|
)
|
2017-11-24 15:54:56 +00:00
|
|
|
|
|
|
|
exists(css: '.content.active .newTicket')
|
|
|
|
exists(css: '.content.active .tabsSidebar .sidebar[data-tab="template"]')
|
|
|
|
exists(css: '.content.active .tabsSidebar .tabsSidebar-tab.active[data-tab="template"]')
|
|
|
|
|
|
|
|
exists_not(css: '.content.active .tabsSidebar .sidebar[data-tab="customer"]')
|
|
|
|
exists_not(css: '.content.active .tabsSidebar .tabsSidebar-tab[data-tab="customer"]')
|
|
|
|
|
|
|
|
click(css: '.content.active .newTicket [name="customer_id_completion"]')
|
|
|
|
|
|
|
|
# check if pulldown is open, it's not working stable via selenium
|
2021-07-16 13:38:01 +00:00
|
|
|
@browser.execute_script("$('.content.active .newTicket .js-recipientDropdown').addClass('open')")
|
2017-11-24 15:54:56 +00:00
|
|
|
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .newTicket input[name="customer_id_completion"]',
|
2017-11-24 15:54:56 +00:00
|
|
|
value: 'nicole',
|
|
|
|
)
|
2018-05-21 22:58:50 +00:00
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .newTicket .js-recipientDropdown .recipientList.is-shown',
|
|
|
|
value: 'Nicole',
|
2018-05-21 22:58:50 +00:00
|
|
|
timeout: 3,
|
|
|
|
)
|
2017-11-24 15:54:56 +00:00
|
|
|
sendkey(value: :enter)
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
exists(css: '.content.active .newTicket')
|
|
|
|
exists(css: '.content.active .tabsSidebar .sidebar[data-tab="template"]')
|
|
|
|
exists(css: '.content.active .tabsSidebar .tabsSidebar-tab.active[data-tab="template"]')
|
|
|
|
|
|
|
|
exists(css: '.content.active .tabsSidebar .sidebar[data-tab="customer"]')
|
|
|
|
exists(css: '.content.active .tabsSidebar .tabsSidebar-tab[data-tab="customer"]')
|
|
|
|
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .newTicket input[name="customer_id_completion"]',
|
2017-11-24 15:54:56 +00:00
|
|
|
value: '',
|
|
|
|
)
|
|
|
|
sendkey(value: :backspace)
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
exists(css: '.content.active .newTicket')
|
|
|
|
exists(css: '.content.active .tabsSidebar .sidebar[data-tab="template"]')
|
|
|
|
exists(css: '.content.active .tabsSidebar .tabsSidebar-tab.active[data-tab="template"]')
|
|
|
|
|
|
|
|
exists_not(css: '.content.active .tabsSidebar .sidebar[data-tab="customer"]')
|
|
|
|
exists_not(css: '.content.active .tabsSidebar .tabsSidebar-tab[data-tab="customer"]')
|
|
|
|
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .newTicket input[name="title"]',
|
2017-11-24 15:54:56 +00:00
|
|
|
value: 'some title',
|
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .newTicket div[data-name="body"]',
|
2017-11-24 15:54:56 +00:00
|
|
|
value: 'some body',
|
|
|
|
)
|
|
|
|
select(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .newTicket select[name="group_id"]',
|
2017-11-24 15:54:56 +00:00
|
|
|
value: 'Users',
|
|
|
|
)
|
|
|
|
click(css: '.content.active .newTicket .js-submit')
|
|
|
|
|
|
|
|
watch_for(
|
|
|
|
css: '.content.active .newTicket .user_autocompletion.form-group.has-error',
|
|
|
|
)
|
|
|
|
|
|
|
|
# cleanup
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2017-11-24 15:54:56 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_clear_customer_use_email
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
2021-08-17 12:10:02 +00:00
|
|
|
username: 'admin@example.com',
|
2017-11-24 15:54:56 +00:00
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2017-11-24 15:54:56 +00:00
|
|
|
)
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2017-11-24 15:54:56 +00:00
|
|
|
|
2018-03-06 05:30:12 +00:00
|
|
|
click(css: 'a[href="#new"]', only_if_exists: true)
|
2017-11-24 15:54:56 +00:00
|
|
|
click(css: 'a[href="#ticket/create"]')
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
exists(css: '.content.active .newTicket')
|
|
|
|
exists(css: '.content.active .tabsSidebar .sidebar[data-tab="template"]')
|
|
|
|
exists(css: '.content.active .tabsSidebar .tabsSidebar-tab.active[data-tab="template"]')
|
|
|
|
|
|
|
|
exists_not(css: '.content.active .tabsSidebar .sidebar[data-tab="customer"]')
|
|
|
|
exists_not(css: '.content.active .tabsSidebar .tabsSidebar-tab[data-tab="customer"]')
|
|
|
|
|
|
|
|
click(css: '.content.active .newTicket [name="customer_id_completion"]')
|
|
|
|
|
|
|
|
# check if pulldown is open, it's not working stable via selenium
|
2021-07-16 13:38:01 +00:00
|
|
|
@browser.execute_script("$('.content.active .newTicket .js-recipientDropdown').addClass('open')")
|
2017-11-24 15:54:56 +00:00
|
|
|
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .newTicket input[name="customer_id_completion"]',
|
2017-11-24 15:54:56 +00:00
|
|
|
value: 'nicole',
|
|
|
|
)
|
2018-05-21 22:58:50 +00:00
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .newTicket .js-recipientDropdown .recipientList.is-shown',
|
|
|
|
value: 'Nicole',
|
2018-05-21 22:58:50 +00:00
|
|
|
timeout: 3,
|
|
|
|
)
|
2017-11-24 15:54:56 +00:00
|
|
|
sendkey(value: :enter)
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
exists(css: '.content.active .newTicket')
|
|
|
|
exists(css: '.content.active .tabsSidebar .sidebar[data-tab="template"]')
|
|
|
|
exists(css: '.content.active .tabsSidebar .tabsSidebar-tab.active[data-tab="template"]')
|
|
|
|
|
|
|
|
exists(css: '.content.active .tabsSidebar .sidebar[data-tab="customer"]')
|
|
|
|
exists(css: '.content.active .tabsSidebar .tabsSidebar-tab[data-tab="customer"]')
|
|
|
|
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .newTicket input[name="customer_id_completion"]',
|
2017-11-24 15:54:56 +00:00
|
|
|
value: '',
|
|
|
|
)
|
|
|
|
sendkey(value: :backspace)
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
exists(css: '.content.active .newTicket')
|
|
|
|
exists(css: '.content.active .tabsSidebar .sidebar[data-tab="template"]')
|
|
|
|
exists(css: '.content.active .tabsSidebar .tabsSidebar-tab.active[data-tab="template"]')
|
|
|
|
|
|
|
|
exists_not(css: '.content.active .tabsSidebar .sidebar[data-tab="customer"]')
|
|
|
|
exists_not(css: '.content.active .tabsSidebar .tabsSidebar-tab[data-tab="customer"]')
|
|
|
|
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .newTicket input[name="customer_id_completion"]',
|
2017-11-24 15:54:56 +00:00
|
|
|
value: 'somecustomer_not_existing_right_now@example.com',
|
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .newTicket input[name="title"]',
|
2017-11-24 15:54:56 +00:00
|
|
|
value: 'some title',
|
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .newTicket div[data-name="body"]',
|
2017-11-24 15:54:56 +00:00
|
|
|
value: 'some body',
|
|
|
|
)
|
|
|
|
select(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .newTicket select[name="group_id"]',
|
2017-11-24 15:54:56 +00:00
|
|
|
value: 'Users',
|
|
|
|
)
|
|
|
|
click(css: '.content.active .newTicket .js-submit')
|
|
|
|
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .ticketZoom-header .ticket-number',
|
2017-11-24 15:54:56 +00:00
|
|
|
value: '\d',
|
|
|
|
)
|
|
|
|
|
|
|
|
click(css: '.content.active .tabsSidebar-tabs .tabsSidebar-tab[data-tab="customer"]')
|
|
|
|
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .tabsSidebar .sidebar[data-tab="customer"]',
|
2017-11-24 15:54:56 +00:00
|
|
|
value: 'somecustomer_not_existing_right_now@example.com',
|
|
|
|
)
|
|
|
|
|
|
|
|
click(css: '.content.active .tabsSidebar .sidebar[data-tab="customer"] .js-actions')
|
|
|
|
click(css: '.content.active .tabsSidebar .sidebar[data-tab="customer"] .js-actions li[data-type="customer-change"]')
|
|
|
|
|
2021-07-16 13:29:38 +00:00
|
|
|
modal_ready
|
2017-11-24 15:54:56 +00:00
|
|
|
|
|
|
|
exists_not(
|
|
|
|
css: '.content.active .modal .user_autocompletion.form-group.has-error',
|
|
|
|
)
|
|
|
|
|
|
|
|
click(css: '.content.active .modal .js-submit')
|
|
|
|
|
|
|
|
watch_for(
|
|
|
|
css: '.content.active .modal .user_autocompletion.form-group.has-error',
|
|
|
|
)
|
|
|
|
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .modal input[name="customer_id_completion"]',
|
2021-08-20 08:56:23 +00:00
|
|
|
value: 'admin',
|
2017-11-24 15:54:56 +00:00
|
|
|
)
|
|
|
|
click(css: '.content.active .modal .js-submit')
|
|
|
|
|
|
|
|
watch_for(
|
|
|
|
css: '.content.active .modal .user_autocompletion.form-group.has-error',
|
|
|
|
)
|
|
|
|
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .modal input[name="customer_id_completion"]',
|
2021-08-20 08:56:23 +00:00
|
|
|
value: 'admin',
|
2017-11-24 15:54:56 +00:00
|
|
|
)
|
2018-05-21 22:58:50 +00:00
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .modal .js-recipientDropdown .recipientList.is-shown',
|
2021-08-20 08:56:23 +00:00
|
|
|
value: 'Admin',
|
2018-05-21 22:58:50 +00:00
|
|
|
timeout: 3,
|
|
|
|
)
|
2017-11-24 15:54:56 +00:00
|
|
|
sendkey(value: :enter)
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .modal input[name="customer_id_completion"]',
|
2017-11-24 15:54:56 +00:00
|
|
|
value: '',
|
|
|
|
)
|
|
|
|
sendkey(value: :backspace)
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
click(css: '.content.active .modal .js-submit')
|
|
|
|
|
|
|
|
watch_for(
|
|
|
|
css: '.content.active .modal .user_autocompletion.form-group.has-error',
|
|
|
|
)
|
|
|
|
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .modal input[name="customer_id_completion"]',
|
2021-08-20 08:56:23 +00:00
|
|
|
value: 'admin',
|
2017-11-24 15:54:56 +00:00
|
|
|
)
|
2018-05-21 22:58:50 +00:00
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .modal .js-recipientDropdown .recipientList.is-shown',
|
2021-08-20 08:56:23 +00:00
|
|
|
value: 'Admin',
|
2018-05-21 22:58:50 +00:00
|
|
|
timeout: 3,
|
|
|
|
)
|
2017-11-24 15:54:56 +00:00
|
|
|
sendkey(value: :enter)
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
click(css: '.content.active .modal .js-submit')
|
2021-07-16 13:44:10 +00:00
|
|
|
# click(css: '.content.active .tabsSidebar-tabs .tabsSidebar-tab[data-tab="customer"]')
|
2017-11-24 15:54:56 +00:00
|
|
|
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active .tabsSidebar .sidebar[data-tab="customer"]',
|
2021-08-17 12:10:02 +00:00
|
|
|
value: 'admin@example.com',
|
2017-11-24 15:54:56 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# cleanup
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2017-11-24 15:54:56 +00:00
|
|
|
end
|
|
|
|
end
|