trabajo-afectivo/test/browser/agent_ticket_update_and_reload_test.rb

134 lines
2.4 KiB
Ruby
Raw Normal View History

# encoding: utf-8
require 'browser_test_helper'
2016-09-05 13:18:22 +00:00
class AgentTicketUpdateAndReloadTest < TestCase
def test_agent_ticket_create_with_reload
@browser = browser_instance
login(
username: 'agent1@example.com',
password: 'test',
url: browser_url,
)
tasks_close_all()
# create ticket
ticket_create(
data: {
customer: 'nicole',
group: 'Users',
title: 'some subject 4 - 123äöü',
body: 'some body 4 - 123äöü',
},
do_not_submit: true,
)
sleep 6
# check if customer is shown in sidebar
match(
css: '.active .sidebar[data-tab="customer"]',
value: 'nicole',
)
# check task title
verify_task(
data: {
title: 'some subject 4 - 123äöü',
}
)
# check page title
verify_title(
value: 'some subject 4 - 123äöü',
)
# reload instances, verify autosave
reload()
# check if customer is still shown in sidebar
watch_for(
css: '.active .sidebar[data-tab="customer"]',
value: 'nicole',
)
2016-03-31 22:23:09 +00:00
sleep 2
# finally create ticket
click(css: '.content.active .js-submit')
sleep 5
location_check(
url: '#ticket/zoom/',
)
# check ticket
match(
css: '.active div.ticket-article',
value: 'some body 4 - 123äöü',
)
ticket_id = nil
2015-04-27 19:56:07 +00:00
if @browser.current_url =~ %r{ticket/zoom/(.+?)$}i
ticket_id = $1
end
# check task title
verify_task(
data: {
title: 'some subject 4 - 123äöü',
}
)
# check page title
verify_title(
value: 'some subject 4 - 123äöü',
)
# check if task is not marked as modified
exists(
css: ".tasks a[href=\"#ticket/zoom/#{ticket_id}\"]",
)
exists_not(
2015-06-01 10:38:10 +00:00
css: ".tasks a[href=\"#ticket/zoom/#{ticket_id}\"].is-modified",
)
# reload
reload()
sleep 4
# check task title
verify_task(
data: {
title: 'some subject 4 - 123äöü',
}
)
# check page title
verify_title(
value: 'some subject 4 - 123äöü',
)
# go to dashboard
location(
url: browser_url
)
sleep 5
# check page title
verify_title(
value: 'Dashboard',
)
# reload
reload()
sleep 5
# check page title
verify_title(
value: 'Dashboard',
)
# cleanup
tasks_close_all()
end
end