3 In order to prove the Drupal context is working properly
5 I need to use the step definitions of this context
7 # These scenarios assume a "standard" install of Drupal 7 and 8.
10 Scenario: Create and log in as a user
11 Given I am logged in as a user with the "authenticated user" role
12 When I click "My account"
13 Then I should see the text "Member for"
16 Scenario: Target links within table rows
17 Given I am logged in as a user with the "administrator" role
18 When I am at "admin/structure/types"
19 And I click "manage fields" in the "Article" row
20 Then I should be on "admin/structure/types/manage/article/fields"
21 And I should see text matching "Add new field"
24 Scenario: Target links within table rows
25 Given I am logged in as a user with the "administrator" role
26 When I am at "admin/structure/types"
27 And I click "Manage fields" in the "Article" row
28 Then I should be on "admin/structure/types/manage/article/fields"
29 And I should see text matching "Add field"
32 Scenario: Find a heading in a region
33 Given I am not logged in
34 When I am on the homepage
35 Then I should see the heading "User login" in the "left sidebar" region
38 Scenario: Find a heading in a region
39 Given I am not logged in
40 When I am on the homepage
41 Then I should see the heading "Search" in the "left sidebar" region
45 Given the cache has been cleared
46 When I am on the homepage
47 Then I should get a "200" HTTP response
50 Scenario: Create a node
51 Given I am logged in as a user with the "administrator" role
52 When I am viewing an "article" with the title "My article"
53 Then I should see the heading "My article"
57 Given I am logged in as a user with the "administrator" role
59 And am on "admin/reports/dblog"
60 Then I should see the link "Cron run completed"
63 Scenario: Create many nodes
68 And "article" content:
72 And I am logged in as a user with the "administrator" role
73 When I go to "admin/content"
74 Then I should see "Page one"
75 And I should see "Page two"
76 And I should see "First article"
77 And I should see "Second article"
80 Scenario: Create nodes with fields
81 Given "article" content:
82 | title | promote | body |
83 | First article with fields | 1 | PLACEHOLDER BODY |
84 And I am logged in as a user with the "authenticated user" role
85 When I am on the homepage
86 And follow "First article with fields"
87 Then I should see the text "PLACEHOLDER BODY"
90 Scenario: Create and view a node with fields
91 Given I am viewing an "article":
92 | title | My article with fields! |
93 | body | A placeholder |
94 Then I should see the heading "My article with fields!"
95 And I should see the text "A placeholder"
98 Scenario: Create users
100 | name | mail | status |
101 | Joe User | joe@example.com | 1 |
102 And I am logged in as a user with the "administrator" role
103 When I visit "admin/people"
104 Then I should see the link "Joe User"
107 Scenario: Create users with roles
109 | name | mail | roles |
110 | Joe User | joe@example.com | administrator |
111 | Jane User | jane@example.com | |
112 And I am logged in as a user with the "administrator" role
113 When I visit "admin/people"
114 Then I should see the text "administrator" in the "Joe User" row
115 And I should not see the text "administrator" in the "Jane User" row
118 Scenario: Create users with roles
120 | name | mail | roles |
121 | Joe User | joe@example.com | administrator |
122 | Jane User | jane@example.com | |
123 And I am logged in as a user with the "administrator" role
124 When I visit "admin/people"
125 Then I should see the text "Administrator" in the "Joe User" row
126 And I should not see the text "administrator" in the "Jane User" row
129 Scenario: Login as a user created during this scenario
133 When I am logged in as "Test user"
134 Then I should see the link "Log out"
137 Scenario: Create a term
138 Given I am logged in as a user with the "administrator" role
139 When I am viewing a "tags" term with the name "My tag"
140 Then I should see the heading "My tag"
143 Scenario: Create many terms
148 And I am logged in as a user with the "administrator" role
149 When I go to "admin/structure/taxonomy/tags"
150 Then I should see "Tag one"
151 And I should see "Tag two"
154 Scenario: Create many terms
159 And I am logged in as a user with the "administrator" role
160 When I go to "admin/structure/taxonomy/manage/tags/overview"
161 Then I should see "Tag one"
162 And I should see "Tag two"
165 Scenario: Create terms using vocabulary title rather than machine name.
170 And I am logged in as a user with the "administrator" role
171 When I go to "admin/structure/taxonomy/tags"
172 Then I should see "Tag one"
173 And I should see "Tag two"
176 Scenario: Create terms using vocabulary title rather than machine name.
181 And I am logged in as a user with the "administrator" role
182 When I go to "admin/structure/taxonomy/manage/tags/overview"
183 Then I should see "Tag one"
184 And I should see "Tag two"
187 # TODO: This doesn't work on Drupal 8 yet. For nodes the 'author' field is
188 # called 'uid' and only accepts numerical IDs.
189 Scenario: Create nodes with specific authorship
191 | name | mail | status |
192 | Joe User | joe@example.com | 1 |
193 And "article" content:
194 | title | author | body | promote |
195 | Article by Joe | Joe User | PLACEHOLDER BODY | 1 |
196 When I am logged in as a user with the "administrator" role
197 And I am on the homepage
198 And I follow "Article by Joe"
199 Then I should see the link "Joe User"
202 Scenario: Create an article with multiple term references
209 And "article" content:
210 | title | body | promote | field_tags |
211 | Article by Joe | PLACEHOLDER BODY | 1 | Tag one, Tag two, Tag three |
212 | Article by Mike | PLACEHOLDER BODY | 1 | Tag four |
213 When I am on the homepage
214 Then I should see the link "Tag one"
215 And I should see the link "Tag two"
216 And I should see the link "Tag three"
217 And I should see the link "Tag four"
220 Scenario: Readable created dates
221 Given "article" content:
222 | title | body | created | status | promote |
223 | Test article | PLACEHOLDER BODY | 07/27/2014 12:03am | 1 | 1 |
224 When I am on the homepage
225 Then I should see the text "Sun, 07/27/2014 - 00:03"
228 Scenario: Node hooks are functioning
229 Given "article" content:
230 | title | body | published on | status | promote |
231 | Test article | PLACEHOLDER | 04/27/2013 11:11am | 1 | 1 |
232 When I am on the homepage
233 Then I should see the text "Sat, 04/27/2013 - 11:11"
236 Scenario: Node edit access by administrator
237 Given I am logged in as a user with the "administrator" role
238 Then I should be able to edit an "article"
241 Scenario: User hooks are functioning
243 | First name | Last name | E-mail |
244 | Joe | User | joe.user@example.com |
245 And I am logged in as a user with the "administrator" role
246 When I visit "admin/people"
247 Then I should see the link "Joe User"
250 Scenario: Term hooks are functioning
255 And I am logged in as a user with the "administrator" role
256 When I go to "admin/structure/taxonomy/tags"
257 Then I should see "Tag one"
258 And I should see "Tag two"
261 Scenario: Term hooks are functioning
266 And I am logged in as a user with the "administrator" role
267 When I go to "admin/structure/taxonomy/manage/tags/overview"
268 Then I should see "Tag one"
269 And I should see "Tag two"
272 Scenario: Log in as a user with specific permissions
273 Given I am logged in as a user with the "Administer content types" permission
274 When I go to "admin/structure/types"
275 Then I should see the link "Add content type"