2018-04-23 13:12:19 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
# Regression test for UI bugfix
|
|
|
|
# https://github.com/zammad/zammad/issues/1669
|
|
|
|
#
|
|
|
|
# After creating a new ticket template, logging out, and logging back in,
|
|
|
|
# ensure that the template selection menu still contains the new entry.
|
|
|
|
class AgentTicketCreateTemplateTest < TestCase
|
|
|
|
def test_ticket_template_creation
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
|
|
|
username: 'agent1@example.com',
|
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2018-04-23 13:12:19 +00:00
|
|
|
)
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
click(
|
|
|
|
css: 'a[href="#ticket/create"]'
|
|
|
|
)
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .templates-welcome',
|
2018-04-23 13:12:19 +00:00
|
|
|
displayed: true
|
|
|
|
)
|
|
|
|
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: 'input[name="title"]',
|
2018-04-23 13:12:19 +00:00
|
|
|
value: 'my first ticket'
|
|
|
|
)
|
|
|
|
click(
|
|
|
|
css: '.active .templates-welcome .js-create'
|
|
|
|
)
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .templates-manage',
|
2018-04-23 13:12:19 +00:00
|
|
|
displayed: true,
|
2018-12-19 17:31:51 +00:00
|
|
|
timeout: 3,
|
2018-04-23 13:12:19 +00:00
|
|
|
)
|
|
|
|
exists_not(
|
|
|
|
css: '.active .templates-manage select[name="id"] > option:not([value=""])'
|
|
|
|
)
|
|
|
|
|
|
|
|
# save new template
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .templates-manage .js-name',
|
2018-04-23 13:12:19 +00:00
|
|
|
value: 'test template'
|
|
|
|
)
|
|
|
|
click(
|
|
|
|
css: '.active .templates-manage .js-save'
|
|
|
|
)
|
|
|
|
exists(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .templates-manage select[name="id"] > option:not([value=""])',
|
2018-04-23 13:12:19 +00:00
|
|
|
displayed: true
|
|
|
|
)
|
|
|
|
|
|
|
|
# check if relogin temlates are still available
|
|
|
|
logout
|
|
|
|
login(
|
|
|
|
username: 'agent1@example.com',
|
|
|
|
password: 'test',
|
|
|
|
)
|
|
|
|
|
|
|
|
click(
|
|
|
|
css: '.navigation > .tasks > a.task'
|
|
|
|
)
|
|
|
|
exists(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .templates-manage',
|
2018-04-23 13:12:19 +00:00
|
|
|
displayed: true
|
|
|
|
)
|
|
|
|
exists(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .templates-manage select[name="id"] > option:not([value=""])',
|
2018-04-23 13:12:19 +00:00
|
|
|
displayed: true
|
|
|
|
)
|
|
|
|
|
|
|
|
# apply new tempalte
|
|
|
|
tasks_close_all()
|
|
|
|
click(
|
|
|
|
css: 'a[href="#ticket/create"]'
|
|
|
|
)
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .templates-manage',
|
2018-04-23 13:12:19 +00:00
|
|
|
displayed: true,
|
2018-12-19 17:31:51 +00:00
|
|
|
timeout: 3,
|
2018-04-23 13:12:19 +00:00
|
|
|
)
|
|
|
|
select(
|
|
|
|
css: '.active .templates-manage select[name="id"]',
|
|
|
|
value: 'test template',
|
|
|
|
)
|
|
|
|
click(
|
|
|
|
css: '.active .templates-manage .js-apply'
|
|
|
|
)
|
|
|
|
exists(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .newTicket input[name="title"]',
|
2018-04-23 13:12:19 +00:00
|
|
|
value: 'my first ticket'
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|