2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2013-07-13 11:10:46 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
2016-09-05 13:18:22 +00:00
|
|
|
class AgentTicketUpdateAndReloadTest < TestCase
|
2013-07-13 11:10:46 +00:00
|
|
|
def test_agent_ticket_create_with_reload
|
2015-03-01 09:11:13 +00:00
|
|
|
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
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-03-01 09:11:13 +00:00
|
|
|
)
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2015-03-01 09:11:13 +00:00
|
|
|
|
|
|
|
# create ticket
|
|
|
|
ticket_create(
|
2018-12-19 17:31:51 +00:00
|
|
|
data: {
|
2015-04-27 13:42:53 +00:00
|
|
|
customer: 'nicole',
|
2018-12-19 17:31:51 +00:00
|
|
|
group: 'Users',
|
|
|
|
title: 'some subject 4 - 123äöü',
|
|
|
|
body: 'some body 4 - 123äöü',
|
2013-07-13 11:10:46 +00:00
|
|
|
},
|
2015-04-27 13:42:53 +00:00
|
|
|
do_not_submit: true,
|
2015-03-01 09:11:13 +00:00
|
|
|
)
|
2016-06-03 21:42:30 +00:00
|
|
|
sleep 6
|
2015-03-01 09:11:13 +00:00
|
|
|
|
|
|
|
# check if customer is shown in sidebar
|
2017-09-06 06:39:02 +00:00
|
|
|
click(css: '.active .tabsSidebar-tab[data-tab="customer"]')
|
2015-03-01 09:11:13 +00:00
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .sidebar[data-tab="customer"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'nicole',
|
2015-03-01 09:11:13 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check task title
|
|
|
|
verify_task(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
|
|
|
title: 'some subject 4 - 123äöü',
|
2015-03-01 09:11:13 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
# check page title
|
|
|
|
verify_title(
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some subject 4 - 123äöü',
|
2015-03-01 09:11:13 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# reload instances, verify autosave
|
2021-07-16 13:29:38 +00:00
|
|
|
reload
|
2015-03-01 09:11:13 +00:00
|
|
|
|
|
|
|
# check if customer is still shown in sidebar
|
2017-09-06 06:39:02 +00:00
|
|
|
click(css: '.active .tabsSidebar-tab[data-tab="customer"]')
|
2015-03-01 09:11:13 +00:00
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .sidebar[data-tab="customer"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'nicole',
|
2015-03-01 09:11:13 +00:00
|
|
|
)
|
2016-03-31 22:23:09 +00:00
|
|
|
sleep 2
|
2015-03-01 09:11:13 +00:00
|
|
|
|
|
|
|
# finally create ticket
|
2016-03-31 13:41:34 +00:00
|
|
|
click(css: '.content.active .js-submit')
|
2015-03-01 09:11:13 +00:00
|
|
|
sleep 5
|
|
|
|
|
|
|
|
location_check(
|
2015-04-27 13:42:53 +00:00
|
|
|
url: '#ticket/zoom/',
|
2015-03-01 09:11:13 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check ticket
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active div.ticket-article',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some body 4 - 123äöü',
|
2015-03-01 09:11:13 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
ticket_id = nil
|
2015-04-27 19:56:07 +00:00
|
|
|
if @browser.current_url =~ %r{ticket/zoom/(.+?)$}i
|
2015-03-01 09:11:13 +00:00
|
|
|
ticket_id = $1
|
|
|
|
end
|
|
|
|
|
|
|
|
# check task title
|
|
|
|
verify_task(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
|
|
|
title: 'some subject 4 - 123äöü',
|
2015-03-01 09:11:13 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
# check page title
|
|
|
|
verify_title(
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some subject 4 - 123äöü',
|
2015-03-01 09:11:13 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check if task is not marked as modified
|
|
|
|
exists(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: ".tasks a[href=\"#ticket/zoom/#{ticket_id}\"]",
|
2015-03-01 09:11:13 +00:00
|
|
|
)
|
|
|
|
exists_not(
|
2015-06-01 10:38:10 +00:00
|
|
|
css: ".tasks a[href=\"#ticket/zoom/#{ticket_id}\"].is-modified",
|
2015-03-01 09:11:13 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# reload
|
2021-07-16 13:29:38 +00:00
|
|
|
reload
|
2016-06-03 21:42:30 +00:00
|
|
|
sleep 4
|
2015-03-01 09:11:13 +00:00
|
|
|
|
|
|
|
# check task title
|
|
|
|
verify_task(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
|
|
|
title: 'some subject 4 - 123äöü',
|
2015-03-01 09:11:13 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
# check page title
|
|
|
|
verify_title(
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some subject 4 - 123äöü',
|
2015-03-01 09:11:13 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# go to dashboard
|
|
|
|
location(
|
2015-04-27 13:42:53 +00:00
|
|
|
url: browser_url
|
2015-03-01 09:11:13 +00:00
|
|
|
)
|
|
|
|
sleep 5
|
|
|
|
|
|
|
|
# check page title
|
|
|
|
verify_title(
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'Dashboard',
|
2015-03-01 09:11:13 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# reload
|
2021-07-16 13:29:38 +00:00
|
|
|
reload
|
2015-03-01 09:11:13 +00:00
|
|
|
sleep 5
|
|
|
|
|
|
|
|
# check page title
|
|
|
|
verify_title(
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'Dashboard',
|
2015-03-01 09:11:13 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# cleanup
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2013-07-13 11:10:46 +00:00
|
|
|
end
|
2015-04-27 14:15:29 +00:00
|
|
|
end
|