Browse Source

Improved ticket_create() - wait until screen exists.

Martin Edenhofer 8 years ago
parent
commit
fb4c2c90b3
1 changed files with 10 additions and 3 deletions
  1. 10 3
      test/browser_test_helper.rb

+ 10 - 3
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-'