2013-07-13 11:10:46 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
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',
|
|
|
|
url: browser_url,
|
2015-03-01 09:11:13 +00:00
|
|
|
)
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
# create ticket
|
|
|
|
ticket_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
|
|
|
customer: 'nicole',
|
|
|
|
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
|
|
|
|
match(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active .sidebar[data-tab="customer"]',
|
|
|
|
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
|
|
|
|
reload()
|
|
|
|
|
|
|
|
# check if customer is still shown in sidebar
|
|
|
|
watch_for(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active .sidebar[data-tab="customer"]',
|
|
|
|
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(
|
2015-04-27 13:42:53 +00:00
|
|
|
css: '.active div.ticket-article',
|
|
|
|
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
|
|
|
|
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
|
|
|
|
reload()
|
|
|
|
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
|
|
|
|
tasks_close_all()
|
2013-07-13 11:10:46 +00:00
|
|
|
end
|
2015-04-27 14:15:29 +00:00
|
|
|
end
|