Skip to content

Commit

Permalink
Sleep after selecting time for stability
Browse files Browse the repository at this point in the history
mkllnk committed Dec 20, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent f744921 commit c1f8d30
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/support/features/datepicker_helper.rb
Original file line number Diff line number Diff line change
@@ -45,6 +45,14 @@ def select_datetime_from_datepicker(datetime)
select_date_from_datepicker(datetime)
fill_in "Hour", with: datetime.strftime("%H")
fill_in "Minute", with: datetime.strftime("%M")

# Flatpickr needs time to update the time.
# Otherwise submitting the form may not work.
# CI experimentation: 10ms -> 7% success
# 50ms -> 87% success
# 100ms -> 100% success in 112 runs
# Let's double that to reduce flakiness even further.
sleep 0.2
end

def pick_datetime(calendar_selector, datetime_selector)

0 comments on commit c1f8d30

Please sign in to comment.