0

Please find below HTML code

  <input class="datepicker form-text hasDatepicker" type="text" id="edit-coursedate--20" name="coursedate" value="" size="10" maxlength="128">
usermoni
  • 21
  • 3
  • What have you tried? Have you tried evaluateScript or executeScript with jQuery or just using a fill method for the input? – lauda Jul 11 '16 at 12:00

2 Answers2

2

I would recommend you just to set proper value for that input. Because you are not going to test datepicker as its a jQuery stuff, but instead you need to test your system behaviour for the right date format/ for the right date range as an example. So all what you need to do is to use standart behat/mink method:

When I fill in "coursedate" with "your_date"

Or you can write your own method:

$this->getSession()->getPage()->find("css", "input[name='coursedate']")->setValue("your_date");
Igor Lantushenko
  • 1,771
  • 10
  • 19
0

Basic Mink step should work here.

When I fill in "coursedate" with "your_date"

Or, if you want to write a custom method by passing the date as a paramter to it, then the 'name' attribute should work just fine here with the 'named' selector as below:

public function iFillInDateWith($your_date)

{
$this->getSession()->getPage()->find('named',array('id_or_name','coursedate'))->setValue($your_date);

}
cyberlobe
  • 1,783
  • 1
  • 18
  • 30