Browse Source

Small testing improvements.

Martin Edenhofer 9 years ago
parent
commit
ac1c17fb2a
2 changed files with 7 additions and 3 deletions
  1. 2 0
      test/browser/keyboard_shortcuts_test.rb
  2. 5 3
      test/browser_test_helper.rb

+ 2 - 0
test/browser/keyboard_shortcuts_test.rb

@@ -128,6 +128,7 @@ class KeyboardShortcutsTest < TestCase
     shortcut(key: 'm')
     shortcut(key: 'j')
     window_keys(value: 'some note')
+    sleep 1
     shortcut(key: :enter)
     watch_for(
       css:     '.active.content .ticket-article',
@@ -138,6 +139,7 @@ class KeyboardShortcutsTest < TestCase
 
     shortcut(key: 'g')
     window_keys(value: 'some reply')
+    sleep 1
     shortcut(key: :enter)
     watch_for(
       css:     '.active.content .ticket-article',

+ 5 - 3
test/browser_test_helper.rb

@@ -292,11 +292,13 @@ class TestCase < Test::Unit::TestCase
     log('location_check', params)
 
     instance = params[:browser] || @browser
-    if instance.current_url !~ /#{Regexp.quote(params[:url])}/
+    sleep 0.7
+    current_url = instance.current_url
+    if current_url !~ /#{Regexp.quote(params[:url])}/
       screenshot(browser: instance, comment: 'location_check_failed')
-      fail "url #{instance.current_url} is not matching #{params[:url]}"
+      fail "url #{current_url} is not matching #{params[:url]}"
     end
-    assert(true, "url #{instance.current_url} is matching #{params[:url]}")
+    assert(true, "url #{current_url} is matching #{params[:url]}")
   end
 
 =begin