I am new to test automation and currently we are using a combination of behat + mink + selenium to automate tests. I want to check whether the calendar view displays the correct month and date. Here is my gherkin script:
Feature: Users see the current date when the calendar view is clicked!
@javascript
Scenario: As a registered user, when I click on calendar, the page should display current date (mm-dd)
Given I go to "URL"
When I fill in "username" with "username"
When I fill in "password" with "password"
Then I press "edit-submit"
Then I follow "calendar"
Then I should see "June 28"
This is what I added in the FeatureContext.php file:
public function getCurrentDate() {
return $this->currentDate()->format('Y-m-d');
}
protected function currentDate() {
return new Date();
}
Since it this test should be automated I would like to change the last step in my script to something like this:
Then I should see "current date (mm-dd)"
I am not sure if it is even possible but like I said earlier, I am new to behat and I'm not sure how would I implement something like this. I am using Behat with mink and selenium. Thank you for your help!