trabajo-afectivo/test/browser/agent_ticket_actions_level4_test.rb

132 lines
2.5 KiB
Ruby
Raw Normal View History

# encoding: utf-8
require 'browser_test_helper'
class AgentTicketActionLevel4Test < 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 8
# 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',
)
# finally create ticket
click( :css => '.content.active button.submit' )
sleep 5
location_check(
:url => '#ticket/zoom/',
)
# check ticket
match(
:css => '.active div.ticket-article',
:value => 'some body 4 - 123äöü',
)
ticket_id = nil
if @browser.current_url =~ /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(
:css => ".tasks a[href=\"#ticket/zoom/#{ticket_id}\"] .modified",
)
# reload
reload()
sleep 5
# 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