Skip to content

Commit 0d0b300

Browse files
authored
Merge pull request #3779 from magento-pangolin/mtf-eol-pr
[pangolins] Convert MTF tests to MFTF tests
2 parents 94383aa + 51aa164 commit 0d0b300

File tree

60 files changed

+3103
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+3103
-20
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,66 @@
148148
<waitForPageLoad stepKey="waitForAttributeToSave"/>
149149
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/>
150150
</actionGroup>
151+
152+
<!--Clicks Add Attribute and adds the given attribute-->
153+
<actionGroup name="addProductAttributeInProductModal">
154+
<arguments>
155+
<argument name="attributeCode" type="string"/>
156+
</arguments>
157+
<click stepKey="addAttribute" selector="{{AdminProductFormActionSection.addAttributeButton}}"/>
158+
<conditionalClick selector="{{AdminProductAddAttributeModalSection.clearFilters}}" dependentSelector="{{AdminProductAddAttributeModalSection.clearFilters}}" visible="true" stepKey="clearFilters"/>
159+
<click stepKey="clickFilters" selector="{{AdminProductAddAttributeModalSection.filters}}"/>
160+
<fillField stepKey="fillCode" selector="{{AdminProductAddAttributeModalSection.attributeCodeFilter}}" userInput="{{attributeCode}}"/>
161+
<click stepKey="clickApply" selector="{{AdminProductAddAttributeModalSection.applyFilters}}"/>
162+
<waitForPageLoad stepKey="waitForFilters"/>
163+
<checkOption selector="{{AdminProductAddAttributeModalSection.firstRowCheckBox}}" stepKey="checkAttribute"/>
164+
<click stepKey="addSelected" selector="{{AdminProductAddAttributeModalSection.addSelected}}"/>
165+
</actionGroup>
166+
167+
<!--Clicks createNewAttribute and fills out form-->
168+
<actionGroup name="createProductAttribute">
169+
<arguments>
170+
<argument name="attribute" type="entity" defaultValue="productAttributeWysiwyg"/>
171+
</arguments>
172+
<click stepKey="createNewAttribute" selector="{{AdminProductAttributeGridSection.createNewAttributeBtn}}"/>
173+
<fillField stepKey="fillDefaultLabel" selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attribute.attribute_code}}"/>
174+
<selectOption selector="{{AttributePropertiesSection.InputType}}" stepKey="checkInputType" userInput="{{attribute.frontend_input}}"/>
175+
<selectOption selector="{{AttributePropertiesSection.ValueRequired}}" stepKey="checkRequired" userInput="{{attribute.is_required_admin}}"/>
176+
<click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/>
177+
</actionGroup>
178+
179+
<!-- Inputs text default value and attribute code-->
180+
<actionGroup name="createProductAttributeWithTextField" extends="createProductAttribute" insertAfter="checkRequired">
181+
<click stepKey="openAdvancedProperties" selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}"/>
182+
<fillField stepKey="fillCode" selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}"/>
183+
<fillField stepKey="fillDefaultValue" selector="{{AdvancedAttributePropertiesSection.DefaultValueText}}" userInput="{{attribute.default_value}}"/>
184+
</actionGroup>
185+
186+
<!-- Inputs date default value and attribute code-->
187+
<actionGroup name="createProductAttributeWithDateField" extends="createProductAttribute" insertAfter="checkRequired">
188+
<arguments>
189+
<argument name="date" type="string"/>
190+
</arguments>
191+
<click stepKey="openAdvancedProperties" selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}"/>
192+
<fillField stepKey="fillCode" selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}"/>
193+
<fillField stepKey="fillDefaultValue" selector="{{AdvancedAttributePropertiesSection.DefaultValueDate}}" userInput="{{date}}"/>
194+
</actionGroup>
195+
196+
<!-- Creates dropdown option at row without saving-->
197+
<actionGroup name="createAttributeDropdownNthOption">
198+
<arguments>
199+
<argument name="row" type="string"/>
200+
<argument name="adminName" type="string"/>
201+
<argument name="frontName" type="string"/>
202+
</arguments>
203+
<click stepKey="clickAddOptions" selector="{{AttributePropertiesSection.dropdownAddOptions}}"/>
204+
<waitForPageLoad stepKey="waitForNewOption"/>
205+
<fillField stepKey="fillAdmin" selector="{{AttributePropertiesSection.dropdownNthOptionAdmin(row)}}" userInput="{{adminName}}"/>
206+
<fillField stepKey="fillStoreView" selector="{{AttributePropertiesSection.dropdownNthOptionDefaultStoreView(row)}}" userInput="{{frontName}}"/>
207+
</actionGroup>
208+
209+
<!-- Creates dropdown option at row as default-->
210+
<actionGroup name="createAttributeDropdownNthOptionAsDefault" extends="createAttributeDropdownNthOption">
211+
<checkOption selector="{{AttributePropertiesSection.dropdownNthOptionIsDefault(row)}}" stepKey="setAsDefault" after="fillStoreView"/>
212+
</actionGroup>
151213
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,14 @@
6464
<waitForPageLoad stepKey="waitForUserInput"/>
6565
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/>
6666
</actionGroup>
67+
<actionGroup name="FilterProductAttributeSetGridByAttributeSetName">
68+
<arguments>
69+
<argument name="name" type="string"/>
70+
</arguments>
71+
<click selector="{{AdminProductAttributeSetGridSection.resetFilter}}" stepKey="clickResetButton"/>
72+
<fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{name}}" stepKey="filterByName"/>
73+
<click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/>
74+
<click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/>
75+
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
76+
</actionGroup>
6777
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,10 @@
104104
<data key="is_active">false</data>
105105
<data key="include_in_menu">true</data>
106106
</entity>
107+
<entity name="CatInactiveNotInMenu" type="category">
108+
<data key="name" unique="suffix">InactiveNotInMenu</data>
109+
<data key="name_lwr" unique="suffix">inactivenotinmenu</data>
110+
<data key="is_active">false</data>
111+
<data key="include_in_menu">false</data>
112+
</entity>
107113
</entities>

app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,27 @@
7373
<data key="used_for_sort_by">true</data>
7474
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
7575
</entity>
76+
<entity name="productDropDownAttributeNotSearchable" type="ProductAttribute">
77+
<data key="attribute_code" unique="suffix">attribute</data>
78+
<data key="frontend_input">select</data>
79+
<data key="scope">global</data>
80+
<data key="is_required">false</data>
81+
<data key="is_unique">false</data>
82+
<data key="is_searchable">false</data>
83+
<data key="is_visible">true</data>
84+
<data key="is_visible_in_advanced_search">true</data>
85+
<data key="is_visible_on_front">true</data>
86+
<data key="is_filterable">true</data>
87+
<data key="is_filterable_in_search">true</data>
88+
<data key="used_in_product_listing">true</data>
89+
<data key="is_used_for_promo_rules">true</data>
90+
<data key="is_comparable">true</data>
91+
<data key="is_used_in_grid">true</data>
92+
<data key="is_visible_in_grid">true</data>
93+
<data key="is_filterable_in_grid">true</data>
94+
<data key="used_for_sort_by">true</data>
95+
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
96+
</entity>
7697
<entity name="productAttributeWithDropdownTwoOptions" type="ProductAttribute">
7798
<data key="attribute_code">testattribute</data>
7899
<data key="frontend_input">select</data>
@@ -115,6 +136,27 @@
115136
<data key="used_for_sort_by">true</data>
116137
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
117138
</entity>
139+
<entity name="productAttributeMultiselectTwoOptionsNotSearchable" type="ProductAttribute">
140+
<data key="attribute_code" unique="suffix">attribute</data>
141+
<data key="frontend_input">multiselect</data>
142+
<data key="scope">global</data>
143+
<data key="is_required">false</data>
144+
<data key="is_unique">false</data>
145+
<data key="is_searchable">false</data>
146+
<data key="is_visible">true</data>
147+
<data key="is_visible_in_advanced_search">true</data>
148+
<data key="is_visible_on_front">true</data>
149+
<data key="is_filterable">true</data>
150+
<data key="is_filterable_in_search">true</data>
151+
<data key="used_in_product_listing">true</data>
152+
<data key="is_used_for_promo_rules">true</data>
153+
<data key="is_comparable">true</data>
154+
<data key="is_used_in_grid">true</data>
155+
<data key="is_visible_in_grid">true</data>
156+
<data key="is_filterable_in_grid">true</data>
157+
<data key="used_for_sort_by">true</data>
158+
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
159+
</entity>
118160
<entity name="newsFromDate" type="ProductAttribute">
119161
<data key="attribute_code">news_from_date</data>
120162
<data key="default_frontend_label">Set Product as New from Date</data>
@@ -138,7 +180,7 @@
138180
</entity>
139181
<entity name="newProductAttribute" type="ProductAttribute">
140182
<data key="attribute_code" unique="suffix">attribute</data>
141-
<data key="frontend_input">Text Field</data>
183+
<data key="frontend_input">text</data>
142184
<data key="scope">global</data>
143185
<data key="is_required">false</data>
144186
<data key="is_unique">false</data>
@@ -201,4 +243,46 @@
201243
<data key="used_for_sort_by">false</data>
202244
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
203245
</entity>
246+
<entity name="textProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute">
247+
<data key="frontend_input">text</data>
248+
<data key="default_value" unique="suffix">defaultValue</data>
249+
<data key="is_required_admin">No</data>
250+
</entity>
251+
<entity name="dateProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute">
252+
<data key="frontend_input">date</data>
253+
<data key="is_required_admin">No</data>
254+
</entity>
255+
<entity name="priceProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute">
256+
<data key="frontend_input">date</data>
257+
<data key="is_required_admin">No</data>
258+
</entity>
259+
<entity name="dropdownProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute">
260+
<data key="frontend_input">select</data>
261+
<data key="frontend_input_admin">Dropdown</data>
262+
<data key="is_required_admin">No</data>
263+
<data key="option1_admin" unique="suffix">opt1Admin</data>
264+
<data key="option1_frontend" unique="suffix">opt1Front</data>
265+
<data key="option2_admin" unique="suffix">opt2Admin</data>
266+
<data key="option2_frontend" unique="suffix">opt2Front</data>
267+
<data key="option3_admin" unique="suffix">opt3Admin</data>
268+
<data key="option3_frontend" unique="suffix">opt3Front</data>
269+
</entity>
270+
<entity name="multiselectProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute">
271+
<data key="frontend_input">multiselect</data>
272+
<data key="frontend_input_admin">Multiple Select</data>
273+
<data key="is_required_admin">No</data>
274+
<data key="option1_admin" unique="suffix">opt1Admin</data>
275+
<data key="option1_frontend" unique="suffix">opt1Front</data>
276+
<data key="option2_admin" unique="suffix">opt2Admin</data>
277+
<data key="option2_frontend" unique="suffix">opt2Front</data>
278+
<data key="option3_admin" unique="suffix">opt3Admin</data>
279+
<data key="option3_frontend" unique="suffix">opt3Front</data>
280+
</entity>
281+
<entity name="dropdownProductAttributeWithQuote" extends="productAttributeWysiwyg" type="ProductAttribute">
282+
<data key="frontend_input">select</data>
283+
<data key="frontend_input_admin">Dropdown</data>
284+
<data key="is_required_admin">No</data>
285+
<data key="option1_admin" unique="suffix">opt1'Admin</data>
286+
<data key="option1_frontend" unique="suffix">opt1'Front</data>
287+
</entity>
204288
</entities>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,129 @@
708708
<data key="urlKey" unique="suffix">virtual-product</data>
709709
<data key="type_id">virtual</data>
710710
</entity>
711+
<entity name="simpleProductRegularPrice325InStock" type="product">
712+
<data key="urlKey" unique="suffix">test-simple-product</data>
713+
<data key="name" unique="suffix">TestSimpleProduct</data>
714+
<data key="sku" unique="suffix">test_simple_product_sku</data>
715+
<data key="price">325.02</data>
716+
<data key="quantity">89</data>
717+
<data key="status">In Stock</data>
718+
<data key="storefrontStatus">IN STOCK</data>
719+
<data key="weight">89.0000</data>
720+
<data key="visibility">Search</data>
721+
<data key="type_id">simple</data>
722+
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
723+
</entity>
724+
<entity name="simpleProductRegularPrice32503OutOfStock" type="product">
725+
<data key="urlKey" unique="suffix">test-simple-product</data>
726+
<data key="name" unique="suffix">TestSimpleProduct</data>
727+
<data key="sku" unique="suffix">test_simple_product_sku</data>
728+
<data key="price">325.03</data>
729+
<data key="quantity">25</data>
730+
<data key="status">Out of Stock</data>
731+
<data key="storefrontStatus">OUT OF STOCK</data>
732+
<data key="weight">125.0000</data>
733+
<data key="type_id">simple</data>
734+
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
735+
</entity>
736+
<entity name="simpleProductRegularPrice245InStock" type="product">
737+
<data key="urlKey" unique="suffix">test-simple-product</data>
738+
<data key="name" unique="suffix">TestSimpleProduct</data>
739+
<data key="sku" unique="suffix">test_simple_product_sku</data>
740+
<data key="price">245.00</data>
741+
<data key="quantity">200</data>
742+
<data key="status">In Stock</data>
743+
<data key="storefrontStatus">IN STOCK</data>
744+
<data key="weight">120.0000</data>
745+
<data key="visibility">Catalog, Search</data>
746+
<data key="type_id">simple</data>
747+
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
748+
</entity>
749+
<entity name="simpleProductRegularPrice32501InStock" type="product">
750+
<data key="urlKey" unique="suffix">test-simple-product</data>
751+
<data key="name" unique="suffix">TestSimpleProduct</data>
752+
<data key="sku" unique="suffix">test_simple_product_sku</data>
753+
<data key="price">325.01</data>
754+
<data key="quantity">125</data>
755+
<data key="status">In Stock</data>
756+
<data key="storefrontStatus">IN STOCK</data>
757+
<data key="weight">25.0000</data>
758+
<data key="visibility">Catalog</data>
759+
<data key="type_id">simple</data>
760+
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
761+
</entity>
762+
<entity name="simpleProductTierPrice300InStock" type="product">
763+
<data key="urlKey" unique="suffix">test-simple-product</data>
764+
<data key="name" unique="suffix">TestSimpleProduct</data>
765+
<data key="sku" unique="suffix">test_simple_product_sku</data>
766+
<data key="price">300.00</data>
767+
<data key="quantity">34</data>
768+
<data key="status">In Stock</data>
769+
<data key="storefrontStatus">IN STOCK</data>
770+
<data key="weight">1</data>
771+
<data key="weightSelect">This item has weight</data>
772+
<data key="type_id">simple</data>
773+
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
774+
</entity>
775+
<entity name="simpleProductEnabledFlat" type="product">
776+
<data key="urlKey" unique="suffix">test-simple-product</data>
777+
<data key="name" unique="suffix">TestSimpleProduct</data>
778+
<data key="sku" unique="suffix">test_simple_product_sku</data>
779+
<data key="price">1.99</data>
780+
<data key="productTaxClass">Taxable Goods</data>
781+
<data key="quantity">1000</data>
782+
<data key="status">1</data>
783+
<data key="storefrontStatus">IN STOCK</data>
784+
<data key="weight">1</data>
785+
<data key="weightSelect">This item has weight</data>
786+
<data key="visibility">Catalog, Search</data>
787+
<data key="type_id">simple</data>
788+
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
789+
</entity>
790+
<entity name="simpleProductRegularPriceCustomOptions" type="product">
791+
<data key="urlKey" unique="suffix">test-simple-product</data>
792+
<data key="name" unique="suffix">TestSimpleProduct</data>
793+
<data key="sku" unique="suffix">test_simple_product_sku</data>
794+
<data key="price">245.00</data>
795+
<data key="storefront_new_cartprice">343.00</data>
796+
<data key="quantity">200</data>
797+
<data key="status">In Stock</data>
798+
<data key="storefrontStatus">IN STOCK</data>
799+
<data key="weight">120.0000</data>
800+
<data key="type_id">simple</data>
801+
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
802+
</entity>
803+
<entity name="simpleProductDisabled" type="product">
804+
<data key="urlKey" unique="suffix">test-simple-product</data>
805+
<data key="name" unique="suffix">TestSimpleProduct</data>
806+
<data key="sku" unique="suffix">test_simple_product_sku</data>
807+
<data key="price">74.00</data>
808+
<data key="quantity">87</data>
809+
<data key="status">In Stock</data>
810+
<data key="weight">333.0000</data>
811+
<data key="type_id">simple</data>
812+
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
813+
</entity>
814+
<entity name="simpleProductNotVisibleIndividually" type="product">
815+
<data key="urlKey" unique="suffix">test-simple-product</data>
816+
<data key="name" unique="suffix">TestSimpleProduct</data>
817+
<data key="sku" unique="suffix">test_simple_product_sku</data>
818+
<data key="price">325.00</data>
819+
<data key="quantity">123</data>
820+
<data key="status">In Stock</data>
821+
<data key="weight">129.0000</data>
822+
<data key="visibility">Not Visible Individually</data>
823+
<data key="type_id">simple</data>
824+
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
825+
</entity>
826+
<entity name="simpleProductDataOverriding" type="product">
827+
<data key="urlKey" unique="suffix">test-simple-product</data>
828+
<data key="name" unique="suffix">TestSimpleProduct</data>
829+
<data key="sku" unique="suffix">test_simple_product_sku</data>
830+
<data key="price">9.99</data>
831+
<data key="type_id">simple</data>
832+
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
833+
</entity>
711834
<entity name="nameAndAttributeSkuMaskSimpleProduct" type="product">
712835
<data key="urlKey" unique="suffix">simple-product</data>
713836
<data key="name" unique="suffix">SimpleProduct</data>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="simpleProductCustomizableOption">
12+
<data key="title" unique="suffix">Test3 option</data>
13+
<data key="type">Drop-down</data>
14+
<data key="is_required">1</data>
15+
<data key="option_0_title" unique="suffix">40 Percent</data>
16+
<data key="option_0_price">40.00</data>
17+
<data key="option_0_price_type">Percent</data>
18+
<data key="option_0_sku" unique="suffix">sku_drop_down_row_1</data>
19+
</entity>
20+
</entities>

0 commit comments

Comments
 (0)