Skip to content

Commit c6e298e

Browse files
committed
Merge remote-tracking branch 'origin/MC-4416' into mtf-eol
2 parents bce29bd + 5821d6d commit c6e298e

9 files changed

+577
-1
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.NewAttribute}}"/>
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/Data/ProductAttributeData.xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,4 +201,46 @@
201201
<data key="used_for_sort_by">false</data>
202202
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
203203
</entity>
204+
<entity name="textProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute">
205+
<data key="frontend_input">text</data>
206+
<data key="default_value" unique="suffix">defaultValue</data>
207+
<data key="is_required_admin">No</data>
208+
</entity>
209+
<entity name="dateProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute">
210+
<data key="frontend_input">date</data>
211+
<data key="is_required_admin">No</data>
212+
</entity>
213+
<entity name="priceProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute">
214+
<data key="frontend_input">date</data>
215+
<data key="is_required_admin">No</data>
216+
</entity>
217+
<entity name="dropdownProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute">
218+
<data key="frontend_input">select</data>
219+
<data key="frontend_input_admin">Dropdown</data>
220+
<data key="is_required_admin">No</data>
221+
<data key="option1_admin" unique="suffix">opt1Admin</data>
222+
<data key="option1_frontend" unique="suffix">opt1Front</data>
223+
<data key="option2_admin" unique="suffix">opt2Admin</data>
224+
<data key="option2_frontend" unique="suffix">opt2Front</data>
225+
<data key="option3_admin" unique="suffix">opt3Admin</data>
226+
<data key="option3_frontend" unique="suffix">opt3Front</data>
227+
</entity>
228+
<entity name="multiselectProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute">
229+
<data key="frontend_input">multiselect</data>
230+
<data key="frontend_input_admin">Multiple Select</data>
231+
<data key="is_required_admin">No</data>
232+
<data key="option1_admin" unique="suffix">opt1Admin</data>
233+
<data key="option1_frontend" unique="suffix">opt1Front</data>
234+
<data key="option2_admin" unique="suffix">opt2Admin</data>
235+
<data key="option2_frontend" unique="suffix">opt2Front</data>
236+
<data key="option3_admin" unique="suffix">opt3Admin</data>
237+
<data key="option3_frontend" unique="suffix">opt3Front</data>
238+
</entity>
239+
<entity name="dropdownProductAttributeWithQuote" extends="productAttributeWysiwyg" type="ProductAttribute">
240+
<data key="frontend_input">select</data>
241+
<data key="frontend_input_admin">Dropdown</data>
242+
<data key="is_required_admin">No</data>
243+
<data key="option1_admin" unique="suffix">opt1'Admin</data>
244+
<data key="option1_frontend" unique="suffix">opt1'Front</data>
245+
</entity>
204246
</entities>

app/code/Magento/Catalog/Test/Mftf/Page/AdminProductCreatePage.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
<section name="AdminProductImagesSection"/>
1616
<section name="AdminAddProductsToOptionPanel"/>
1717
<section name="AdminProductMessagesSection"/>
18+
<section name="AdminProductAttributesSection"/>
1819
<section name="AdminProductFormRelatedUpSellCrossSellSection"/>
1920
<section name="AdminProductFormAdvancedPricingSection"/>
2021
<section name="AdminProductFormAdvancedInventorySection"/>
22+
<section name="AdminAddAttributeModalSection"/>
2123
</page>
2224
</pages>

app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@
2323
<element name="checkIfTabOpen" selector="//div[@id='advanced_fieldset-wrapper' and not(contains(@class,'opened'))]" type="button"/>
2424
<element name="useInLayeredNavigation" type="select" selector="#is_filterable"/>
2525
<element name="addSwatch" type="button" selector="#add_new_swatch_text_option_button"/>
26+
<element name="dropdownAddOptions" type="button" selector="#add_new_option_button"/>
27+
<!-- Manage Options nth child-->
28+
<element name="dropdownNthOptionIsDefault" type="checkbox" selector="tbody[data-role='options-container'] tr:nth-child({{var}}) .input-radio" parameterized="true"/>
29+
<element name="dropdownNthOptionAdmin" type="textarea" selector="tbody[data-role='options-container'] tr:nth-child({{var}}) td:nth-child(3) input" parameterized="true"/>
30+
<element name="dropdownNthOptionDefaultStoreView" type="textarea" selector="tbody[data-role='options-container'] tr:nth-child({{var}}) td:nth-child(4) input" parameterized="true"/>
31+
<element name="dropdownNthOptionDelete" type="button" selector="tbody[data-role='options-container'] tr:nth-child({{var}}) button[title='Delete']" parameterized="true"/>
32+
</section>
33+
<section name="AttributeDeleteModalSection">
34+
<element name="confirm" type="button" selector=".modal-popup.confirm .action-accept"/>
35+
<element name="cancel" type="button" selector=".modal-popup.confirm .action-dismiss"/>
2636
</section>
2737
<section name="AttributeManageSwatchSection">
2838
<element name="swatchField" type="input" selector="//th[contains(@class, 'col-swatch')]/span[contains(text(), '{{arg}}')]/ancestor::thead/following-sibling::tbody//input[@placeholder='Swatch']" parameterized="true"/>
@@ -77,6 +87,10 @@
7787
<element name="AdvancedAttributePropertiesSectionToggle"
7888
type="button" selector="#advanced_fieldset-wrapper"/>
7989
<element name="AttributeCode" type="text" selector="#attribute_code"/>
90+
<element name="DefaultValueText" type="textarea" selector="#default_value_text"/>
91+
<element name="DefaultValueTextArea" type="textarea" selector="#default_value_textarea"/>
92+
<element name="DefaultValueDate" type="textarea" selector="#default_value_date"/>
93+
<element name="DefaultValueYesNo" type="textarea" selector="#default_value_yesno"/>
8094
<element name="Scope" type="select" selector="#is_global"/>
8195
<element name="UniqueValue" type="select" selector="#is_unique"/>
8296
<element name="AddToColumnOptions" type="select" selector="#is_used_in_grid"/>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminProductAddAttributeModalSection">
12+
<element name="addSelected" type="button" selector=".product_form_product_form_add_attribute_modal .page-main-actions .action-primary" timeout="30"/>
13+
<element name="filters" type="button" selector=".product_form_product_form_add_attribute_modal button[data-action='grid-filter-expand']" timeout="30"/>
14+
<element name="attributeCodeFilter" type="textarea" selector=".product_form_product_form_add_attribute_modal input[name='attribute_code']"/>
15+
<element name="clearFilters" type="button" selector=".product_form_product_form_add_attribute_modal .action-clear" timeout="30"/>
16+
<element name="firstRowCheckBox" type="input" selector=".product_form_product_form_add_attribute_modal .data-grid-checkbox-cell input"/>
17+
<element name="applyFilters" type="button" selector=".product_form_product_form_add_attribute_modal .admin__data-grid-filters-footer .action-secondary" timeout="30"/>
18+
</section>
19+
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminProductAttributeGridSection">
1212
<element name="AttributeCode" type="text" selector="//td[contains(text(),'{{var1}}')]" parameterized="true" timeout="30"/>
13-
<element name="createNewAttributeBtn" type="button" selector="button[data-index='add_new_attribute_button']"/>
13+
<element name="NewAttribute" type="button" selector="#add"/>
1414
<element name="GridFilterFrontEndLabel" type="input" selector="#attributeGrid_filter_frontend_label"/>
1515
<element name="Search" type="button" selector="button[data-action=grid-filter-apply]" timeout="30"/>
1616
<element name="ResetFilter" type="button" selector="button[data-action='grid-filter-reset']" timeout="30"/>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminProductAttributesSection">
12+
<element name="sectionHeader" type="button" selector="div[data-index='attributes']" timeout="30"/>
13+
<element name="attributeLabelByCode" type="text" selector="div[data-index='{{var}}'] .admin__field-label span" parameterized="true"/>
14+
<element name="attributeTextInputByCode" type="text" selector="div[data-index='{{var}}'] .admin__field-control input" parameterized="true"/>
15+
<element name="attributeDropdownByCode" type="text" selector="div[data-index='{{var}}'] .admin__field-control select" parameterized="true"/>
16+
</section>
17+
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormActionSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminProductFormActionSection">
1212
<element name="backButton" type="button" selector="#back" timeout="30"/>
13+
<element name="addAttributeButton" type="button" selector="#addAttribute" timeout="30"/>
1314
<element name="saveButton" type="button" selector="#save-button" timeout="30"/>
1415
<element name="saveArrow" type="button" selector="button[data-ui-id='save-button-dropdown']" timeout="30"/>
1516
<element name="saveAndClose" type="button" selector="span[title='Save &amp; Close']" timeout="30"/>

0 commit comments

Comments
 (0)