From 4d7db317ccf560b6b3e0a82310f4b5c64aacc8e1 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Tue, 6 Mar 2018 13:49:30 +0100 Subject: [PATCH] Added browser test to verify the fix. --- script/build/test_slice_tests.sh | 6 +++ .../customer_ticket_create_fields_test.rb | 48 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 test/browser/customer_ticket_create_fields_test.rb diff --git a/script/build/test_slice_tests.sh b/script/build/test_slice_tests.sh index 470d66942..7fd644c28 100755 --- a/script/build/test_slice_tests.sh +++ b/script/build/test_slice_tests.sh @@ -42,6 +42,7 @@ if [ "$LEVEL" == '1' ]; then rm test/browser/agent_user_profile_test.rb # test/browser/auth_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/first_steps_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/auth_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/first_steps_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/auth_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/first_steps_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/auth_test.rb rm test/browser/chat_test.rb + # test/browser/customer_ticket_create_fields_test.rb # test/browser/customer_ticket_create_test.rb rm test/browser/first_steps_test.rb rm test/browser/form_test.rb @@ -281,6 +285,7 @@ elif [ "$LEVEL" == '5' ]; then # test/browser/agent_user_profile_test.rb rm test/browser/auth_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/first_steps_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/auth_test.rb # test/browser/chat_test.rb + rm test/browser/customer_ticket_create_fields_test.rb rm test/browser/customer_ticket_create_test.rb # test/browser/first_steps_test.rb rm test/browser/form_test.rb diff --git a/test/browser/customer_ticket_create_fields_test.rb b/test/browser/customer_ticket_create_fields_test.rb new file mode 100644 index 000000000..a136beb7f --- /dev/null +++ b/test/browser/customer_ticket_create_fields_test.rb @@ -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