@@ -45,4 +45,67 @@ Feature: Layout resources
4545 When I send a "DELETE" request to the resource "layout"
4646 Then the response status code should be 204
4747
48- # Todo: Order by and search filter tests needed to ensure it is implemented
48+ @loginUser
49+ Scenario : The layout resources can be filtered by reference
50+ Given there is a Layout with the reference "primary"
51+ And there is a Layout with the reference "secondary"
52+ When I send a "GET" request to "/_/layouts"
53+ Then the response status code should be 200
54+ And the JSON node "hydra:member" should have "2" elements
55+
56+ @loginUser
57+ Scenario : The layout resources can be filtered by reference
58+ Given there is a Layout with the reference "primary"
59+ And there is a Layout with the reference "secondary"
60+ When I send a "GET" request to "/_/layouts?reference=primary"
61+ Then the response status code should be 200
62+ And the JSON node "hydra:member" should have "1" element
63+
64+ @loginUser
65+ Scenario : The layout resources can be ordered ascending by reference
66+ Given there is a Layout with the reference "1"
67+ And there is a Layout with the reference "2"
68+ When I send a "GET" request to "/_/layouts?order[reference]=asc"
69+ Then the response status code should be 200
70+ And the JSON node "hydra:member" should have "2" elements
71+ And the JSON node "hydra:member[0].reference" should be equal to "1"
72+ And the JSON node "hydra:member[1].reference" should be equal to "2"
73+
74+ @loginUser
75+ Scenario : The layout resources can be ordered descending by reference
76+ Given there is a Layout with the reference "1"
77+ And there is a Layout with the reference "2"
78+ When I send a "GET" request to "/_/layouts?order[reference]=desc"
79+ Then the response status code should be 200
80+ And the JSON node "hydra:member" should have "2" elements
81+ And the JSON node "hydra:member[0].reference" should be equal to "2"
82+ And the JSON node "hydra:member[1].reference" should be equal to "1"
83+
84+ @loginUser
85+ Scenario : The layout resources can be ordered ascending by createdAt
86+ Given there is a Layout with the reference "layout_1" and with createdAt "now"
87+ And there is a Layout with the reference "layout_2" and with createdAt "+10 seconds"
88+ When I send a "GET" request to "/_/layouts?order[createdAt]=asc"
89+ Then the response status code should be 200
90+ And the JSON node "hydra:member" should have "2" elements
91+ And the JSON node "hydra:member[0].reference" should be equal to "layout_1"
92+ And the JSON node "hydra:member[1].reference" should be equal to "layout_2"
93+
94+ @loginUser
95+ Scenario : The layout resources can be ordered descending by createdAt
96+ Given there is a Layout with the reference "layout_1" and with createdAt "now"
97+ And there is a Layout with the reference "layout_2" and with createdAt "+10 seconds"
98+ When I send a "GET" request to "/_/layouts?order[createdAt]=desc"
99+ Then the response status code should be 200
100+ And the JSON node "hydra:member" should have "2" elements
101+ And the JSON node "hydra:member[0].reference" should be equal to "layout_2"
102+ And the JSON node "hydra:member[1].reference" should be equal to "layout_1"
103+
104+ @loginUser
105+ Scenario : The layout resources can be filtered by ui components
106+ Given there is a Layout with the reference "primary" and with the uiComponent "PrimaryLayout"
107+ And there is a Layout with the reference "secondary" and with the uiComponent "SecondaryLayout"
108+ When I send a "GET" request to "/_/layouts?uiComponent=PrimaryLayout"
109+ Then the response status code should be 200
110+ And the JSON node "hydra:member" should have "1" elements
111+ And the JSON node "hydra:member[0].reference" should be equal to "primary"
0 commit comments