From 8eff2716ed1a6579d39c4f7bbd4e097dea07cf42 Mon Sep 17 00:00:00 2001 From: Thierry Jet Date: Tue, 26 Oct 2021 20:46:12 +0200 Subject: [PATCH] Modify choose_today_from_datepicker to avoid possible ambiguous match with the find --- spec/support/features/datepicker_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/support/features/datepicker_helper.rb b/spec/support/features/datepicker_helper.rb index dbe9e7d1f6..6bb8a2c6b2 100644 --- a/spec/support/features/datepicker_helper.rb +++ b/spec/support/features/datepicker_helper.rb @@ -4,7 +4,8 @@ module Features module DatepickerHelper def choose_today_from_datepicker within(".flatpickr-calendar.open") do - find('.shortcut-buttons-flatpickr-button').click + # Now that we have added the Close button, find the first button to avoid any ambiguous match + find('.shortcut-buttons-flatpickr-buttons > button:nth-child(1)').click end end