Security update for permissions_by_term
[yaffs-website] / vendor / drupal / drupal-extension / features / api.feature
1 @api
2 Feature: DrupalContext
3   In order to prove the Drupal context is working properly
4   As a developer
5   I need to use the step definitions of this context
6
7   # These scenarios assume a "standard" install of Drupal 7 and 8.
8
9   @drushTest @d7 @d8
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"
14
15   @drushTest @d7
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"
22
23   @d8
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"
30
31   @drushTest @d7
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
36
37   @d8
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
42
43   @drushTest @d7 @d8
44   Scenario: Clear cache
45     Given the cache has been cleared
46     When I am on the homepage
47     Then I should get a "200" HTTP response
48
49   @d7 @d8
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"
54
55   @drushTest @d7 @d8
56   Scenario: Run cron
57     Given I am logged in as a user with the "administrator" role
58     When I run cron
59     And am on "admin/reports/dblog"
60     Then I should see the link "Cron run completed"
61
62   @d7 @d8
63   Scenario: Create many nodes
64     Given "page" content:
65     | title    |
66     | Page one |
67     | Page two |
68     And "article" content:
69     | title          |
70     | First article  |
71     | Second article |
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"
78
79   @d7 @d8
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"
88
89   @d7 @d8
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"
96
97   @d7 @d8
98   Scenario: Create users
99     Given 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"
105
106   @d7
107   Scenario: Create users with roles
108     Given users:
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
116
117   @d8
118   Scenario: Create users with roles
119     Given users:
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
127
128   @d7 @d8
129   Scenario: Login as a user created during this scenario
130     Given users:
131     | name      | status |
132     | Test user |      1 |
133     When I am logged in as "Test user"
134     Then I should see the link "Log out"
135
136   @d7 @d8
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"
141
142   @d7
143   Scenario: Create many terms
144     Given "tags" terms:
145     | name    |
146     | Tag one |
147     | Tag two |
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"
152
153   @d8
154   Scenario: Create many terms
155     Given "tags" terms:
156     | name    |
157     | Tag one |
158     | Tag two |
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"
163
164   @d7
165   Scenario: Create terms using vocabulary title rather than machine name.
166     Given "Tags" terms:
167     | name    |
168     | Tag one |
169     | Tag two |
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"
174
175   @d8
176   Scenario: Create terms using vocabulary title rather than machine name.
177     Given "Tags" terms:
178     | name    |
179     | Tag one |
180     | Tag two |
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"
185
186   @d7 @d8wip
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
190     Given users:
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"
200
201   @d7 @d8
202   Scenario: Create an article with multiple term references
203     Given "tags" terms:
204     | name      |
205     | Tag one   |
206     | Tag two   |
207     | Tag three |
208     | Tag four  |
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"
218
219   @d7 @d8
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"
226
227   @d7 @d8
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"
234
235   @d7 @d8
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"
239
240   @d7 @d8
241   Scenario: User hooks are functioning
242     Given users:
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"
248
249   @d7
250   Scenario: Term hooks are functioning
251     Given "tags" terms:
252     | Label     |
253     | Tag one   |
254     | Tag two   |
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"
259
260   @d8
261   Scenario: Term hooks are functioning
262     Given "tags" terms:
263     | Label     |
264     | Tag one   |
265     | Tag two   |
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"
270
271   @d7 @d8
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"