Improved translations, fixed test.

This commit is contained in:
Martin Edenhofer 2016-03-07 04:24:08 +01:00
parent ba2d92a15d
commit 8eb2c44304
2 changed files with 42 additions and 15 deletions

View file

@ -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',

View file

@ -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,16 +1353,29 @@ wait untill text in selector disabppears
end
sleep 1
if data[:group]
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')
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
end
end
if data[:priority]
element = instance.find_elements(css: '.active .newTicket select[name="priority_id"]')[0]
dropdown = Selenium::WebDriver::Support::Select.new(element)
@ -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,11 +1579,24 @@ wait untill text in selector disabppears
end
if data[:group]
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]
element = instance.find_elements(css: '.active .sidebar select[name="priority_id"]')[0]
@ -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