Skip to content

Commit a3aa42c

Browse files
committed
Refactored AdminMassUpdateProductAttributesMissingRequiredFieldTest
1 parent 8c95f07 commit a3aa42c

4 files changed

+77
-10
lines changed
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminCheckNameToggleOnProductsMassAttributesUpdateActionGroup">
12+
<annotations>
13+
<description>Click the "Change" checkbox for the "Name" field on the Products Masss Attributes Update page.</description>
14+
</annotations>
15+
16+
<click selector="{{AdminEditProductAttributesSection.ChangeAttributeNameToggle}}" stepKey="toggleToChangeName"/>
17+
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminCheckProductOnProductGridActionGroup">
12+
<annotations>
13+
<description>Check the checkbox for the product on the Product Grid</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product" type="entity"/>
17+
</arguments>
18+
19+
<checkOption selector="{{AdminProductGridSection.productRowCheckboxBySku(product.sku)}}" stepKey="selectProduct"/>
20+
21+
</actionGroup>
22+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminClickSaveOnProductsMassAttributesUpdateActionGroup">
12+
<annotations>
13+
<description>Clicks on 'Save' button on products mass attributes update page.</description>
14+
</annotations>
15+
16+
<click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/>
17+
18+
</actionGroup>
19+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesMissingRequiredFieldTest.xml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,27 @@
3636
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
3737
</after>
3838

39-
<!-- Search and select products -->
4039
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
4140
<actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword">
4241
<argument name="keyword" value="api-simple-product"/>
4342
</actionGroup>
44-
<click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/>
45-
<click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckbox2"/>
46-
<!-- Mass update attributes -->
47-
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdown"/>
48-
<click selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="clickOption"/>
49-
<waitForPageLoad stepKey="waitForBulkUpdatePage"/>
50-
<seeInCurrentUrl stepKey="seeInUrl" url="catalog/product_action_attribute/edit/"/>
51-
<click selector="{{AdminEditProductAttributesSection.ChangeAttributeNameToggle}}" stepKey="toggleToChangeName"/>
52-
<click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/>
43+
44+
<actionGroup ref="AdminCheckProductOnProductGridActionGroup" stepKey="clickCheckbox1">
45+
<argument name="product" value="$$createProductOne$$"/>
46+
</actionGroup>
47+
48+
<actionGroup ref="AdminCheckProductOnProductGridActionGroup" stepKey="clickCheckbox2">
49+
<argument name="product" value="$$createProductTwo$$"/>
50+
</actionGroup>
51+
52+
<actionGroup ref="AdminClickMassUpdateProductAttributesActionGroup" stepKey="clickDropdown"/>
53+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickOption"/>
54+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBulkUpdatePage"/>
55+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeInUrl"/>
56+
57+
<actionGroup ref="AdminCheckNameToggleOnProductsMassAttributesUpdateActionGroup" stepKey="toggleToChangeName"/>
58+
59+
<actionGroup ref="AdminClickSaveOnProductsMassAttributesUpdateActionGroup" stepKey="save"/>
5360
<see stepKey="seeError" selector="{{AdminEditProductAttributesSection.NameError}}" userInput="This is a required field"/>
5461
</test>
5562
</tests>

0 commit comments

Comments
 (0)