From fb4c2c90b32859ef4283d5127dcd7144764f0e6c Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 1 May 2016 01:58:15 +0200 Subject: [PATCH] Improved ticket_create() - wait until screen exists. --- test/browser_test_helper.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index fd209dc42..c5d67ad4d 100644 --- a/test/browser_test_helper.rb +++ b/test/browser_test_helper.rb @@ -1641,12 +1641,19 @@ wait untill text in selector disabppears mute_log: true, ) - element = instance.find_elements(css: '.active .newTicket')[0] - if !element + found = false + (1..4).each { + element = instance.find_elements(css: '.active .newTicket')[0] + if element + found = false + break + end + sleep 1 + } + if !found screenshot(browser: instance, comment: 'ticket_create_failed') raise 'no ticket create screen found!' end - sleep 0.4 if data[:group] if data[:group] == '-NONE-'