@@ -89,10 +89,18 @@ protected function setUp()
8989 * @param string $sortBy
9090 * @param string $direction
9191 * @param array $expectation
92+ * @param string|null $incompleteReason
9293 * @return void
9394 */
94- public function testProductListSortOrder (string $ sortBy , string $ direction , array $ expectation ): void
95- {
95+ public function testProductListSortOrder (
96+ string $ sortBy ,
97+ string $ direction ,
98+ array $ expectation ,
99+ string $ incompleteReason = null
100+ ): void {
101+ if ($ incompleteReason ) {
102+ $ this ->markTestIncomplete ($ incompleteReason );
103+ }
96104 $ category = $ this ->updateCategorySortBy ('Category 1 ' , Store::DEFAULT_STORE_ID , $ sortBy );
97105 $ this ->renderBlock ($ category , $ direction );
98106 $ this ->assertBlockSorting ($ sortBy , $ expectation );
@@ -104,10 +112,18 @@ public function testProductListSortOrder(string $sortBy, string $direction, arra
104112 * @param string $sortBy
105113 * @param string $direction
106114 * @param array $expectation
115+ * @param string|null $incompleteReason
107116 * @return void
108117 */
109- public function testProductListSortOrderWithConfig (string $ sortBy , string $ direction , array $ expectation ): void
110- {
118+ public function testProductListSortOrderWithConfig (
119+ string $ sortBy ,
120+ string $ direction ,
121+ array $ expectation ,
122+ string $ incompleteReason = null
123+ ): void {
124+ if ($ incompleteReason ) {
125+ $ this ->markTestIncomplete ($ incompleteReason );
126+ }
111127 $ this ->assertProductListSortOrderWithConfig ($ sortBy , $ direction , $ expectation );
112128 }
113129
@@ -147,17 +163,20 @@ public function productListSortOrderDataProvider(): array
147163 'direction ' => 'desc ' ,
148164 'expectation ' => ['simple3 ' , 'simple2 ' , 'simple1 ' ],
149165 ],
150- // TODO: Skipped MC-33231
151- //'default_order_custom_attribute_asc' => [
152- // 'sort' => 'test_configurable',
153- // 'direction' => 'asc',
154- // 'expectation' => ['simple1', 'simple3', 'simple2'],
155- //],
156- //'default_order_custom_attribute_desc' => [
157- // 'sort' => 'test_configurable',
158- // 'direction' => 'desc',
159- // 'expectation' => ['simple3', 'simple2', 'simple1'],
160- //],
166+ 'default_order_custom_attribute_asc ' => [
167+ 'sort ' => 'test_configurable ' ,
168+ 'direction ' => 'asc ' ,
169+ 'expectation ' => ['simple1 ' , 'simple3 ' , 'simple2 ' ],
170+ 'incomplete_reason ' => 'MC-33825: '
171+ . 'Stabilize skipped test cases for Integration SortingTest with elasticsearch ' ,
172+ ],
173+ 'default_order_custom_attribute_desc ' => [
174+ 'sort ' => 'test_configurable ' ,
175+ 'direction ' => 'desc ' ,
176+ 'expectation ' => ['simple3 ' , 'simple2 ' , 'simple1 ' ],
177+ 'incomplete_reason ' => 'MC-33825: '
178+ . 'Stabilize skipped test cases for Integration SortingTest with elasticsearch ' ,
179+ ],
161180 ];
162181 }
163182
@@ -169,14 +188,19 @@ public function productListSortOrderDataProvider(): array
169188 * @param string $direction
170189 * @param array $expectation
171190 * @param string $defaultSortBy
191+ * @param string|null $incompleteReason
172192 * @return void
173193 */
174194 public function testProductListSortOrderOnStoreView (
175195 string $ sortBy ,
176196 string $ direction ,
177197 array $ expectation ,
178- string $ defaultSortBy
198+ string $ defaultSortBy ,
199+ string $ incompleteReason = null
179200 ): void {
201+ if ($ incompleteReason ) {
202+ $ this ->markTestIncomplete ($ incompleteReason );
203+ }
180204 $ secondStoreId = (int )$ this ->storeManager ->getStore ('fixture_second_store ' )->getId ();
181205 $ this ->updateCategorySortBy ('Category 1 ' , Store::DEFAULT_STORE_ID , $ defaultSortBy );
182206 $ category = $ this ->updateCategorySortBy ('Category 1 ' , $ secondStoreId , $ sortBy );
@@ -192,14 +216,19 @@ public function testProductListSortOrderOnStoreView(
192216 * @param string $direction
193217 * @param array $expectation
194218 * @param string $defaultSortBy
219+ * @param string|null $incompleteReason,
195220 * @return void
196221 */
197222 public function testProductListSortOrderWithConfigOnStoreView (
198223 string $ sortBy ,
199224 string $ direction ,
200225 array $ expectation ,
201- string $ defaultSortBy
226+ string $ defaultSortBy ,
227+ string $ incompleteReason = null
202228 ): void {
229+ if ($ incompleteReason ) {
230+ $ this ->markTestIncomplete ($ incompleteReason );
231+ }
203232 $ this ->objectManager ->removeSharedInstance (Config::class);
204233 $ secondStoreId = (int )$ this ->storeManager ->getStore ('fixture_second_store ' )->getId ();
205234 $ this ->scopeConfig ->setValue (
@@ -225,20 +254,60 @@ public function testProductListSortOrderWithConfigOnStoreView(
225254 */
226255 public function productListSortOrderDataProviderOnStoreView (): array
227256 {
228- return array_merge_recursive (
229- $ this ->productListSortOrderDataProvider (),
230- [
231- 'default_order_price_asc ' => ['default_sort ' => 'position ' ],
232- 'default_order_price_desc ' => ['default_sort ' => 'position ' ],
233- 'default_order_position_asc ' => ['default_sort ' => 'price ' ],
234- 'default_order_position_desc ' => ['default_sort ' => 'price ' ],
235- 'default_order_name_asc ' => ['default_sort ' => 'price ' ],
236- 'default_order_name_desc ' => ['default_sort ' => 'price ' ],
237- // TODO: Skipped MC-33231
238- //'default_order_custom_attribute_asc' => ['default_sort' => 'price'],
239- //'default_order_custom_attribute_desc' => ['default_sort' => 'price'],
240- ]
241- );
257+ return [
258+ 'default_order_price_asc ' => [
259+ 'sort ' => 'price ' ,
260+ 'direction ' => 'asc ' ,
261+ 'expectation ' => ['simple1 ' , 'simple2 ' , 'simple3 ' ],
262+ 'default_sort ' => 'position '
263+ ],
264+ 'default_order_price_desc ' => [
265+ 'sort ' => 'price ' ,
266+ 'direction ' => 'desc ' ,
267+ 'expectation ' => ['simple3 ' , 'simple2 ' , 'simple1 ' ],
268+ 'default_sort ' => 'position '
269+ ],
270+ 'default_order_position_asc ' => [
271+ 'sort ' => 'position ' ,
272+ 'direction ' => 'asc ' ,
273+ 'expectation ' => ['simple1 ' , 'simple2 ' , 'simple3 ' ],
274+ 'default_sort ' => 'price '
275+ ],
276+ 'default_order_position_desc ' => [
277+ 'sort ' => 'position ' ,
278+ 'direction ' => 'desc ' ,
279+ 'expectation ' => ['simple3 ' , 'simple2 ' , 'simple1 ' ],
280+ 'default_sort ' => 'price '
281+ ],
282+ 'default_order_name_asc ' => [
283+ 'sort ' => 'name ' ,
284+ 'direction ' => 'asc ' ,
285+ 'expectation ' => ['simple1 ' , 'simple2 ' , 'simple3 ' ],
286+ 'default_sort ' => 'price '
287+ ],
288+ 'default_order_name_desc ' => [
289+ 'sort ' => 'name ' ,
290+ 'direction ' => 'desc ' ,
291+ 'expectation ' => ['simple3 ' , 'simple2 ' , 'simple1 ' ],
292+ 'default_sort ' => 'price '
293+ ],
294+ 'default_order_custom_attribute_asc ' => [
295+ 'sort ' => 'test_configurable ' ,
296+ 'direction ' => 'asc ' ,
297+ 'expectation ' => ['simple1 ' , 'simple3 ' , 'simple2 ' ],
298+ 'default_sort ' => 'price ' ,
299+ 'incomplete_reason ' => 'MC-33825: '
300+ . 'Stabilize skipped test cases for Integration SortingTest with elasticsearch ' ,
301+ ],
302+ 'default_order_custom_attribute_desc ' => [
303+ 'sort ' => 'test_configurable ' ,
304+ 'direction ' => 'desc ' ,
305+ 'expectation ' => ['simple3 ' , 'simple2 ' , 'simple1 ' ],
306+ 'default_sort ' => 'price ' ,
307+ 'incomplete_reason ' => 'MC-33825: '
308+ . 'Stabilize skipped test cases for Integration SortingTest with elasticsearch ' ,
309+ ],
310+ ];
242311 }
243312
244313 /**
0 commit comments