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

Commit 9eeaced

Browse files
Jenny Leatextbook
Jenny Lea
authored andcommitted
Use workaround for clicking retro items to make the Felicity E2E test more consistent (fixes #162)
Signed-off-by: Marco Garofalo <[email protected]>
1 parent 851503e commit 9eeaced

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

e2e/spec/spec_helper.rb

+9-2
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,19 @@ def scroll_to_top
181181
def mark_all_retro_items_as_done
182182
sleep(0.3)
183183
find_all('div.retro-item').each do |retro_item|
184-
retro_item.click
184+
item_id = retro_item[:id]
185+
non_flaky_click("##{item_id}")
185186
sleep(0.3)
186-
retro_item.find('.item-done').click
187+
non_flaky_click("##{item_id} .item-done")
187188
end
188189
end
189190

191+
# This is a workaround for Capybara/Selenium click inconsistencies
192+
# https://medium.com/@yuliaoletskaya/capybara-inconsistent-click-behavior-and-flickering-tests-f50b5fae8ab2
193+
def non_flaky_click(selector)
194+
page.execute_script("document.querySelector('#{selector}').click()")
195+
end
196+
190197
def in_browser(name, &block)
191198
old_session = Capybara.session_name
192199

0 commit comments

Comments
 (0)