From 38eb9e194edffc6fb258f97a1ce84e00379ef67b Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 17 Nov 2015 19:57:15 +0100 Subject: [PATCH 1/3] Removed general scroll_to at any click, do it now dedicated where it is needed for chrome. --- .../agent_ticket_actions_level5_test.rb | 1 - .../agent_ticket_actions_level7_test.rb | 14 +++++++++++-- .../agent_ticket_overview_level0_test.rb | 6 ++++++ test/browser_test_helper.rb | 21 ++++++++++--------- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/test/browser/agent_ticket_actions_level5_test.rb b/test/browser/agent_ticket_actions_level5_test.rb index 27730b0e1..06a852e3e 100644 --- a/test/browser/agent_ticket_actions_level5_test.rb +++ b/test/browser/agent_ticket_actions_level5_test.rb @@ -265,7 +265,6 @@ class AgentTicketActionLevel5Test < TestCase ) # execute reply - click_catcher_remove sleep 5 # time to recognice form changes click( css: '.active [data-type="reply"]', diff --git a/test/browser/agent_ticket_actions_level7_test.rb b/test/browser/agent_ticket_actions_level7_test.rb index 0c32e3a88..905206131 100644 --- a/test/browser/agent_ticket_actions_level7_test.rb +++ b/test/browser/agent_ticket_actions_level7_test.rb @@ -32,8 +32,13 @@ class AgentTicketActionLevel7Test < TestCase do_not_submit: true, ) + # scroll to reply - needed for chrome + scroll_to( + position: 'botton', + css: '.content.active [data-type="reply"]', + ) + # click reply - click_catcher_remove click( css: '.content.active [data-type="reply"]' ) # check body @@ -50,8 +55,13 @@ class AgentTicketActionLevel7Test < TestCase }, ) + # scroll to reply - needed for chrome + scroll_to( + position: 'botton', + css: '.content.active [data-type="reply"]', + ) + # click reply - click_catcher_remove click( css: '.content.active [data-type="reply"]' ) # check body diff --git a/test/browser/agent_ticket_overview_level0_test.rb b/test/browser/agent_ticket_overview_level0_test.rb index 5033fad77..12dd38da0 100644 --- a/test/browser/agent_ticket_overview_level0_test.rb +++ b/test/browser/agent_ticket_overview_level0_test.rb @@ -45,6 +45,12 @@ class AgentTicketOverviewLevel0Test < TestCase css: '.active table tr td input[value="' + ticket1[:id] + '"] + .icon-checkbox.icon-unchecked', fast: true, ) + + # scroll to reply - needed for chrome + scroll_to( + position: 'top', + css: '.active table tr td input[value="' + ticket2[:id] + '"] + .icon-checkbox.icon-unchecked', + ) click( css: '.active table tr td input[value="' + ticket2[:id] + '"] + .icon-checkbox.icon-unchecked', fast: true, diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index cd57feeb7..36efad891 100644 --- a/test/browser_test_helper.rb +++ b/test/browser_test_helper.rb @@ -254,14 +254,9 @@ class TestCase < Test::Unit::TestCase instance = params[:browser] || @browser if params[:css] - scroll_to( - browser: instance, - css: params[:css], - mute_log: true, - ) - element = instance.find_elements( { css: params[:css] } )[0] instance.mouse.move_to(element) + sleep 0.2 element.click # trigger also focus on input/select and textarea fields @@ -278,8 +273,9 @@ class TestCase < Test::Unit::TestCase =begin scroll_to( - browser: browser1, - css: '.some_class', + browser: browser1, + position: 'top', # botton + css: '.some_class', ) =end @@ -289,12 +285,17 @@ class TestCase < Test::Unit::TestCase instance = params[:browser] || @browser + position = 'true' + if params[:position] == 'botton' + position = 'false' + end + execute( browser: instance, - js: "\$('#{params[:css]}').get(0).scrollIntoView(false)", + js: "\$('#{params[:css]}').get(0).scrollIntoView(#{position})", mute_log: params[:mute_log] ) - sleep 0.4 + sleep 0.2 end =begin From 59b9a39423a02049e073ec44b7c6ab0c3f834a5f Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 17 Nov 2015 22:51:06 +0100 Subject: [PATCH 2/3] Show add button just for agents. --- app/assets/javascripts/app/controllers/ticket_overview.coffee | 1 + .../app/views/agent_ticket_view/navbar_vertical.jst.eco | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/assets/javascripts/app/controllers/ticket_overview.coffee b/app/assets/javascripts/app/controllers/ticket_overview.coffee index 9435f202b..77c6a1e83 100644 --- a/app/assets/javascripts/app/controllers/ticket_overview.coffee +++ b/app/assets/javascripts/app/controllers/ticket_overview.coffee @@ -128,6 +128,7 @@ class Navbar extends App.Controller items = App.OverviewIndexCollection.get() @html App.view("agent_ticket_view/navbar#{ if @vertical then '_vertical' }") items: items + isAgent: @isRole('Agent') while @clone.width() > @tabsHolder.width() @tabClone.not('.hide').last().addClass('hide') diff --git a/app/assets/javascripts/app/views/agent_ticket_view/navbar_vertical.jst.eco b/app/assets/javascripts/app/views/agent_ticket_view/navbar_vertical.jst.eco index 021189917..c005f1001 100644 --- a/app/assets/javascripts/app/views/agent_ticket_view/navbar_vertical.jst.eco +++ b/app/assets/javascripts/app/views/agent_ticket_view/navbar_vertical.jst.eco @@ -21,9 +21,11 @@ <% end %> +<% if @isAgent: %> <%- @Icon('plus') %> +<% end %> <% if @items: %>
<% for item in @items: %> From d8069b8e61c61c96fe8f136b3ad31ca104425a21 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 18 Nov 2015 00:53:19 +0100 Subject: [PATCH 3/3] Another chrome selenium fix. --- test/browser_test_helper.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index 36efad891..7ae563836 100644 --- a/test/browser_test_helper.rb +++ b/test/browser_test_helper.rb @@ -1468,6 +1468,10 @@ wait untill text in selector disabppears ) instance.find_elements( { css: ".content.active .sidebar a[href=\"#{params[:link]}\"]" } )[0].click sleep 1 + execute( + browser: instance, + js: '$(".content.active .sidebar").css("display", "none")', + ) instance.find_elements( { partial_link_text: params[:number] } )[0].click sleep 1 number = instance.find_elements( { css: '.active .ticketZoom-header .ticket-number' } )[0].text