From b03576f6179a95339467508c7446549ca77f846a Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Tue, 5 Jun 2018 16:22:52 +0200 Subject: [PATCH] Fixed unstable test caused by not being able to click on Avatar at the top of the zoom view. --- test/browser/user_access_permissions_test.rb | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/test/browser/user_access_permissions_test.rb b/test/browser/user_access_permissions_test.rb index a97d8e58e..c3792b53a 100644 --- a/test/browser/user_access_permissions_test.rb +++ b/test/browser/user_access_permissions_test.rb @@ -269,7 +269,15 @@ class AgentProfilePermissionsTest < TestCase exists(css: '.content.active .sidebar[data-tab="customer"] .js-actions .dropdown-toggle') exists(css: '.content.active .sidebar[data-tab="customer"] .js-actions [data-type="customer-edit"]') - click(css: '.content.active .tabsSidebar-holder .js-avatar') + # scroll to the Avatar at the top of the zoom view and click it + # scrolling is needed because the browser might have scrolled down + # caused by a undeliverable email (of the created ticket) + zoom_top_avatar_selector = '.content.active .tabsSidebar-holder .js-avatar' + scroll_to( + position: 'botton', + css: zoom_top_avatar_selector, + ) + click(css: zoom_top_avatar_selector) # check and change note again in edit screen click(css: '.content.active .js-action .dropdown-toggle') @@ -353,7 +361,15 @@ class AgentProfilePermissionsTest < TestCase exists(css: '.content.active .sidebar[data-tab="customer"] .js-actions .dropdown-toggle') exists_not(css: '.content.active .sidebar[data-tab="customer"] .js-actions [data-type="customer-edit"]') - click(css: '.content.active .tabsSidebar-holder .js-avatar') + # scroll to the Avatar at the top of the zoom view and click it + # scrolling is needed because the browser might have scrolled down + # caused by a undeliverable email (of the created ticket) + zoom_top_avatar_selector = '.content.active .tabsSidebar-holder .js-avatar' + scroll_to( + position: 'botton', + css: zoom_top_avatar_selector, + ) + click(css: zoom_top_avatar_selector) click(css: '.content.active .js-action .icon-arrow-down', fast: true) exists_not(css: '.content.active .js-action [data-type="edit"]')