Scroll to element when blocked by overflow

The details view blocks certain elements of the table, causing
clicks to no longer work in newer Firefoxen

This is mainly caused by
https://bugzilla.mozilla.org/show_bug.cgi?id=1295538
pull/5988/head
Oliver Günther 7 years ago
parent f5c608bb63
commit b15f07ea32
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 3
      .travis.yml
  2. 4
      spec/features/work_packages/select_work_package_row_spec.rb
  3. 2
      spec/features/work_packages/table/inline_create/parallel_creation_spec.rb
  4. 8
      spec/support/pages/admin/user.rb
  5. 3
      spec/support/pages/work_packages_table.rb
  6. 6
      spec/support/shared/scroll_element_into_view.rb
  7. 2
      spec/support/work_packages/work_package_field.rb

@ -113,6 +113,9 @@ notifications:
- secure: "dkVCNYSedLfeuqTboRPx/iWmXldhoHZpSp83cpkG6ZL81Psut2ZEHg6aBiWgqQWdfNAca4a51hWXs6utRqdgnxo51YAB/pMy0/b+jEOjZvuShOVz6TVqn5W5JLTNZJeVZL+BgvwXZWbIujH/cSuUv+h7GTnS+8Y4b2ZrCYilP35sAck2bbbAsKzbuW2yZZqK7X0UnSjoxg+KeT9DuK1zjjJJ6CZig1/n5ZjciQIv7JD50hmqFxBgjyBi71Loh/iohUF89EoQRXm0KkSmEhCINld5s+7SP4jSmnqyrNamNNw2ZGCgg3OXhcvDqOHjPwpCNNhrtzTExt/Z2cTzHz4FnV9ncJj9i1pkbjveuudVUTeaSHHXjw/X496OKLP3LwEZYggUCyc3nu9qR2zSs6zdG4ijhclOVzNrXDDixjpYGmOg8mVunG2cwFUSjtmX8nyPNXQvRnvsfnVYalprqXJHGmQW07nFE/2lbjdmnQiCEExNsKXO5vqrqo6RYOtTfka9B5s3ZkTkXgZkTWuEgWbaMC/fZhi0NCu2Ow3XOzQrs8hVLF4w1zngjqOLjk+LftqWwT42D47RKW3SZfVEVm8Vw+JGfh/uJUNAsPsu+Mybw8k0aDmLjPTlRZD+dYvQ2EPizgc2+cf+0GVoaGzKZF+cJ8I0ut8kO13M9ZmjiHU0se4="
addons:
# Setting latest here due to the switch from old selenium bindings
# to Marionette. At the date of this writing, ESR is Firefox 52 and has
# bad support for it.
firefox: "latest"
postgresql: "9.3"

@ -55,8 +55,6 @@ describe 'Select work package row', type: :feature, js:true, selenium: true do
element = find(".work-package-table--container tr:nth-of-type(#{number}) .wp-table--cell-td.id")
loading_indicator_saveguard
case mouse_button_behavior
when :double
element.double_click
when :right
element.right_click
else
@ -198,7 +196,7 @@ describe 'Select work package row', type: :feature, js:true, selenium: true do
describe 'opening work package full screen view' do
before do
select_work_package_row(1, :double)
wp_table.open_full_screen_by_doubleclick(work_package_1)
end
it do

@ -60,7 +60,7 @@ describe 'Parallel work package creation spec', js: true do
# Since the WP was started inline, a new row is entered
expect(page).to have_selector('.wp-inline-create-row')
page.find('.wp-table--cancel-create-link').click
scroll_to_and_click(page.find('.wp-table--cancel-create-link'))
expect(page).to have_selector('.wp--row', count: 1)
wp_table.expect_notification(

@ -63,7 +63,13 @@ module Pages
find("#member-#{membership.id} .user-memberships--edit-button").click
page.within("#member-#{membership.id}-roles-form") do
page.all('.form--check-box').each {|f| f.set false }
page.all('.form--check-box').each do |f|
begin
f.set false
rescue Selenium::WebDriver::Error::InvalidElementStateError => e
# Happens if an element is disabled
end
end
Array(roles).each { |role| page.check role }
page.find('.user-memberships--edit-submit-button').click
end

@ -111,7 +111,8 @@ module Pages
# Hover row to show split screen button
row_element = row(work_package)
row_element.hover
row_element.find('.wp-table--details-link').click
scroll_to_and_click(row_element.find('.wp-table--details-link'))
split_page
end

@ -33,3 +33,9 @@ def scroll_to_element(element)
JS
Capybara.current_session.driver.browser.execute_script(script, element.native)
end
def scroll_to_and_click(element)
scroll_to_element(element)
sleep 0.2
element.native.click
end

@ -48,7 +48,7 @@ class WorkPackageField
def activate!
retry_block do
unless active?
display_element.click
scroll_to_and_click(display_element)
end
unless active?

Loading…
Cancel
Save