Added browser test to verify the fix.

This commit is contained in:
Thorsten Eckel 2018-03-06 13:49:30 +01:00
parent 414d739ff8
commit 4d7db317cc
2 changed files with 54 additions and 0 deletions

View file

@ -42,6 +42,7 @@ if [ "$LEVEL" == '1' ]; then
rm test/browser/agent_user_profile_test.rb rm test/browser/agent_user_profile_test.rb
# test/browser/auth_test.rb # test/browser/auth_test.rb
rm test/browser/chat_test.rb rm test/browser/chat_test.rb
rm test/browser/customer_ticket_create_fields_test.rb
rm test/browser/customer_ticket_create_test.rb rm test/browser/customer_ticket_create_test.rb
rm test/browser/first_steps_test.rb rm test/browser/first_steps_test.rb
# test/browser/form_test.rb # test/browser/form_test.rb
@ -102,6 +103,7 @@ elif [ "$LEVEL" == '2' ]; then
rm test/browser/agent_user_profile_test.rb rm test/browser/agent_user_profile_test.rb
rm test/browser/auth_test.rb rm test/browser/auth_test.rb
rm test/browser/chat_test.rb rm test/browser/chat_test.rb
rm test/browser/customer_ticket_create_fields_test.rb
rm test/browser/customer_ticket_create_test.rb rm test/browser/customer_ticket_create_test.rb
rm test/browser/first_steps_test.rb rm test/browser/first_steps_test.rb
rm test/browser/form_test.rb rm test/browser/form_test.rb
@ -162,6 +164,7 @@ elif [ "$LEVEL" == '3' ]; then
rm test/browser/agent_user_profile_test.rb rm test/browser/agent_user_profile_test.rb
rm test/browser/auth_test.rb rm test/browser/auth_test.rb
rm test/browser/chat_test.rb rm test/browser/chat_test.rb
rm test/browser/customer_ticket_create_fields_test.rb
rm test/browser/customer_ticket_create_test.rb rm test/browser/customer_ticket_create_test.rb
rm test/browser/first_steps_test.rb rm test/browser/first_steps_test.rb
rm test/browser/form_test.rb rm test/browser/form_test.rb
@ -222,6 +225,7 @@ elif [ "$LEVEL" == '4' ]; then
rm test/browser/agent_user_profile_test.rb rm test/browser/agent_user_profile_test.rb
rm test/browser/auth_test.rb rm test/browser/auth_test.rb
rm test/browser/chat_test.rb rm test/browser/chat_test.rb
# test/browser/customer_ticket_create_fields_test.rb
# test/browser/customer_ticket_create_test.rb # test/browser/customer_ticket_create_test.rb
rm test/browser/first_steps_test.rb rm test/browser/first_steps_test.rb
rm test/browser/form_test.rb rm test/browser/form_test.rb
@ -281,6 +285,7 @@ elif [ "$LEVEL" == '5' ]; then
# test/browser/agent_user_profile_test.rb # test/browser/agent_user_profile_test.rb
rm test/browser/auth_test.rb rm test/browser/auth_test.rb
rm test/browser/chat_test.rb rm test/browser/chat_test.rb
rm test/browser/customer_ticket_create_fields_test.rb
rm test/browser/customer_ticket_create_test.rb rm test/browser/customer_ticket_create_test.rb
rm test/browser/first_steps_test.rb rm test/browser/first_steps_test.rb
rm test/browser/form_test.rb rm test/browser/form_test.rb
@ -343,6 +348,7 @@ elif [ "$LEVEL" == '6' ]; then
rm test/browser/agent_user_profile_test.rb rm test/browser/agent_user_profile_test.rb
rm test/browser/auth_test.rb rm test/browser/auth_test.rb
# test/browser/chat_test.rb # test/browser/chat_test.rb
rm test/browser/customer_ticket_create_fields_test.rb
rm test/browser/customer_ticket_create_test.rb rm test/browser/customer_ticket_create_test.rb
# test/browser/first_steps_test.rb # test/browser/first_steps_test.rb
rm test/browser/form_test.rb rm test/browser/form_test.rb

View file

@ -0,0 +1,48 @@
require 'browser_test_helper'
class CustomerTicketCreateFieldsTest < TestCase
def test_customer_ticket_create
@browser = browser_instance
# create agent session and fetch object attributes
login(
browser: browser,
username: 'master@example.com',
password: 'test',
url: browser_url,
)
# remove local object attributes bound to the session
logout()
# re-create agent session and fetch object attributes
login(
browser: browser,
username: 'master@example.com',
password: 'test',
url: browser_url,
)
# re-remove local object attributes bound to the session
# there was an issue (#1856) where the old attribute values
# persisted and were stored as the original attributes
logout()
# create customer session and fetch object attributes
login(
username: 'nicole.braun@zammad.org',
password: 'test',
url: browser_url,
)
# customer ticket create
click(css: 'a[href="#new"]', only_if_exists: true)
click(css: 'a[href="#customer_ticket_new"]')
sleep 2
# ensure that the object attributes of the agent session
# were removed properly and won't get displayed in the form
exists_not(
css: '.newTicket input[name="customer_id"]',
)
end
end