Open Ana06 opened 5 years ago
I am using bootstrap3-datetimepicker-rails 4.17.47, rspec 3.6.0 and capybara 3.12.0. I have tried several solutions to modify the datapickers in a feature test, but any of them worked:
page.execute_script("$('#registration-period-start-datapicker').datepicker('setDate', '01/01/2010')")
page.execute_script("$('#registration-period-start-datapicker'').val('21/12/1980')")
fill_in 'registration-period-start-datapicker', :with => '21/12/1980'
$('#registration-period-start-datapicker').datetimepicker({value: '21/12/1980'})
I have the following code in Rails:
= f.input :start_date, as: :string, input_html: { class: 'form-control', id: 'registration-period-start-datapicker' }
With this JavaScript:
$('#registration-period-start-datapicker').datetimepicker({ format: 'YYYY-MM-DD', minDate : today, maxDate : end_conference });
the generated html:
<div class="string input required stringish form-group" id="cfp_start_date_input"><span class="form-label"><label for="registration-period-start-datapicker" class=" control-label">Start date <span class="text-warning"><abbr title="This field is required">*</abbr></span></label></span><span class="form-wrapper"><input id="registration-period-start-datapicker" class="form-control form-control" type="text" name="cfp[start_date]"></span></div>
Original code in github.com/openSUSE/osem
Related to: https://github.com/TrevorS/bootstrap3-datetimepicker-rails/issues/36
I am using bootstrap3-datetimepicker-rails 4.17.47, rspec 3.6.0 and capybara 3.12.0. I have tried several solutions to modify the datapickers in a feature test, but any of them worked:
page.execute_script("$('#registration-period-start-datapicker').datepicker('setDate', '01/01/2010')")
page.execute_script("$('#registration-period-start-datapicker'').val('21/12/1980')")
fill_in 'registration-period-start-datapicker', :with => '21/12/1980'
$('#registration-period-start-datapicker').datetimepicker({value: '21/12/1980'})
I have the following code in Rails:
With this JavaScript:
the generated html:
Original code in github.com/openSUSE/osem
Related to: https://github.com/TrevorS/bootstrap3-datetimepicker-rails/issues/36