Module: Capybara::DatepickerDateFill
- Defined in:
- lib/decidim/dev/test/rspec_support/datepicker_date_fill.rb
Instance Method Summary collapse
-
#fill_in_datepicker(locator = nil, with:, currently_with: nil, fill_options: {}, **find_options) ⇒ Object
fill datepicker field correctly.
Instance Method Details
#fill_in_datepicker(locator = nil, with:, currently_with: nil, fill_options: {}, **find_options) ⇒ Object
fill datepicker field correctly
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/decidim/dev/test/rspec_support/datepicker_date_fill.rb', line 7 def fill_in_datepicker(locator = nil, with:, currently_with: nil, fill_options: {}, **) [:with] = currently_with if currently_with [:allow_self] = true if locator.nil? with.chars.each do |character| if character == "/" find(:fillable_field, locator, **).send_keys(:divide, **) elsif character == "." find(:fillable_field, locator, **).send_keys(:decimal, **) else find(:fillable_field, locator, **).send_keys(character, **) end end end |