From b348d70f23945f500edd93de72bc163de80a85ff Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 17 Jun 2016 12:57:54 +0200 Subject: [PATCH] Added workaround for ff keyboard binding issue. --- .../agent_ticket_actions_level8_test.rb | 8 +++--- test/browser/keyboard_shortcuts_test.rb | 26 ++++++++++++++++++- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/test/browser/agent_ticket_actions_level8_test.rb b/test/browser/agent_ticket_actions_level8_test.rb index 585bf68ff..72c2ef94b 100644 --- a/test/browser/agent_ticket_actions_level8_test.rb +++ b/test/browser/agent_ticket_actions_level8_test.rb @@ -118,7 +118,7 @@ class AgentTicketActionLevel8Test < TestCase sendkey( value: :enter, ) - sleep 2 + sleep 3 # set tag #2 click( @@ -131,7 +131,7 @@ class AgentTicketActionLevel8Test < TestCase sendkey( value: :enter, ) - sleep 2 + sleep 3 # set tag #3 + #4 click( @@ -144,7 +144,7 @@ class AgentTicketActionLevel8Test < TestCase sendkey( value: :enter, ) - sleep 2 + sleep 3 # set tag #5 click( @@ -157,7 +157,7 @@ class AgentTicketActionLevel8Test < TestCase click( css: '#global-search', ) - sleep 2 + sleep 3 # verify tags tags_verify( diff --git a/test/browser/keyboard_shortcuts_test.rb b/test/browser/keyboard_shortcuts_test.rb index 99a194d64..00227381d 100644 --- a/test/browser/keyboard_shortcuts_test.rb +++ b/test/browser/keyboard_shortcuts_test.rb @@ -10,13 +10,37 @@ class KeyboardShortcutsTest < TestCase url: browser_url, ) tasks_close_all() + sleep 2 # show shortkeys shortcut(key: 'h') + + # ff issue, sometimes shortcut is not fired in browser test env + if ENV['BROWSER'] && ENV['BROWSER'] =~ /firefox/i + exists = false + (1..4).each {|_count| + sleep 1 + next if !@browser.find_elements(css: '.modal')[0] + exists = true + } + if !exists + reload + sleep 4 + shortcut(key: 'h') + (1..4).each {|_count| + sleep 1 + next if !@browser.find_elements(css: '.modal')[0] + exists = true + } + end + if !exists + shortcut(key: 'h') + end + end watch_for( css: '.modal', value: 'Keyboard Shortcuts', - timeout: 2, + timeout: 6, ) # hide shortkeys