Skip to content
Permalink
Browse files

Add "fill in date <field> with today" to Behat tests for calendar eve…

…nt creation scenario
  • Loading branch information...
crossan007 committed Mar 4, 2019
1 parent 28ce24a commit b90bcd020e63977ae606d725cd09ddd1b1b4594e
@@ -31,8 +31,8 @@ Feature: Calendar
And I fill in "Title" with "Selenium Test Event"
And I update react-select with "EventType" with "Church Service"
And I fill in "Desc" with "Test Description"
And I fill in "Start" with "03/05/2019, 9:00 PM"
And I fill in "End" with "03/05/2019, 10:00 PM"
And I fill in date "Start" with today
And I fill in date "End" with today
And I update react-select with "PinnedCalendars" with "Public Calendar"
And I fill in "Text" with "Test Text"
Then I press "Save"
@@ -88,5 +88,20 @@ public function updateReactSelectWith($field, $value)
$driver->click($FieldXPath."//parent::div//parent::div//parent::div//parent::div//parent::div");
$driver->setValue($FieldXPath,$value);
}
/**
* Fills in form field with today's date
* Example: When I fill in date "Start" with today
*
* @When /^(?:|I )fill in date "(?P<field>(?:[^"]|\\")*)" with today$/
*/
public function fillTodayDateField($field)
{
$field = $this->fixStepArgument($field);
$value = date("Y/m/d");
$this->getSession()->getPage()->fillField($field, $value);
}
}

0 comments on commit b90bcd0

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.