3 In order to prove field handling is working properly
5 I need to use the step definitions of this context
7 # @d7 and @d8 scenarios assume a "standard" install of Drupal and require the
8 # feature "fixtures/drupalN/modules/behat_test" to enabled on the site.
10 Scenario: Test various node field handlers in Drupal 7 and 8
16 When I am viewing a "post" content:
17 | title | Post title |
18 | body | PLACEHOLDER BODY |
19 | field_post_reference | Page one, Page two |
20 | field_post_date | 2015-02-08 17:45:00 |
21 | field_post_links | Link 1 - http://example.com, Link 2 - http://example.com |
22 | field_post_select | One, Two |
23 | field_post_address | country: BE - locality: Brussel - thoroughfare: Louisalaan 1 - postal_code: 1000 |
24 Then I should see "Post title"
25 And I should see "PLACEHOLDER BODY"
26 And I should see "Page one"
27 And I should see "Page two"
28 And I should see "Sunday, February 8, 2015"
29 And I should see the link "Link 1"
30 And I should see the link "Link 2"
31 And I should see "One"
32 And I should see "Two"
33 And I should see "Belgium"
34 And I should see "Brussel"
35 And I should see "1000"
36 And I should see "Louisalaan 1"
38 # This is identical to the previous test, but uses human readable names for
39 # the field names. This is better from a BDD standpoint. Please have a look at
40 # FeatureContext::transformPostContentTable() to see how the mapping between
41 # the machine names and human readable names is defined.
43 Scenario: Test using human readable names for fields using @Transform
49 When I am viewing a "post" content:
50 | title | Post title |
51 | body | PLACEHOLDER BODY |
52 | reference | Page one, Page two |
53 | date | 2015-02-08 17:45:00 |
54 | links | Link 1 - http://example.com, Link 2 - http://example.com |
56 | address | country: BE - locality: Brussel - thoroughfare: Louisalaan 1 - postal_code: 1000 |
57 Then I should see "Page one"
58 And I should see "Page two"
59 And I should see "Sunday, February 8, 2015"
60 And I should see the link "Link 1"
61 And I should see the link "Link 2"
62 And I should see "One"
63 And I should see "Two"
64 And I should see "Belgium"
65 And I should see "Brussel"
66 And I should see "1000"
67 And I should see "Louisalaan 1"
70 Scenario: Test alternative syntax for named field columns on node content
71 When I am viewing a "post" content:
72 | title | Post title |
73 | field_post_address:country | FR |
74 | field_post_address:locality | Paris |
75 | field_post_address:thoroughfare | 1 Avenue des Champs Elysées |
76 | field_post_address:postal_code | 75008 |
77 Then I should see "France"
78 And I should see "Paris"
79 And I should see "1 Avenue des Champs Elysées"
80 And I should see "75008"
83 Scenario: Test shorthand syntax for named field columns on node content
84 When I am viewing a "post" content:
85 | title | Post title |
86 | field_post_address:country | GB |
87 | :locality | London |
88 | :thoroughfare | 1 Oxford Street |
89 | :postal_code | W1D 1AN |
90 Then I should see "United Kingdom"
91 And I should see "London"
92 And I should see "1 Oxford Street"
93 And I should see "W1D 1AN"
96 Scenario: Test multivalue fields with named field columns on node content
97 When I am viewing a "post" content:
98 | title | Post title |
99 | field_post_address:country | IT, JP |
100 | :locality | Milan, Tokyo |
101 | :thoroughfare | 1 Corso Buenos Aires, Shibuya Crossing |
102 | :postal_code | 20124, 150-0040 |
103 Then I should see "Italy"
104 And I should see "Milan"
105 And I should see "1 Corso Buenos Aires"
106 And I should see "20124"
107 And I should see "Japan"
108 And I should see "Tokyo"
109 And I should see "Shibuya Crossing"
110 And I should see "150-0040"
113 Scenario: Test various user field handlers in Drupal 7.
124 | name | mail | field_tags | field_post_reference | field_post_address |
126 | John Doe | john@doe.com | Tag one, Tag two | Page one, Page two | country: BE - locality: Brussel - thoroughfare: Louisalaan 1 - postal_code: 1000 |
127 And I am logged in as a user with the "administrator" role
128 When I visit "admin/people"
129 Then I should see the link "Jane Doe"
130 And I should see the link "John Doe"
131 When I click "John Doe"
132 Then I should see the link "Tag one"
133 And I should see the link "Tag two"
134 But I should not see the link "Tag three"
135 And I should see "Page one"
136 And I should see "Page two"
137 But I should not see "Page three"
138 And I should see "Belgium"
139 And I should see "Brussel"
140 And I should see "1000"
141 And I should see "Louisalaan 1"
144 Scenario: Test using @Transform to provide human friendly aliases for named field columns
146 | name | mail | street | city | postcode | country |
147 | Jane Doe | jane@example.com | Pioneer Place | Portland | OR 97204 | US |
148 And I am logged in as a user with the "administrator" role
149 When I visit "admin/people"
150 And I click "Jane Doe"
151 Then I should see "United States"
152 And I should see "Portland"
153 And I should see "Pioneer Place"
154 And I should see "OR 97204"
157 Scenario: Test taxonomy term reference field handler
164 And "article" content:
165 | title | body | promote | field_tags |
166 | Article by Joe | PLACEHOLDER BODY | 1 | Tag one, Tag two, Tag three |
167 | Article by Mike | PLACEHOLDER BODY | 1 | Tag four |
168 | Article by Jane | | | |
169 And I am logged in as a user with the "administrator" role
170 When I visit "admin/content"
171 Then I should see the link "Article by Joe"
172 And I should see the link "Article by Mike"
173 And I should see the link "Article by Jane"
174 When I am on the homepage
175 Then I should see the link "Article by Joe"
176 And I should see the link "Tag one"
177 And I should see the link "Tag two"
178 And I should see the link "Tag three"
179 And I should see the link "Article by Mike"
180 And I should see the link "Tag four"
181 And I should see the link "Article by Joe"
182 And I should not see the link "Article by Jane"
185 # There is no support for date ranges in D8 yet, so only test D7 for now.
186 Scenario: Test date ranges in Drupal 7
187 When I am viewing a "post" content:
188 | title | Post title |
189 | body | PLACEHOLDER BODY |
190 | field_post_dates | 2015-02-10 17:45:00 - 2015-03-10 17:45:00 |
191 Then I should see "to Tuesday, March 10, 2015"