Improved unit tests, added IE support.
This commit is contained in:
parent
dbd075fb98
commit
ac9e71c4f2
2 changed files with 54 additions and 6 deletions
|
@ -163,6 +163,24 @@ class AgentTicketActionsLevel2Test < TestCase
|
||||||
:link => '###stack###',
|
:link => '###stack###',
|
||||||
# :css => 'a:contains(\'###stack###\')',
|
# :css => 'a:contains(\'###stack###\')',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
:execute => 'wait',
|
||||||
|
:value => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:where => :instance2,
|
||||||
|
:execute => 'js',
|
||||||
|
:value => '$("#global-search").focus()',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:execute => 'wait',
|
||||||
|
:value => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:where => :instance2,
|
||||||
|
:execute => 'js',
|
||||||
|
:value => '$("#global-search").blur()',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
:execute => 'wait',
|
:execute => 'wait',
|
||||||
:value => 3,
|
:value => 3,
|
||||||
|
@ -176,18 +194,34 @@ class AgentTicketActionsLevel2Test < TestCase
|
||||||
},
|
},
|
||||||
|
|
||||||
# change title in second browser
|
# change title in second browser
|
||||||
|
# {
|
||||||
|
# :where => :instance2,
|
||||||
|
# :execute => 'sendkey',
|
||||||
|
# :css => '.active .ticket-title-update',
|
||||||
|
# :value => 'TTT',
|
||||||
|
# },
|
||||||
|
# {
|
||||||
|
# :where => :instance2,
|
||||||
|
# :execute => 'sendkey',
|
||||||
|
# :css => '.active .ticket-title-update',
|
||||||
|
# :value => :tab,
|
||||||
|
# },
|
||||||
{
|
{
|
||||||
:where => :instance2,
|
:where => :instance2,
|
||||||
:execute => 'sendkey',
|
:execute => 'js',
|
||||||
:css => '.active .ticket-title-update',
|
:value => '$(".active .ticket-title .ticket-title-update").focus()',
|
||||||
:value => 'TTT',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
:where => :instance2,
|
:where => :instance2,
|
||||||
:execute => 'sendkey',
|
:execute => 'js',
|
||||||
:css => '.active .ticket-title-update',
|
:value => '$(".active .ticket-title .ticket-title-update").html("TTTsome level 2 <b>subject</b> 123äöü")',
|
||||||
:value => :tab,
|
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
:where => :instance2,
|
||||||
|
:execute => 'js',
|
||||||
|
:value => '$(".active .ticket-title .ticket-title-update").blur()',
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
# set body in edit area
|
# set body in edit area
|
||||||
{
|
{
|
||||||
|
|
|
@ -193,6 +193,16 @@ class TestCase < Test::Unit::TestCase
|
||||||
assert( false, "(#{test[:name]}) not matching '#{action[:value]}' in title" )
|
assert( false, "(#{test[:name]}) not matching '#{action[:value]}' in title" )
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
|
elsif action[:element] == :cookie
|
||||||
|
cookies = instance.manage.all_cookies
|
||||||
|
cookies.each {|cookie|
|
||||||
|
if cookie.to_s =~ /#{action[:value]}/i
|
||||||
|
assert( true, "(#{test[:name]}) matching '#{action[:value]}' in cookie" )
|
||||||
|
return
|
||||||
|
end
|
||||||
|
}
|
||||||
|
assert( false, "(#{test[:name]}) not matching '#{action[:value]}' in cookie" )
|
||||||
|
return
|
||||||
elsif action[:element] == :alert
|
elsif action[:element] == :alert
|
||||||
element = instance.switch_to.alert
|
element = instance.switch_to.alert
|
||||||
elsif action[:execute] == 'close_all_tasks'
|
elsif action[:execute] == 'close_all_tasks'
|
||||||
|
@ -213,6 +223,9 @@ class TestCase < Test::Unit::TestCase
|
||||||
instance.navigate.to( action[:to] )
|
instance.navigate.to( action[:to] )
|
||||||
elsif action[:execute] == 'reload'
|
elsif action[:execute] == 'reload'
|
||||||
instance.navigate.refresh
|
instance.navigate.refresh
|
||||||
|
elsif action[:execute] == 'js'
|
||||||
|
result = instance.execute_script( action[:value] )
|
||||||
|
puts "JS RESULT" + result.inspect
|
||||||
elsif action[:link]
|
elsif action[:link]
|
||||||
if action[:link].match '###stack###'
|
if action[:link].match '###stack###'
|
||||||
action[:link].gsub! '###stack###', @stack
|
action[:link].gsub! '###stack###', @stack
|
||||||
|
@ -311,6 +324,7 @@ class TestCase < Test::Unit::TestCase
|
||||||
elsif action[:execute] == 'close_all_tasks'
|
elsif action[:execute] == 'close_all_tasks'
|
||||||
elsif action[:execute] == 'navigate'
|
elsif action[:execute] == 'navigate'
|
||||||
elsif action[:execute] == 'reload'
|
elsif action[:execute] == 'reload'
|
||||||
|
elsif action[:execute] == 'js'
|
||||||
else
|
else
|
||||||
assert( false, "(#{test[:name]}) unknow action '#{action[:execute]}'" )
|
assert( false, "(#{test[:name]}) unknow action '#{action[:execute]}'" )
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue