@@ -155,6 +155,72 @@ Feature: Page resources
155155 Then the response status code should be 200
156156 And the JSON node "member[0].parentPage" should be equal to the IRI of the resource "page"
157157
158+ @loginAdmin
159+ Scenario : The page resources can be ordered descending by reference
160+ Given there is a Page with the reference "1"
161+ And there is a Page with the reference "2"
162+ When I send a "GET" request to "/_/pages?order[reference]=desc"
163+ Then the response status code should be 200
164+ And the JSON node "member" should have "2" elements
165+ And the JSON node "member[0].reference" should be equal to "2"
166+ And the JSON node "member[1].reference" should be equal to "1"
167+
168+ @loginAdmin
169+ Scenario : The page resources can be ordered ascending by createdAt
170+ Given there is a Page with the reference "page_1" and with createdAt "now"
171+ And there is a Page with the reference "page_2" and with createdAt "+10 seconds"
172+ When I send a "GET" request to "/_/pages?order[createdAt]=asc"
173+ Then the response status code should be 200
174+ And the JSON node "member" should have "2" elements
175+ And the JSON node "member[0].reference" should be equal to "page_1"
176+ And the JSON node "member[1].reference" should be equal to "page_2"
177+
178+ @loginAdmin
179+ Scenario : The page resources can be ordered descending by createdAt
180+ Given there is a Page with the reference "page_1" and with createdAt "now"
181+ And there is a Page with the reference "page_2" and with createdAt "+10 seconds"
182+ When I send a "GET" request to "/_/pages?order[createdAt]=desc"
183+ Then the response status code should be 200
184+ And the JSON node "member" should have "2" elements
185+ And the JSON node "member[0].reference" should be equal to "page_2"
186+ And the JSON node "member[1].reference" should be equal to "page_1"
187+
188+ @loginAdmin
189+ Scenario : The page resources can be searched by reference
190+ Given there is a Page with the reference "primary"
191+ And there is a Page with the reference "secondary"
192+ When I send a "GET" request to "/_/pages?reference=primary"
193+ Then the response status code should be 200
194+ And the JSON node "member" should have "1" element
195+ And the JSON node "member[0].reference" should be equal to "primary"
196+
197+ @loginAdmin
198+ Scenario : The page resources can be searched by title
199+ Given there is a Page with the reference "conf" and with the title "My Conference"
200+ And there is a Page with the reference "contact" and with the title "Contact Us"
201+ When I send a "GET" request to "/_/pages?title=Conference"
202+ Then the response status code should be 200
203+ And the JSON node "member" should have "1" element
204+ And the JSON node "member[0].reference" should be equal to "conf"
205+
206+ @loginAdmin
207+ Scenario : The page resources can be searched by uiComponent
208+ Given there is a Page with the reference "primary" and with the uiComponent "PrimaryPage"
209+ And there is a Page with the reference "secondary" and with the uiComponent "SecondaryPage"
210+ When I send a "GET" request to "/_/pages?uiComponent=PrimaryPage"
211+ Then the response status code should be 200
212+ And the JSON node "member" should have "1" element
213+ And the JSON node "member[0].reference" should be equal to "primary"
214+
215+ @loginAdmin
216+ Scenario : The page resources can be filtered to show only templates
217+ Given there is a template Page with the reference "my-template"
218+ And there is a Page with the reference "not-a-template"
219+ When I send a "GET" request to "/_/pages?isTemplate=1"
220+ Then the response status code should be 200
221+ And the JSON node "member" should have "1" element
222+ And the JSON node "member[0].reference" should be equal to "my-template"
223+
158224 @loginAdmin
159225 Scenario : I can get a resource manifest for a nested Page by UUID
160226 Given there is a Page resource with the route path "/conference/programme" nested within the route "/conference"
0 commit comments