Skip to content

Commit ed11742

Browse files
author
Vadim Zubovich
committed
Merge branch 'MTO-88-new' into 'iteration2-pr-new'
MTO-88: Use layered navigation to filter products - Functional test implemented. See merge request !92
2 parents 9cc8c9d + 64cc549 commit ed11742

File tree

4 files changed

+256
-1
lines changed

4 files changed

+256
-1
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,87 @@
9898
<field name="url_key" xsi:type="string">simple-product-%isolation%</field>
9999
</dataset>
100100

101+
<dataset name="product_1_dollar">
102+
<field name="attribute_set_id" xsi:type="array">
103+
<item name="dataset" xsi:type="string">default</item>
104+
</field>
105+
<field name="name" xsi:type="string">product_1_dollar %isolation%</field>
106+
<field name="sku" xsi:type="string">sku_product_1_dollar_%isolation%</field>
107+
<field name="product_has_weight" xsi:type="string">This item has weight</field>
108+
<field name="weight" xsi:type="string">1</field>
109+
<field name="quantity_and_stock_status" xsi:type="array">
110+
<item name="qty" xsi:type="string">1000</item>
111+
<item name="is_in_stock" xsi:type="string">In Stock</item>
112+
</field>
113+
<field name="price" xsi:type="array">
114+
<item name="value" xsi:type="string">1</item>
115+
</field>
116+
<field name="tax_class_id" xsi:type="array">
117+
<item name="dataset" xsi:type="string">taxable_goods</item>
118+
</field>
119+
<field name="website_ids" xsi:type="array">
120+
<item name="0" xsi:type="array">
121+
<item name="dataset" xsi:type="string">default</item>
122+
</item>
123+
</field>
124+
<field name="visibility" xsi:type="string">Catalog, Search</field>
125+
<field name="url_key" xsi:type="string">product-1-dollar-%isolation%</field>
126+
</dataset>
127+
128+
<dataset name="product_5_dollar">
129+
<field name="attribute_set_id" xsi:type="array">
130+
<item name="dataset" xsi:type="string">default</item>
131+
</field>
132+
<field name="name" xsi:type="string">product_5_dollar %isolation%</field>
133+
<field name="sku" xsi:type="string">sku_product_5_dollar_%isolation%</field>
134+
<field name="product_has_weight" xsi:type="string">This item has weight</field>
135+
<field name="weight" xsi:type="string">1</field>
136+
<field name="quantity_and_stock_status" xsi:type="array">
137+
<item name="qty" xsi:type="string">1000</item>
138+
<item name="is_in_stock" xsi:type="string">In Stock</item>
139+
</field>
140+
<field name="price" xsi:type="array">
141+
<item name="value" xsi:type="string">5</item>
142+
</field>
143+
<field name="tax_class_id" xsi:type="array">
144+
<item name="dataset" xsi:type="string">taxable_goods</item>
145+
</field>
146+
<field name="website_ids" xsi:type="array">
147+
<item name="0" xsi:type="array">
148+
<item name="dataset" xsi:type="string">default</item>
149+
</item>
150+
</field>
151+
<field name="visibility" xsi:type="string">Catalog, Search</field>
152+
<field name="url_key" xsi:type="string">product-5-dollar-%isolation%</field>
153+
</dataset>
154+
155+
<dataset name="product_9_99_dollar">
156+
<field name="attribute_set_id" xsi:type="array">
157+
<item name="dataset" xsi:type="string">default</item>
158+
</field>
159+
<field name="name" xsi:type="string">product_9_99_dollar %isolation%</field>
160+
<field name="sku" xsi:type="string">sku_product_9_99_dollar_%isolation%</field>
161+
<field name="product_has_weight" xsi:type="string">This item has weight</field>
162+
<field name="weight" xsi:type="string">1</field>
163+
<field name="quantity_and_stock_status" xsi:type="array">
164+
<item name="qty" xsi:type="string">1000</item>
165+
<item name="is_in_stock" xsi:type="string">In Stock</item>
166+
</field>
167+
<field name="price" xsi:type="array">
168+
<item name="value" xsi:type="string">9.99</item>
169+
</field>
170+
<field name="tax_class_id" xsi:type="array">
171+
<item name="dataset" xsi:type="string">taxable_goods</item>
172+
</field>
173+
<field name="website_ids" xsi:type="array">
174+
<item name="0" xsi:type="array">
175+
<item name="dataset" xsi:type="string">default</item>
176+
</item>
177+
</field>
178+
<field name="visibility" xsi:type="string">Catalog, Search</field>
179+
<field name="url_key" xsi:type="string">product-9-99-dollar-%isolation%</field>
180+
</dataset>
181+
101182
<dataset name="product_10_dollar">
102183
<field name="attribute_set_id" xsi:type="array">
103184
<item name="dataset" xsi:type="string">default</item>
@@ -128,6 +209,33 @@
128209
</field>
129210
</dataset>
130211

212+
<dataset name="product_15_dollar">
213+
<field name="attribute_set_id" xsi:type="array">
214+
<item name="dataset" xsi:type="string">default</item>
215+
</field>
216+
<field name="name" xsi:type="string">product_15_dollar %isolation%</field>
217+
<field name="sku" xsi:type="string">sku_product_15_dollar_%isolation%</field>
218+
<field name="product_has_weight" xsi:type="string">This item has weight</field>
219+
<field name="weight" xsi:type="string">1</field>
220+
<field name="quantity_and_stock_status" xsi:type="array">
221+
<item name="qty" xsi:type="string">1000</item>
222+
<item name="is_in_stock" xsi:type="string">In Stock</item>
223+
</field>
224+
<field name="price" xsi:type="array">
225+
<item name="value" xsi:type="string">15</item>
226+
</field>
227+
<field name="tax_class_id" xsi:type="array">
228+
<item name="dataset" xsi:type="string">taxable_goods</item>
229+
</field>
230+
<field name="website_ids" xsi:type="array">
231+
<item name="0" xsi:type="array">
232+
<item name="dataset" xsi:type="string">default</item>
233+
</item>
234+
</field>
235+
<field name="visibility" xsi:type="string">Catalog, Search</field>
236+
<field name="url_key" xsi:type="string">product-15-dollar-%isolation%</field>
237+
</dataset>
238+
131239
<dataset name="product_20_dollar">
132240
<field name="attribute_set_id" xsi:type="array">
133241
<item name="dataset" xsi:type="string">default</item>
@@ -155,6 +263,33 @@
155263
<field name="url_key" xsi:type="string">product-20-dollar-%isolation%</field>
156264
</dataset>
157265

266+
<dataset name="product_21_dollar">
267+
<field name="attribute_set_id" xsi:type="array">
268+
<item name="dataset" xsi:type="string">default</item>
269+
</field>
270+
<field name="name" xsi:type="string">product_21_dollar %isolation%</field>
271+
<field name="sku" xsi:type="string">sku_product_21_dollar_%isolation%</field>
272+
<field name="product_has_weight" xsi:type="string">This item has weight</field>
273+
<field name="weight" xsi:type="string">1</field>
274+
<field name="quantity_and_stock_status" xsi:type="array">
275+
<item name="qty" xsi:type="string">1000</item>
276+
<item name="is_in_stock" xsi:type="string">In Stock</item>
277+
</field>
278+
<field name="price" xsi:type="array">
279+
<item name="value" xsi:type="string">21</item>
280+
</field>
281+
<field name="tax_class_id" xsi:type="array">
282+
<item name="dataset" xsi:type="string">taxable_goods</item>
283+
</field>
284+
<field name="website_ids" xsi:type="array">
285+
<item name="0" xsi:type="array">
286+
<item name="dataset" xsi:type="string">default</item>
287+
</item>
288+
</field>
289+
<field name="visibility" xsi:type="string">Catalog, Search</field>
290+
<field name="url_key" xsi:type="string">product-21-dollar-%isolation%</field>
291+
</dataset>
292+
158293
<dataset name="product_with_url_key">
159294
<field name="name" xsi:type="string">Simple Product %isolation%</field>
160295
<field name="sku" xsi:type="string">sku_simple_product_%isolation%</field>

dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/Repository/ConfigData.xml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,40 @@
2929
<item name="value" xsi:type="string">10</item>
3030
</field>
3131
</dataset>
32+
<dataset name="layered_navigation_automatic_equalize_price_range">
33+
<field name="catalog/layered_navigation/display_product_count" xsi:type="array">
34+
<item name="scope" xsi:type="string">default</item>
35+
<item name="scope_id" xsi:type="number">0</item>
36+
<item name="value" label="Yes" xsi:type="string">1</item>
37+
</field>
38+
<field name="catalog/layered_navigation/price_range_calculation" xsi:type="array">
39+
<item name="scope" xsi:type="string">default</item>
40+
<item name="scope_id" xsi:type="number">0</item>
41+
<item name="value" label="Automatic (equalize price ranges)" xsi:type="string">auto</item>
42+
</field>
43+
</dataset>
44+
<dataset name="layered_navigation_automatic_equalize_product_counts">
45+
<field name="catalog/layered_navigation/display_product_count" xsi:type="array">
46+
<item name="scope" xsi:type="string">default</item>
47+
<item name="scope_id" xsi:type="number">0</item>
48+
<item name="value" label="Yes" xsi:type="string">1</item>
49+
</field>
50+
<field name="catalog/layered_navigation/price_range_calculation" xsi:type="array">
51+
<item name="scope" xsi:type="string">default</item>
52+
<item name="scope_id" xsi:type="number">0</item>
53+
<item name="value" label="Automatic (equalize product counts)" xsi:type="string">improved</item>
54+
</field>
55+
<field name="catalog/layered_navigation/one_price_interval" xsi:type="array">
56+
<item name="scope" xsi:type="string">default</item>
57+
<item name="scope_id" xsi:type="number">0</item>
58+
<item name="value" xsi:type="string">0</item>
59+
</field>
60+
<field name="catalog/layered_navigation/interval_division_limit" xsi:type="array">
61+
<item name="scope" xsi:type="string">default</item>
62+
<item name="scope_id" xsi:type="number">0</item>
63+
<item name="value" xsi:type="string">3</item>
64+
</field>
65+
</dataset>
3266
<dataset name="layered_navigation_manual_range_10_rollback">
3367
<field name="catalog/layered_navigation/display_product_count" xsi:type="array">
3468
<item name="scope" xsi:type="string">default</item>
@@ -41,5 +75,29 @@
4175
<item name="value" label="Automatic (equalize price ranges)" xsi:type="string">auto</item>
4276
</field>
4377
</dataset>
78+
<dataset name="layered_navigation_automatic_equalize_price_range_rollback">
79+
<field name="catalog/layered_navigation/display_product_count" xsi:type="array">
80+
<item name="scope" xsi:type="string">default</item>
81+
<item name="scope_id" xsi:type="number">0</item>
82+
<item name="value" label="Yes" xsi:type="string">1</item>
83+
</field>
84+
<field name="catalog/layered_navigation/price_range_calculation" xsi:type="array">
85+
<item name="scope" xsi:type="string">default</item>
86+
<item name="scope_id" xsi:type="number">0</item>
87+
<item name="value" label="Automatic (equalize price ranges)" xsi:type="string">auto</item>
88+
</field>
89+
</dataset>
90+
<dataset name="layered_navigation_automatic_equalize_product_counts_rollback">
91+
<field name="catalog/layered_navigation/display_product_count" xsi:type="array">
92+
<item name="scope" xsi:type="string">default</item>
93+
<item name="scope_id" xsi:type="number">0</item>
94+
<item name="value" label="Yes" xsi:type="string">1</item>
95+
</field>
96+
<field name="catalog/layered_navigation/price_range_calculation" xsi:type="array">
97+
<item name="scope" xsi:type="string">default</item>
98+
<item name="scope_id" xsi:type="number">0</item>
99+
<item name="value" label="Automatic (equalize price ranges)" xsi:type="string">auto</item>
100+
</field>
101+
</dataset>
44102
</repository>
45103
</config>

dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/TestCase/FilterProductListTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* 3. Perform all assertions.
2222
*
2323
* @group Layered_Navigation
24-
* @ZephyrId MAGETWO-12419
24+
* @ZephyrId MAGETWO-12419, MAGETWO-30617, MAGETWO-30700, MAGETWO-30702, MAGETWO-30703
2525
*/
2626
class FilterProductListTest extends Injectable
2727
{

dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/TestCase/FilterProductListTest.xml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<variation name="FilterProductListTestVariation1">
1111
<data name="tag" xsi:type="string">test_type:acceptance_test, test_type:extended_acceptance_test</data>
1212
<data name="configData" xsi:type="string">layered_navigation_manual_range_10</data>
13+
<data name="runReindex" xsi:type="string">Yes</data>
1314
<data name="category/dataset" xsi:type="string">default_anchor_subcategory</data>
1415
<data name="category/data/category_products/dataset" xsi:type="string">catalogProductSimple::product_20_dollar, configurableProduct::filterable_two_options_with_zero_price</data>
1516
<data name="layeredNavigation" xsi:type="array">
@@ -31,5 +32,66 @@
3132
<constraint name="Magento\Catalog\Test\Constraint\AssertCategoryForAssignedProducts" />
3233
<constraint name="Magento\LayeredNavigation\Test\Constraint\AssertFilterProductList" />
3334
</variation>
35+
<variation name="FilterProductListTestVariation2" ticketId="MAGETWO-30617, MAGETWO-30702">
36+
<data name="tag" xsi:type="string">test_type:acceptance_test, test_type:extended_acceptance_test</data>
37+
<data name="configData" xsi:type="string">layered_navigation_automatic_equalize_price_range</data>
38+
<data name="runReindex" xsi:type="string">Yes</data>
39+
<data name="category/dataset" xsi:type="string">default_anchor_subcategory</data>
40+
<data name="category/data/category_products/dataset" xsi:type="string">
41+
catalogProductSimple::product_1_dollar, catalogProductSimple::product_5_dollar, catalogProductSimple::product_9_99_dollar, catalogProductSimple::product_10_dollar, catalogProductSimple::product_15_dollar, catalogProductSimple::product_21_dollar
42+
</data>
43+
<data name="layeredNavigation" xsi:type="array">
44+
<item name="filters_0" xsi:type="array">
45+
<item name="0" xsi:type="array">
46+
<item name="title" xsi:type="string">Price</item>
47+
<item name="linkPattern" xsi:type="string">`^.+0\.00 - .+9\.99 3$`m</item>
48+
<item name="products" xsi:type="string">product_0, product_1, product_2</item>
49+
</item>
50+
</item>
51+
<item name="filters_1" xsi:type="array">
52+
<item name="0" xsi:type="array">
53+
<item name="title" xsi:type="string">Price</item>
54+
<item name="linkPattern" xsi:type="string">`^.+10\.00 - .+19\.99 2$`m</item>
55+
<item name="products" xsi:type="string">product_3, product_4</item>
56+
</item>
57+
</item>
58+
<item name="filters_2" xsi:type="array">
59+
<item name="0" xsi:type="array">
60+
<item name="title" xsi:type="string">Price</item>
61+
<item name="linkPattern" xsi:type="string">`^.+20\.00 and above 1$`m</item>
62+
<item name="products" xsi:type="string">product_5</item>
63+
</item>
64+
</item>
65+
</data>
66+
<constraint name="Magento\Catalog\Test\Constraint\AssertCategoryForAssignedProducts" />
67+
<constraint name="Magento\LayeredNavigation\Test\Constraint\AssertFilterProductList" />
68+
</variation>
69+
<variation name="FilterProductListTestVariation3" ticketId="MAGETWO-30700, MAGETWO-30703">
70+
<data name="tag" xsi:type="string">test_type:acceptance_test, test_type:extended_acceptance_test</data>
71+
<data name="configData" xsi:type="string">layered_navigation_automatic_equalize_product_counts</data>
72+
<data name="runReindex" xsi:type="string">Yes</data>
73+
<data name="category/dataset" xsi:type="string">default_anchor_subcategory</data>
74+
<data name="category/data/category_products/dataset" xsi:type="string">
75+
catalogProductSimple::product_1_dollar, catalogProductSimple::product_5_dollar, catalogProductSimple::product_9_99_dollar, catalogProductSimple::product_10_dollar, catalogProductSimple::product_15_dollar, catalogProductSimple::product_21_dollar
76+
</data>
77+
<data name="layeredNavigation" xsi:type="array">
78+
<item name="filters_0" xsi:type="array">
79+
<item name="0" xsi:type="array">
80+
<item name="title" xsi:type="string">Price</item>
81+
<item name="linkPattern" xsi:type="string">`^.+0\.00 - .+9\.99 3$`m</item>
82+
<item name="products" xsi:type="string">product_0, product_1, product_2</item>
83+
</item>
84+
</item>
85+
<item name="filters_1" xsi:type="array">
86+
<item name="0" xsi:type="array">
87+
<item name="title" xsi:type="string">Price</item>
88+
<item name="linkPattern" xsi:type="string">`^.+10\.00 and above 3$`m</item>
89+
<item name="products" xsi:type="string">product_3, product_4, product_5</item>
90+
</item>
91+
</item>
92+
</data>
93+
<constraint name="Magento\Catalog\Test\Constraint\AssertCategoryForAssignedProducts" />
94+
<constraint name="Magento\LayeredNavigation\Test\Constraint\AssertFilterProductList" />
95+
</variation>
3496
</testCase>
3597
</config>

0 commit comments

Comments
 (0)