-
Notifications
You must be signed in to change notification settings - Fork 95
/
Copy pathgridfield-navigation.feature
256 lines (251 loc) · 14.9 KB
/
gridfield-navigation.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
@retry @job1
Feature: Search in GridField
As an author
I want to navigate through the filtered and sorted GridField list
So that I see the filtered and sorted GridField when I navigate to an item and back to the GridFIeld list
Background:
Given the "Company" "Walmart" with "Category"="Retail"
And the "Employee" "Alen" with "Company"="1"
And the "Employee" "Bill" with "Company"="1"
And the "Employee" "Ford" with "Company"="1"
And the "Company" "ExxonMobil" with "Category"="Oil"
And the "Company" "Vitol" with "Category"="Other"
And the "Company" "Safeway" with "Category"="Other"
And the "Company" "SuperValue" with "Category"="Other"
And the "Company" "UBS" with "Category"="Other"
And the "Company" "Kraft Foods" with "Category"="Other"
And the "Company" "Ahold" with "Category"="Other"
And the "Company" "Cisco" with "Category"="Other"
And the "Company" "Bouygues" with "Category"="Other"
And the "Company" "Insurance" with "Category"="Other"
And the "group" "EDITOR" has permissions "Access to 'Pages' section" and "Access to 'GridField Test Navigation' section" and "TEST_DATAOBJECT_EDIT"
And I am logged in as a member of "EDITOR" group
Scenario: I can navigate back through the GridField items by using the "previous record" button
When I go to "/admin/gridfield-test-navigation"
And I should see "Walmart" in the "#Form_EditForm" element
And I should see "ExxonMobil" in the "#Form_EditForm" element
And I should see "Vitol" in the "#Form_EditForm" element
And I should see "Safeway" in the "#Form_EditForm" element
And I should see "SuperValue" in the "#Form_EditForm" element
But I should not see "UBS" in the ".col-Name" element
And I should see "3" in the ".pagination-page-number" element
And I should see "View 1–5 of 11" in the ".pagination-records-number" element
Then I click on the "#action_pagination_next" element
And I should see "View 6–10 of 11" in the ".pagination-records-number" element
And I should see "UBS" in the "#Form_EditForm" element
And I should see "Kraft Foods" in the "#Form_EditForm" element
And I should see "Ahold" in the "#Form_EditForm" element
And I should see "Cisco" in the "#Form_EditForm" element
And I should see "Bouygues" in the "#Form_EditForm" element
But I should not see "Insurance" in the ".col-Name" element
Then I click "Cisco" in the "#Form_EditForm" element
And I should see "Cisco" in the ".breadcrumbs-wrapper" element
And I should see an "#Form_ItemEditForm_PreviousAndNextGroup_Holder" element
Then I click on the ".action--previous" element
And I should see "Ahold" in the ".breadcrumbs-wrapper" element
And I click on the ".action--previous" element
And I should see "Kraft Foods" in the ".breadcrumbs-wrapper" element
And I click on the ".action--previous" element
And I should see "UBS" in the ".breadcrumbs-wrapper" element
And I click on the ".action--previous" element
And I should see "SuperValue" in the ".breadcrumbs-wrapper" element
Then I click on the ".toolbar__back-button" element
And I should see "View 1–5 of 11" in the ".pagination-records-number" element
Then I click "SuperValue" in the "#Form_EditForm" element
And I click on the ".action--previous" element
And I should see "Safeway" in the ".breadcrumbs-wrapper" element
And I click on the ".action--previous" element
And I should see "Vitol" in the ".breadcrumbs-wrapper" element
And I click on the ".action--previous" element
And I should see "ExxonMobil" in the ".breadcrumbs-wrapper" element
And I click on the ".action--previous" element
And I should see "Walmart" in the ".breadcrumbs-wrapper" element
And I should see an ".action--previous.disabled" element
And I click on the ".action--next" element
And I should see "ExxonMobil" in the ".breadcrumbs-wrapper" element
Scenario: I can navigate forward through the GridField items by using the "next record" button
When I go to "/admin/gridfield-test-navigation"
And I should see "Walmart" in the "#Form_EditForm" element
And I should see "ExxonMobil" in the "#Form_EditForm" element
And I should see "Vitol" in the "#Form_EditForm" element
And I should see "Safeway" in the "#Form_EditForm" element
And I should see "SuperValue" in the "#Form_EditForm" element
But I should not see "UBS" in the ".col-Name" element
And I should see "3" in the ".pagination-page-number" element
And I should see "View 1–5 of 11" in the ".pagination-records-number" element
Then I click "Walmart" in the "#Form_EditForm" element
And I should see "Walmart" in the ".breadcrumbs-wrapper" element
And I should see an "#Form_ItemEditForm_PreviousAndNextGroup_Holder" element
Then I click on the ".action--next" element
And I should see "ExxonMobil" in the ".breadcrumbs-wrapper" element
And I click on the ".action--next" element
And I should see "Vitol" in the ".breadcrumbs-wrapper" element
And I click on the ".action--next" element
And I should see "Safeway" in the ".breadcrumbs-wrapper" element
And I click on the ".action--next" element
And I should see "SuperValue" in the ".breadcrumbs-wrapper" element
And I click on the ".action--next" element
And I should see "UBS" in the ".breadcrumbs-wrapper" element
Then I click on the ".toolbar__back-button" element
And I should see "View 6–10 of 11" in the ".pagination-records-number" element
Then I click "UBS" in the "#Form_EditForm" element
And I click on the ".action--next" element
And I should see "Kraft Foods" in the ".breadcrumbs-wrapper" element
And I click on the ".action--next" element
And I should see "Ahold" in the ".breadcrumbs-wrapper" element
And I click on the ".action--next" element
And I should see "Cisco" in the ".breadcrumbs-wrapper" element
And I click on the ".action--next" element
And I should see "Bouygues" in the ".breadcrumbs-wrapper" element
And I click on the ".action--next" element
And I should see "Insurance" in the ".breadcrumbs-wrapper" element
And I should see an ".action--next.disabled" element
And I click on the ".action--previous" element
And I should see "Bouygues" in the ".breadcrumbs-wrapper" element
Then I click on the ".toolbar__back-button" element
Then I click on the "#action_SetOrderName" element
Then I click on the "#action_pagination_prev" element
And I should see "View 1–5 of 11" in the ".pagination-records-number" element
And I should see "Ahold" in the "#Form_EditForm" element
And I should see "Bouygues" in the "#Form_EditForm" element
And I should see "Cisco" in the "#Form_EditForm" element
And I should see "ExxonMobil" in the "#Form_EditForm" element
And I should see "Insurance" in the "#Form_EditForm" element
Then I click on the "#action_pagination_next" element
And I should see "View 6–10 of 11" in the ".pagination-records-number" element
And I should see "Kraft Foods" in the "#Form_EditForm" element
And I should see "Safeway" in the "#Form_EditForm" element
And I should see "SuperValue" in the "#Form_EditForm" element
And I should see "UBS" in the "#Form_EditForm" element
And I should see "Vitol" in the "#Form_EditForm" element
Then I click "Vitol" in the "#Form_EditForm" element
And I should see "Vitol" in the ".breadcrumbs-wrapper" element
And I click on the ".action--previous" element
And I should see "UBS" in the ".breadcrumbs-wrapper" element
And I click on the ".action--previous" element
And I should see "SuperValue" in the ".breadcrumbs-wrapper" element
And I click on the ".action--previous" element
And I should see "Safeway" in the ".breadcrumbs-wrapper" element
And I click on the ".action--previous" element
And I should see "Kraft Foods" in the ".breadcrumbs-wrapper" element
And I click on the ".action--previous" element
And I should see "Insurance" in the ".breadcrumbs-wrapper" element
And I click on the ".action--previous" element
And I should see "ExxonMobil" in the ".breadcrumbs-wrapper" element
Then I click on the ".toolbar__back-button" element
And I should see "View 1–5 of 11" in the ".pagination-records-number" element
Scenario: I can navigate back and forward through the GridField items and keep filtered order
When I go to "/admin/gridfield-test-navigation"
And I should see "Walmart" in the "#Form_EditForm" element
And I should see "ExxonMobil" in the "#Form_EditForm" element
And I should see "Vitol" in the "#Form_EditForm" element
And I should see "Safeway" in the "#Form_EditForm" element
And I should see "SuperValue" in the "#Form_EditForm" element
But I should not see "UBS" in the ".col-Name" element
And I should see "3" in the ".pagination-page-number" element
And I should see "View 1–5 of 11" in the ".pagination-records-number" element
Then I click "Walmart" in the "#Form_EditForm" element
And I should see "Walmart"
And I should see an "#Form_ItemEditForm_PreviousAndNextGroup_Holder" element
Then I click on the ".action--next" element
And I should see "ExxonMobil"
And I click on the ".action--next" element
And I should see "Vitol"
And I click on the ".action--next" element
And I should see "Safeway"
And I click on the ".action--next" element
And I should see "SuperValue"
And I click on the ".action--next" element
And I should see "UBS"
Then I click on the ".toolbar__back-button" element
And I should see "View 6–10 of 11" in the ".pagination-records-number" element
Then I click "UBS" in the "#Form_EditForm" element
And I click on the ".action--next" element
And I should see "Kraft Foods"
Then I click on the ".toolbar__back-button" element
Then I click on the "#action_SetOrderName" element
Then I click on the "#action_pagination_prev" element
And I should see "View 1–5 of 11" in the ".pagination-records-number" element
And I should see "Ahold" in the "#Form_EditForm" element
And I should see "Bouygues" in the "#Form_EditForm" element
And I should see "Cisco" in the "#Form_EditForm" element
And I should see "ExxonMobil" in the "#Form_EditForm" element
And I should see "Insurance" in the "#Form_EditForm" element
Then I click on the "#action_pagination_next" element
And I should see "View 6–10 of 11" in the ".pagination-records-number" element
And I should see "Kraft Foods" in the "#Form_EditForm" element
And I should see "Safeway" in the "#Form_EditForm" element
And I should see "SuperValue" in the "#Form_EditForm" element
And I should see "UBS" in the "#Form_EditForm" element
And I should see "Vitol" in the "#Form_EditForm" element
Then I click "Vitol" in the "#Form_EditForm" element
And I should see "Vitol"
And I click on the ".action--previous" element
And I should see "UBS"
And I click on the ".action--previous" element
And I should see "SuperValue"
And I click on the ".action--previous" element
And I should see "Safeway"
And I click on the ".action--previous" element
And I should see "Kraft Foods"
And I click on the ".action--previous" element
And I should see "Insurance"
And I click on the ".action--previous" element
And I should see "ExxonMobil"
Then I click on the ".toolbar__back-button" element
And I should see "View 1–5 of 11" in the ".pagination-records-number" element
Scenario: I can navigate back and forward through the GridField
When I am on "/admin/pages"
Then I go to "/admin/gridfield-test-navigation"
When I press the "Open search and filter" button
And I press the "Advanced" button
And I fill in "Search__Category" with "Retail"
And I press the "Enter" key in the "Search__Category" field
Then I should see "Walmart" in the "#Form_EditForm" element
But I should not see "ExxonMobil" in the ".col-Name" element
And I should not see "Vitol" in the ".col-Name" element
And I should not see "Safeway" in the ".col-Name" element
And I should not see "SuperValue" in the ".col-Name" element
When I move backward one page
And I should see "Pages"
When I move forward one page
Then I should see "Walmart" in the "#Form_EditForm" element
But I should not see "ExxonMobil" in the ".col-Name" element
And I should not see "Vitol" in the ".col-Name" element
And I should not see "Safeway" in the ".col-Name" element
And I should not see "SuperValue" in the ".col-Name" element
When I click "Walmart" in the "#Form_EditForm" element
Then I should see "Walmart"
Then I click "Employees" in the ".ui-tabs-nav" element
And I press the "Open search and filter" button
And I press the "Advanced" button
And I fill in "Search__Name" with "Alen"
And I press the "Enter" key in the "Search__Category" field
Then I should see "Alen" in the "#Form_ItemEditForm_Employees" element
And I click "Alen" in the "#Form_ItemEditForm_Employees" element
And I click "Walmart" in the ".breadcrumbs-wrapper" element
And I click "Employees" in the ".ui-tabs-nav" element
Then I should see "Alen" in the "#Form_ItemEditForm_Employees" element
But I should not see "Bill" in the ".col-Name" element
And I should not see "Ford" in the ".col-Name" element
And I should see an "#EmployeesSearch_searchbox" element
Then I click on the ".toolbar__back-button" element
And I should see "Walmart" in the "#Form_EditForm" element
But I should not see "ExxonMobil" in the ".col-Name" element
And I should not see "Vitol" in the ".col-Name" element
And I should not see "Safeway" in the ".col-Name" element
And I should not see "SuperValue" in the ".col-Name" element
And I should see an "#SilverStripe-FrameworkTest-Model-CompanySearch_searchbox" element
When I move backward one page
Then I click "Employees" in the ".ui-tabs-nav" element
Then I should see "Alen"
But I should not see "Bill" in the ".col-Name" element
And I should not see "Ford" in the ".col-Name" element
And I should see an "#EmployeesSearch_searchbox" element
When I move forward one page
And I should see "Walmart" in the "#Form_EditForm" element
But I should not see "ExxonMobil" in the ".col-Name" element
And I should not see "Vitol" in the ".col-Name" element
And I should not see "Safeway" in the ".col-Name" element
And I should not see "SuperValue" in the ".col-Name" element
And I should see an "#SilverStripe-FrameworkTest-Model-CompanySearch_searchbox" element