Improved tests.
This commit is contained in:
parent
6db57a6509
commit
258130d824
2 changed files with 93 additions and 26 deletions
|
@ -79,9 +79,14 @@ class PreferencesTest < TestCase
|
||||||
)
|
)
|
||||||
|
|
||||||
# check language in ticket create
|
# check language in ticket create
|
||||||
|
open_task(
|
||||||
|
:data => {
|
||||||
|
:title => 'Anruf',
|
||||||
|
}
|
||||||
|
)
|
||||||
verify_task(
|
verify_task(
|
||||||
:data => {
|
:data => {
|
||||||
:title => 'anruf',
|
:title => 'Anruf',
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
open_task(
|
open_task(
|
||||||
|
@ -106,8 +111,10 @@ class PreferencesTest < TestCase
|
||||||
)
|
)
|
||||||
|
|
||||||
# check language in ticket zoom
|
# check language in ticket zoom
|
||||||
ticket_open_by_search(
|
open_task(
|
||||||
:number => ticket[:number],
|
:data => {
|
||||||
|
:title => 'preferences lang check #2',
|
||||||
|
}
|
||||||
)
|
)
|
||||||
watch_for(
|
watch_for(
|
||||||
:css => '.content.active',
|
:css => '.content.active',
|
||||||
|
@ -186,9 +193,14 @@ class PreferencesTest < TestCase
|
||||||
)
|
)
|
||||||
|
|
||||||
# check language in ticket create
|
# check language in ticket create
|
||||||
|
open_task(
|
||||||
|
:data => {
|
||||||
|
:title => 'Call',
|
||||||
|
}
|
||||||
|
)
|
||||||
verify_task(
|
verify_task(
|
||||||
:data => {
|
:data => {
|
||||||
:title => 'call',
|
:title => 'Call',
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
open_task(
|
open_task(
|
||||||
|
@ -213,8 +225,10 @@ class PreferencesTest < TestCase
|
||||||
)
|
)
|
||||||
|
|
||||||
# check language in ticket zoom
|
# check language in ticket zoom
|
||||||
ticket_open_by_search(
|
open_task(
|
||||||
:number => ticket[:number],
|
:data => {
|
||||||
|
:title => 'preferences lang check #2',
|
||||||
|
}
|
||||||
)
|
)
|
||||||
watch_for(
|
watch_for(
|
||||||
:css => '.content.active',
|
:css => '.content.active',
|
||||||
|
@ -269,11 +283,11 @@ class PreferencesTest < TestCase
|
||||||
:css => 'body',
|
:css => 'body',
|
||||||
:value => 'Sprache',
|
:value => 'Sprache',
|
||||||
)
|
)
|
||||||
sleep 6
|
sleep 10
|
||||||
|
|
||||||
# check if language is still used after reload
|
# check if language is still used after reload
|
||||||
reload()
|
reload()
|
||||||
sleep 2
|
sleep 10
|
||||||
|
|
||||||
watch_for(
|
watch_for(
|
||||||
:css => 'body',
|
:css => 'body',
|
||||||
|
|
|
@ -1054,6 +1054,7 @@ wait untill text in selector disabppears
|
||||||
:browser => browser1,
|
:browser => browser1,
|
||||||
:data => {
|
:data => {
|
||||||
:title => '',
|
:title => '',
|
||||||
|
:customer => 'some_customer@example.com',
|
||||||
:body => 'some body',
|
:body => 'some body',
|
||||||
:group => 'some group',
|
:group => 'some group',
|
||||||
:state => 'closed',
|
:state => 'closed',
|
||||||
|
@ -1095,6 +1096,56 @@ wait untill text in selector disabppears
|
||||||
# :css => '.content.active .page-header .ticket-title-update',
|
# :css => '.content.active .page-header .ticket-title-update',
|
||||||
# :value => :tab,
|
# :value => :tab,
|
||||||
# },
|
# },
|
||||||
|
end
|
||||||
|
if data[:customer]
|
||||||
|
|
||||||
|
# select tab
|
||||||
|
click( :browser => instance, :css => '.active .tabsSidebar-tab[data-tab="customer"]')
|
||||||
|
|
||||||
|
click( :browser => instance, :css => '.active div[data-tab="customer"] .js-actions .select-arrow' )
|
||||||
|
click( :browser => instance, :css => '.active div[data-tab="customer"] .js-actions a[data-type="customer-change"]' )
|
||||||
|
watch_for(
|
||||||
|
:browser => instance,
|
||||||
|
:css => '.modal',
|
||||||
|
:value => 'change',
|
||||||
|
)
|
||||||
|
|
||||||
|
element = instance.find_elements( { :css => '.modal input[name="customer_id_completion"]' } )[0]
|
||||||
|
element.click
|
||||||
|
element.clear
|
||||||
|
|
||||||
|
# workaround, sometimes focus is not triggered
|
||||||
|
element.send_keys( data[:customer] )
|
||||||
|
sleep 4
|
||||||
|
|
||||||
|
# check if pulldown is open, it's not working stable via selenium
|
||||||
|
res = instance.execute_script( "$('.modal .user_autocompletion .js-recipientDropdown').hasClass('open')" )
|
||||||
|
#puts "res #{res.inspect}"
|
||||||
|
if !res
|
||||||
|
#puts "IS NOT OPEN!, open it"
|
||||||
|
instance.execute_script( "$('.modal .user_autocompletion .js-recipientDropdown').addClass('open')" )
|
||||||
|
end
|
||||||
|
element.send_keys( :arrow_down )
|
||||||
|
sleep 0.3
|
||||||
|
instance.find_elements( { :css => '.modal .user_autocompletion .recipientList-entry.js-user.is-active' } )[0].click
|
||||||
|
sleep 0.3
|
||||||
|
|
||||||
|
click( :browser => instance, :css => '.modal .js-submit' )
|
||||||
|
|
||||||
|
watch_for_disappear(
|
||||||
|
:browser => instance,
|
||||||
|
:css => '.modal',
|
||||||
|
)
|
||||||
|
|
||||||
|
watch_for(
|
||||||
|
:browser => instance,
|
||||||
|
:css => '.active .tabsSidebar',
|
||||||
|
:value => data[:customer],
|
||||||
|
)
|
||||||
|
|
||||||
|
# select tab
|
||||||
|
click( :browser => instance, :css => '.active .tabsSidebar-tab[data-tab="ticket"]')
|
||||||
|
|
||||||
end
|
end
|
||||||
if data[:body]
|
if data[:body]
|
||||||
#instance.execute_script( '$(".content.active div[data-name=body]").focus()' )
|
#instance.execute_script( '$(".content.active div[data-name=body]").focus()' )
|
||||||
|
@ -1127,6 +1178,7 @@ wait untill text in selector disabppears
|
||||||
sleep 0.2
|
sleep 0.2
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if data[:state] || data[:group] || data[:body]
|
||||||
found = nil
|
found = nil
|
||||||
(1..5).each {|loop|
|
(1..5).each {|loop|
|
||||||
if !found
|
if !found
|
||||||
|
@ -1144,6 +1196,7 @@ wait untill text in selector disabppears
|
||||||
if !found
|
if !found
|
||||||
raise "no discard message found"
|
raise "no discard message found"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if params[:do_not_submit]
|
if params[:do_not_submit]
|
||||||
assert( true, "ticket updated without submit" )
|
assert( true, "ticket updated without submit" )
|
||||||
|
@ -1393,7 +1446,7 @@ wait untill text in selector disabppears
|
||||||
user_create(
|
user_create(
|
||||||
:browser => browser2,
|
:browser => browser2,
|
||||||
:data => {
|
:data => {
|
||||||
:login => 'some login' + random,
|
#:login => 'some login' + random,
|
||||||
:firstname => 'Manage Firstname' + random,
|
:firstname => 'Manage Firstname' + random,
|
||||||
:lastname => 'Manage Lastname' + random,
|
:lastname => 'Manage Lastname' + random,
|
||||||
:email => user_email,
|
:email => user_email,
|
||||||
|
|
Loading…
Reference in a new issue