Skip to content

Commit

Permalink
Sleep after selecting time for stability
Browse files Browse the repository at this point in the history
  • Loading branch information
mkllnk committed Dec 19, 2024
1 parent 18cb6e3 commit 0005079
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/support/features/datepicker_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ 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 56 runs
sleep 0.1
end

def pick_datetime(calendar_selector, datetime_selector)
Expand Down

0 comments on commit 0005079

Please sign in to comment.