No commit activity in last 3 years
No release in over 3 years
Helper for changing date input of react-datetime library
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.11, >= 3.11.1
~> 1.0, >= 1.0.22
~> 2.1, >= 2.1.1.0
~> 1.18, >= 1.18.1
>= 3.8.0, ~> 3.8
 Project Readme

Capybara::ReactDatetime

Helper for changing date input of react-datetime library.

All this gem does is something very simple : allow you to trigger react-datetime to select the date you want.

Installation

Add this line into your test group:

group :test do
    gem 'capybara-react-datetime'
    ...
end

And then execute:

$ bundle

Or install it yourself as:

$ gem install capybara-react-datetime

The gem automatically hook itself into rspec helper using Rspec.configure.

Usage

Just use this method inside your capybara test:

select_date(2.weeks.ago, from: 'Label of the date input')

Or even:

select_date(2.weeks.ago, from: 'Date', match: :prefer_exact)
select_date(Date.tomorrow, from: 'Label of the date input', format: '%d/%m/%Y')
select_date('2013-05-24', xpath: '//path_to//your_date_input', datepicker: true)

Available options are:

  • from: the label of your date input
  • xpath: the path to your date input
  • format: the format used to fill your date input (required if datepicker: false)
  • datepicker: the way to fill your date input
    • true: by clicking the popover
    • false: directly fill the input date (default)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request