From 8eb2c44304b3c3244db6665079aa91b8c191d367 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 7 Mar 2016 04:24:08 +0100 Subject: [PATCH] Improved translations, fixed test. --- .../agent_ticket_actions_level8_test.rb | 2 +- test/browser_test_helper.rb | 55 ++++++++++++++----- 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/test/browser/agent_ticket_actions_level8_test.rb b/test/browser/agent_ticket_actions_level8_test.rb index 857bfe41a..2be09307e 100644 --- a/test/browser/agent_ticket_actions_level8_test.rb +++ b/test/browser/agent_ticket_actions_level8_test.rb @@ -139,7 +139,7 @@ class AgentTicketActionLevel8Test < TestCase ) select( css: '.content.active .modal-body [name="link_type"]', - value: 'normal', + value: 'Normal', ) click( css: '.content.active .modal-footer .js-submit', diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index 18ee518cb..1aaa66ee7 100644 --- a/test/browser_test_helper.rb +++ b/test/browser_test_helper.rb @@ -1320,7 +1320,7 @@ wait untill text in selector disabppears browser: browser1, data: { customer: 'nico', - group: 'Users', + group: 'Users', # optional / '-NONE-' # if group selection should not be shown priority: '2 normal', title: 'overview #1', body: 'overview #1', @@ -1353,15 +1353,28 @@ wait untill text in selector disabppears end sleep 1 - # check count of agents, should be only 1 / - selection on init screen - count = instance.find_elements(css: '.active .newTicket select[name="owner_id"] option').count - assert_equal(1, count, 'check if owner selection is empty per default' ) - if data[:group] - element = instance.find_elements(css: '.active .newTicket select[name="group_id"]')[0] - dropdown = Selenium::WebDriver::Support::Select.new(element) - dropdown.select_by(:text, data[:group]) - sleep 0.2 + if data[:group] == '-NONE-' + + # check if owner selection exists + count = instance.find_elements(css: '.active .newTicket select[name="group_id"] option').count + assert_equal(0, count, 'owner selection should not be showm') + + # check count of agents, should be only 3 / - selection + master + agent on init screen + count = instance.find_elements(css: '.active .newTicket select[name="owner_id"] option').count + assert_equal(3, count, 'check if owner selection is - selection + master + agent per default') + + else + + # check count of agents, should be only 1 / - selection on init screen + count = instance.find_elements(css: '.active .newTicket select[name="owner_id"] option').count + assert_equal(1, count, 'check if owner selection is empty per default') + + element = instance.find_elements(css: '.active .newTicket select[name="group_id"]')[0] + dropdown = Selenium::WebDriver::Support::Select.new(element) + dropdown.select_by(:text, data[:group]) + sleep 0.2 + end end if data[:priority] element = instance.find_elements(css: '.active .newTicket select[name="priority_id"]')[0] @@ -1460,7 +1473,7 @@ wait untill text in selector disabppears title: '', customer: 'some_customer@example.com', body: 'some body', - group: 'some group', + group: 'some group', # optional priority: '1 low', state: 'closed', }, @@ -1566,10 +1579,23 @@ wait untill text in selector disabppears end if data[:group] - element = instance.find_elements(css: '.active .sidebar select[name="group_id"]')[0] - dropdown = Selenium::WebDriver::Support::Select.new(element) - dropdown.select_by(:text, data[:group]) - sleep 0.2 + if data[:group] == '-NONE-' + + # check if owner selection exists + count = instance.find_elements(css: '.active .sidebar select[name="group_id"] option').count + assert_equal(0, count, 'owner selection should not be showm') + + # check count of agents, should be only 3 / - selection + master + agent on init screen + count = instance.find_elements(css: '.active .sidebar select[name="owner_id"] option').count + assert_equal(3, count, 'check if owner selection is - selection + master + agent per default') + + else + + element = instance.find_elements(css: '.active .sidebar select[name="group_id"]')[0] + dropdown = Selenium::WebDriver::Support::Select.new(element) + dropdown.select_by(:text, data[:group]) + sleep 0.2 + end end if data[:priority] @@ -2193,6 +2219,7 @@ wait untill text in selector disabppears #instance.find_elements(:css => 'label:contains(" ' + action[:name] + '")')[0].click instance.execute_script('$(\'label:contains(" ' + data[:name] + '")\').first().click()') instance.find_elements(css: '.modal button.js-submit')[0].click + sleep 3 } end end