-
-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Date only' date type field is not being created while running behat tests #200
Comments
Patch created and it resolved my issue |
Yeah I just ran into this as well. I upgraded from 1.4.0 to 2.1.0. It was broken with this PR #126 and this commit: e778cb8 I'm not sure that patch is appropriate though. It seems like it would always ignore time if it was provided? Seems like instead we need to detect if a time was provided or not some other way. |
Okay, I submitted my own PR that fixes this by checking if the date field is configured as a date-only or datetime field: #229 |
Just tested #235 and it is working fine for me now! Thanks for the effort. |
After upgrading drupal core from 8.3.9 to 8.6.1, behat from 3.1.0 to 3.3.1 and drupal-driver from 1.2.x-dev to 2.0.x-dev, behat tests are failing for dates of 'Date only' date type. D8 has two date types 'Date and time' and 'Date only' for 'Date' field. There is no issue with 'Date and time' date type. It looks drupal-driver is not able to create dates of 'Date only' date type. I have tried different date formats but none is working.
I can create pages with 'Date only' dates and they appear correctly on the page in the desired format, it is just the behat test which is failing to generate it on the page. It looks DatetimeHandler class in not handling 'Date only' date type.
My test.feature looks like (field_publication_date is 'Date only' date)
@api
Feature: I can see publication data on publication page.
Background:
Given I am an anonymous user
And "publication" content:
| title | moderation_state | field_publication_author | field_publication_date |
| test-title | published | test-author | 2016-09-01 |
Scenario: I can see the correct publication data
Given I am on "/test-title"
And I should see the text "test-author"
And I should see the text "September 2016"
Error:
001 Scenario: I can see publication data on publication page # features/publication.feature:35 And I should see the text "September 2016" # features/publication.feature:44 The text "September 2016" was not found anywhere in the text of the current page. (Behat\Mink\Exception\ResponseTextException)
Format tried:
2016-09-01, 2016/09/01, 01/09/2016, 01-09-2016, 2016-09-01T05:00:00, 2016-09-01 12:12:12, 1 minutes ago etc.
As I said it doesn't looks like format issue. Behat is not able to create date of 'Date only' type. I have also tried putting break just before date test statement to see if date is being created in different format other than expected but date field along with its label is not at all present on the page.
Versions used:
--
The text was updated successfully, but these errors were encountered: