From ac1c17fb2aba36701f15aae6ba5483191da240b4 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 25 Feb 2016 15:20:22 +0100 Subject: [PATCH] Small testing improvements. --- test/browser/keyboard_shortcuts_test.rb | 2 ++ test/browser_test_helper.rb | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/browser/keyboard_shortcuts_test.rb b/test/browser/keyboard_shortcuts_test.rb index 921ac8625..cb429f4cd 100644 --- a/test/browser/keyboard_shortcuts_test.rb +++ b/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', diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index 0bbf06531..6a49a6266 100644 --- a/test/browser_test_helper.rb +++ b/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