From f08fcc5e55df3deba41988bec0cffc23303ee1af Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 29 May 2016 02:51:58 +0200 Subject: [PATCH] Improved click helper with param text. --- test/browser/abb_one_group_test.rb | 3 ++- test/browser_test_helper.rb | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/test/browser/abb_one_group_test.rb b/test/browser/abb_one_group_test.rb index d283d8fcb..0e613e362 100644 --- a/test/browser/abb_one_group_test.rb +++ b/test/browser/abb_one_group_test.rb @@ -88,8 +88,9 @@ class AgentTicketActionLevel0Test < TestCase # customer ticket create click(css: 'a[href="#new"]') - click(css: 'a[href="#customer_ticket_new"]', wait: 3) + click(css: 'a[href="#customer_ticket_new"]', wait: 5) + exists(css: '.newTicket') exists_not(css: '.newTicket select[name="group_id"]') set( diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index 8b415c909..fac5b88a6 100644 --- a/test/browser_test_helper.rb +++ b/test/browser_test_helper.rb @@ -405,7 +405,15 @@ class TestCase < Test::Unit::TestCase else sleep 0.5 - instance.find_elements(partial_link_text: params[:text])[0].click + begin + instance.find_elements(partial_link_text: params[:text])[0].click + rescue => e + sleep 0.5 + + # just try again + log('click', { rescure: true }) + instance.find_elements(partial_link_text: params[:text])[0].click + end end sleep 0.2 if !params[:fast] sleep params[:wait] if params[:wait]