Added implicit_wait for selenium tests.

This commit is contained in:
Martin Edenhofer 2013-07-15 12:22:02 +02:00
parent d25689e4b4
commit 96b2f542dc
5 changed files with 13 additions and 47 deletions

View file

@ -107,20 +107,15 @@ class AaaGettingStartedTest < TestCase
:execute => 'click', :execute => 'click',
:css => '#form-agent button[type="submit"]', :css => '#form-agent button[type="submit"]',
}, },
{
:execute => 'wait',
:value => 2,
},
{
:execute => 'check',
:css => '#login',
:result => false,
},
{ {
:execute => 'check', :execute => 'check',
:element => :url, :element => :url,
:result => '#getting_started', :result => '#getting_started',
}, },
{
:execute => 'wait',
:value => 2,
},
# check action # check action
{ {

View file

@ -71,12 +71,7 @@ class AgentTicketActionLevel1Test < TestCase
}, },
{ {
:execute => 'wait', :execute => 'wait',
:value => 5, :value => 6,
},
{
:execute => 'check',
:css => '#login',
:result => false,
}, },
{ {
:execute => 'check', :execute => 'check',
@ -202,12 +197,7 @@ class AgentTicketActionLevel1Test < TestCase
}, },
{ {
:execute => 'wait', :execute => 'wait',
:value => 5, :value => 6,
},
{
:execute => 'check',
:css => '#login',
:result => false,
}, },
{ {
:execute => 'check', :execute => 'check',
@ -245,7 +235,7 @@ class AgentTicketActionLevel1Test < TestCase
}, },
{ {
:execute => 'wait', :execute => 'wait',
:value => 4, :value => 5,
}, },
{ {
:execute => 'match', :execute => 'match',

View file

@ -27,10 +27,6 @@ class AgentTicketActionsLevel2Test < TestCase
:css => '#login', :css => '#login',
:result => false, :result => false,
}, },
{
:execute => 'wait',
:value => 1,
},
{ {
:where => :instance1, :where => :instance1,
:execute => 'close_all_tasks', :execute => 'close_all_tasks',
@ -61,10 +57,6 @@ class AgentTicketActionsLevel2Test < TestCase
:css => '.active .ticket_create', :css => '.active .ticket_create',
:result => true, :result => true,
}, },
{
:execute => 'wait',
:value => 1,
},
{ {
:where => :instance1, :where => :instance1,
:execute => 'set', :execute => 'set',
@ -232,8 +224,9 @@ class AgentTicketActionsLevel2Test < TestCase
:value => '$(".active .ticket-title .ticket-title-update").blur()', :value => '$(".active .ticket-title .ticket-title-update").blur()',
}, },
{ {
:execute => 'wait', :where => :instance2,
:value => 1, :execute => 'js',
:value => '$(".active .ticket-title .ticket-title-update").trigger("blur")',
}, },

View file

@ -27,10 +27,6 @@ class AgentTicketActionsLevel3Test < TestCase
:css => '#login', :css => '#login',
:result => false, :result => false,
}, },
{
:execute => 'wait',
:value => 1,
},
{ {
:where => :instance1, :where => :instance1,
:execute => 'close_all_tasks', :execute => 'close_all_tasks',
@ -61,10 +57,6 @@ class AgentTicketActionsLevel3Test < TestCase
:css => '.active .ticket_create', :css => '.active .ticket_create',
:result => true, :result => true,
}, },
{
:execute => 'wait',
:value => 1,
},
{ {
:where => :instance1, :where => :instance1,
:execute => 'set', :execute => 'set',
@ -112,13 +104,7 @@ class AgentTicketActionsLevel3Test < TestCase
}, },
{ {
:execute => 'wait', :execute => 'wait',
:value => 5, :value => 6,
},
{
:where => :instance1,
:execute => 'check',
:css => '#login',
:result => false,
}, },
{ {
:where => :instance1, :where => :instance1,

View file

@ -26,6 +26,7 @@ class TestCase < Test::Unit::TestCase
if !ENV['REMOTE_URL'] if !ENV['REMOTE_URL']
local_browser = Selenium::WebDriver.for( browser.to_sym ) local_browser = Selenium::WebDriver.for( browser.to_sym )
local_browser.manage.window.resize_to(1024, 1024) local_browser.manage.window.resize_to(1024, 1024)
local_browser.manage.timeouts.implicit_wait = 3 # seconds
@browsers.push local_browser @browsers.push local_browser
return local_browser return local_browser
end end
@ -38,6 +39,7 @@ class TestCase < Test::Unit::TestCase
:url => ENV['REMOTE_URL'], :url => ENV['REMOTE_URL'],
:desired_capabilities => caps, :desired_capabilities => caps,
) )
local_browser.manage.timeouts.implicit_wait = 3 # seconds
@browsers.push local_browser @browsers.push local_browser
return local_browser return local_browser
end end