trabajo-afectivo/test/browser/customer_ticket_create_test.rb

156 lines
3.7 KiB
Ruby
Raw Normal View History

2017-11-23 08:09:44 +00:00
2012-12-14 10:14:48 +00:00
require 'browser_test_helper'
2013-02-12 00:56:23 +00:00
class CustomerTicketCreateTest < TestCase
def test_customer_ticket_create
2015-02-22 22:20:05 +00:00
@browser = browser_instance
login(
username: 'nicole.braun@zammad.org',
password: 'test',
url: browser_url,
2015-02-22 22:20:05 +00:00
)
2015-02-22 22:20:05 +00:00
# customer ticket create
click(css: 'a[href="#new"]', only_if_exists: true)
2016-03-22 12:58:48 +00:00
click(css: 'a[href="#customer_ticket_new"]')
2015-02-22 22:20:05 +00:00
sleep 2
2015-02-22 22:20:05 +00:00
select(
css: '.newTicket select[name="group_id"]',
value: 'Users',
2015-02-22 22:20:05 +00:00
)
set(
css: '.newTicket input[name="title"]',
value: 'some subject 123äöü',
2015-02-22 22:20:05 +00:00
)
set(
css: '.newTicket [data-name="body"]',
value: 'some body 123äöü',
2015-02-22 22:20:05 +00:00
)
exists_not(
css: '.newTicket input[name="customer_id"]',
)
exists_not(
css: '.newTicket input[name="priority_id"]',
)
2016-03-22 12:58:48 +00:00
click(css: '.newTicket button.js-submit')
2015-02-22 22:20:05 +00:00
sleep 5
# check if ticket is shown
2016-03-22 12:58:48 +00:00
location_check(url: '#ticket/zoom/')
2015-02-22 22:20:05 +00:00
match(
css: '.active div.ticket-article',
value: 'some body 123äöü',
no_quote: true,
2015-02-22 22:20:05 +00:00
)
# update ticket
set(
css: '.content.active [data-name="body"]',
value: 'some body 1234 äöüß',
no_click: true,
2015-02-22 22:20:05 +00:00
)
2015-11-06 01:43:26 +00:00
task_type(
type: 'stayOnTab',
)
click(css: '.content.active .js-submit')
2015-02-22 22:20:05 +00:00
watch_for(
css: '.content.active div.ticket-article',
value: 'some body 1234 äöüß',
2015-02-22 22:20:05 +00:00
)
# now we want to verify the default followup state
# for this case we close the ticket first and then
# write a new article. If the content is written
# then the state should change initially to open
# close the ticket
select(
css: '.content.active [name="state_id"]',
value: 'closed',
)
set(
css: '.content.active [data-name="body"]',
value: 'close #1',
no_click: true,
)
click(css: '.content.active .js-submit')
watch_for(
css: '.content.active div.ticket-article',
value: 'close #1',
)
# check if the ticket is closed
match(
css: '.content.active .sidebar [name="state_id"]',
value: 'closed',
)
# type in new content into rte to trigger the default follow up state
set(
css: '.content.active [data-name="body"]',
value: 'some body blublub default followup for reopen check',
no_click: true,
)
# verify if the state has changed to open
watch_for(
css: '.content.active .sidebar [name="state_id"]',
value: 'open',
)
# no we verify the reverse way:
# if the body get changed to empty again then
# the default follow up state should get unset and
# will change to the the default ticket state.
# remove content from rte
set(
css: '.content.active [data-name="body"]',
value: '',
no_click: true,
)
# check if state changed to closed again
watch_for(
css: '.content.active .sidebar [name="state_id"]',
value: 'closed',
)
# type in new content into rte to trigger the default follow up state
set(
css: '.content.active [data-name="body"]',
value: 'some body blublub default followup for reopen check',
no_click: true,
)
# verify if the state has changed to open
watch_for(
css: '.content.active .sidebar [name="state_id"]',
value: 'open',
)
# submit and reload to check if the new state is set
click(css: '.content.active .js-submit')
watch_for(
css: '.content.active div.ticket-article',
value: 'some body blublub default followup for reopen check',
)
# verify if the state has changed to open
match(
css: '.content.active .sidebar [name="state_id"]',
value: 'open',
)
2012-12-14 10:14:48 +00:00
end
end