Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
Use workaround for clicking retro items to make the Felicity E2E test…
Browse files Browse the repository at this point in the history
… more consistent (fixes #162)

Signed-off-by: Marco Garofalo <mgarofalo@pivotal.io>
  • Loading branch information
Jenny Lea authored and textbook committed May 6, 2020
1 parent 851503e commit 9eeaced
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions e2e/spec/spec_helper.rb
Expand Up @@ -181,12 +181,19 @@ def scroll_to_top
def mark_all_retro_items_as_done
sleep(0.3)
find_all('div.retro-item').each do |retro_item|
retro_item.click
item_id = retro_item[:id]
non_flaky_click("##{item_id}")
sleep(0.3)
retro_item.find('.item-done').click
non_flaky_click("##{item_id} .item-done")
end
end

# This is a workaround for Capybara/Selenium click inconsistencies
# https://medium.com/@yuliaoletskaya/capybara-inconsistent-click-behavior-and-flickering-tests-f50b5fae8ab2
def non_flaky_click(selector)
page.execute_script("document.querySelector('#{selector}').click()")
end

def in_browser(name, &block)
old_session = Capybara.session_name

Expand Down

0 comments on commit 9eeaced

Please sign in to comment.