lib/cucumber/rails/capybara/select_dates_and_times.rb
# Select a Rails date. Options hash must include from: +label+
Select a Rails date. Options hash must include from: +label+
Select a Rails date . Options hash must include from : + label +
def select_date(date, options)
          date        = Date.parse(date)
          base_dom_id = get_base_dom_id_from_label_tag(options[:from])
          find(:xpath, ".//select[@id='#{base_dom_id}_1i']").select(date.year.to_s)
          find(:xpath, ".//select[@id='#{base_dom_id}_2i']").select(I18n.l(date, format: '%B'))
          find(:xpath, ".//select[@id='#{base_dom_id}_3i']").select(date.day.to_s)
        end
def select_date ( date , options ) date = Date . parse ( date ) base_dom_id = get_base_dom_id_from_label_tag ( options [ :from ] ) find ( :xpath , ".//select[@id='#{base_dom_id}_1i']" ) . select ( date . year . to_s ) find ( :xpath , ".//select[@id='#{base_dom_id}_2i']" ) . select ( I18n . l ( date , format : '%B' ) ) find ( :xpath , ".//select[@id='#{base_dom_id}_3i']" ) . select ( date . day . to_s ) end
Select a Rails date.
Select a Rails date .
date
<not_specific>
options
<not_specific>