Skip to content

Commit fadbf69

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.4-develop
Accepted Community Pull Requests: - #31287: [MFTF] Adding AdminSelectAttributeSetOnEditProductPageActionGroup (by @AnnaAPak) - #31099: [MFTF] Refactoring of AddOutOfStockProductToCompareListTest (by @AnnaAPak) - #30410: Fatal error page occurs if use wrong shipment id ,invoice id ,creditmemo id passed in url (by @GovindaSharma) Fixed GitHub Issues: - #31290: [Issue] [MFTF] Adding AdminSelectAttributeSetOnEditProductPageActionGroup (reported by @m2-assistant[bot]) has been fixed in #31287 by @AnnaAPak in 2.4-develop branch Related commits: 1. cbc884d 2. 55b0fc2 3. 88b58a0 4. 9d505f4 5. b7fe543 6. afc6a95 7. d063cd6 8. 941349a - #31131: [Issue] [MFTF] Refactoring of AddOutOfStockProductToCompareListTest (reported by @m2-assistant[bot]) has been fixed in #31099 by @AnnaAPak in 2.4-develop branch Related commits: 1. 6bb8158 2. 3cf82b7 3. 1089f15 4. 7320189 5. 8ba2695 6. d001c99 7. 125b01a - #30424: [Issue] Fatal error page occurs if use wrong shipment id ,invoice id ,creditmemo id passed in url (reported by @m2-assistant[bot]) has been fixed in #30410 by @GovindaSharma in 2.4-develop branch Related commits: 1. ff1a003 2. 0e78fe4 3. ff5de32 4. 1dab430 5. 6b1837b 6. 589b1d2 7. 4ba689a 8. 9e99f43 9. 6359ac5 10. ade5168 11. 1f0bcbf 12. 937f9e5 13. 2221a8b 14. 32ae2ff 15. 3fb5db4 16. e38122a 17. 3b0e854 18. 7006a96 19. beac203 20. 564a8a6 21. ffc0ab7 22. 247817a 23. 5ec7bd4 24. 52b5270
2 parents 661c15c + c2a38cd commit fadbf69

24 files changed

+468
-145
lines changed

app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@
4242
<!-- Switch from default attribute set to new attribute set -->
4343
<amOnPage url="{{AdminProductCreatePage.url('4', 'bundle')}}" stepKey="goToNewProductPage"/>
4444
<waitForPageLoad stepKey="wait2"/>
45-
<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/>
46-
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="searchForAttrSet"/>
47-
<click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/>
45+
46+
<actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet">
47+
<argument name="attributeSet" value="{{ProductAttributeFrontendLabel.label}}"/>
48+
</actionGroup>
49+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/>
50+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/>
51+
4852
<fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/>
4953
<fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/>
5054

@@ -64,9 +68,11 @@
6468
<click selector="{{AdminProductFiltersSection.attributeSetOfFirstRow(ProductAttributeFrontendLabel.label)}}" stepKey="clickAttributeSet2"/>
6569
<waitForPageLoad stepKey="waitForPageLoad2"/>
6670

67-
<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet2"/>
68-
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{BundleProduct.defaultAttribute}}" stepKey="searchForAttrSet2"/>
69-
<click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet2"/>
71+
<actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet2">
72+
<argument name="attributeSet" value="{{BundleProduct.defaultAttribute}}"/>
73+
</actionGroup>
74+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet2"/>
75+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet2"/>
7076

7177
<!--save the product/published by default-->
7278
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton2"/>

app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,11 @@
109109
<checkOption selector="{{AdminProductFormBundleSection.enableDisableToggle}}" stepKey="clickOnEnableDisableToggleAgain"/>
110110

111111
<!--Apply Attribute Set-->
112-
<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/>
113-
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{ProductAttributeFrontendLabelTwo.label}}" stepKey="searchForAttrSet"/>
114-
<click selector="{{AdminProductFormSection.attributeSetFilterResultByName(ProductAttributeFrontendLabelTwo.label)}}" stepKey="selectAttrSet"/>
112+
<actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet">
113+
<argument name="attributeSet" value="{{ProductAttributeFrontendLabelTwo.label}}"/>
114+
</actionGroup>
115+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/>
116+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/>
115117

116118
<!--Product name and SKU-->
117119
<fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name2}}" stepKey="fillProductName"/>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="AdminSelectAttributeSetOnEditProductPageActionGroup">
12+
<annotations>
13+
<description>Selects the specified value from the Attribute Set dropdown on the opened product edit page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="attributeSet" type="string"/>
17+
</arguments>
18+
19+
<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="clickAttributeSetDropdown"/>
20+
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{attributeSet}}" stepKey="searchForAttributeSet"/>
21+
<click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttributeSet"/>
22+
</actionGroup>
23+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontHoverProductOnCategoryPageActionGroup">
12+
<annotations>
13+
<description>Hover product on the Category page</description>
14+
</annotations>
15+
16+
<moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverOverProduct"/>
17+
18+
</actionGroup>
19+
</actionGroups>

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

Lines changed: 82 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<group value="Catalog"/>
2121
</annotations>
2222
<before>
23-
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
<comment userInput="Adding the comment for preserving Backward Compatibility" stepKey="loginAsAdmin"/>
2424
<magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockDisable.path}} {{CatalogInventoryOptionsShowOutOfStockDisable.value}}" stepKey="setConfigShowOutOfStockFalse"/>
2525
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
2626
<argument name="tags" value=""/>
@@ -30,81 +30,100 @@
3030
<requiredEntity createDataKey="category"/>
3131
</createData>
3232
</before>
33+
3334
<after>
3435
<magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockDisable.path}} {{CatalogInventoryOptionsShowOutOfStockDisable.value}}" stepKey="setConfigShowOutOfStockFalse"/>
3536
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
3637
<argument name="tags" value=""/>
3738
</actionGroup>
3839
<deleteData createDataKey="product" stepKey="deleteProduct"/>
3940
<deleteData createDataKey="category" stepKey="deleteCategory"/>
40-
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
41+
<comment userInput="Adding the comment for preserving Backward Compatibility" stepKey="logout"/>
4142
</after>
42-
<!--Open product page-->
43-
<comment userInput="Open product page" stepKey="openProdPage"/>
44-
<amOnPage url="{{StorefrontProductPage.url($$product.custom_attributes[url_key]$$)}}" stepKey="goToSimpleProductPage"/>
45-
<waitForPageLoad stepKey="waitForSimpleProductPage"/>
46-
<!--'Add to compare' link is not available-->
47-
<comment userInput="'Add to compare' link is not available" stepKey="addToCompareLinkAvailability"/>
43+
<comment userInput="Open product page | Comment is kept to preserve the step key for backward compatibility" stepKey="openProdPage"/>
44+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToSimpleProductPage"/>
45+
46+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="waitForSimpleProductPage">
47+
<argument name="productUrl" value="$$product.custom_attributes[url_key]$$"/>
48+
</actionGroup>
49+
50+
<comment userInput="'Add to compare' link is not available | Comment is kept to preserve the step key for backward compatibility" stepKey="addToCompareLinkAvailability"/>
51+
4852
<dontSeeElement selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="dontSeeAddToCompareLink"/>
49-
<!--Turn on 'out on stock' config-->
50-
<comment userInput="Turn on 'out of stock' config" stepKey="onOutOfStockConfig"/>
53+
54+
<comment userInput="Turn on 'out of stock' config | Comment is kept to preserve the step key for backward compatibility" stepKey="onOutOfStockConfig"/>
5155
<magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockEnable.path}} {{CatalogInventoryOptionsShowOutOfStockEnable.value}}" stepKey="setConfigShowOutOfStockTrue"/>
52-
<!--Clear cache and reindex-->
53-
<comment userInput="Clear cache and reindex" stepKey="cleanCache"/>
56+
57+
<comment userInput="Clear cache and reindex | Comment is kept to preserve the step key for backward compatibility" stepKey="cleanCache"/>
5458
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
55-
<argument name="indices" value=""/>
56-
</actionGroup>
59+
<argument name="indices" value=""/>
60+
</actionGroup>
5761
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
58-
<argument name="tags" value=""/>
59-
</actionGroup>
60-
<!--Open product page-->
61-
<comment userInput="Open product page" stepKey="openProductPage"/>
62-
<amOnPage url="{{StorefrontProductPage.url($$product.custom_attributes[url_key]$$)}}" stepKey="goToSimpleProductPage2"/>
63-
<waitForPageLoad stepKey="waitForSimpleProductPage2"/>
64-
<!--Click on 'Add to Compare' link-->
65-
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="seeAddToCompareLink"/>
66-
<comment userInput="Click on 'Add to Compare' link" stepKey="clickOnAddToCompareLink"/>
67-
<click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickOnAddToCompare"/>
68-
<waitForPageLoad stepKey="waitForProdAddToCmpList"/>
69-
<!--Assert success message-->
70-
<comment userInput="Assert success message" stepKey="assertSuccessMsg"/>
71-
<grabTextFrom selector="{{StorefrontMessagesSection.success}}" stepKey="grabTextFromSuccessMessage"/>
72-
<assertEquals stepKey="assertSuccessMessage">
73-
<actualResult type="const">($grabTextFromSuccessMessage)</actualResult>
74-
<expectedResult type="string">You added product $$product.name$$ to the comparison list.</expectedResult>
75-
</assertEquals>
76-
<!--See product in the comparison list-->
77-
<comment userInput="See product in the comparison list" stepKey="seeProductInComparisonList"/>
78-
<amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage"/>
79-
<waitForPageLoad stepKey="waitForStorefrontProductComparePageLoad"/>
80-
<seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName($product.name$)}}" stepKey="seeProductInCompareList"/>
81-
<!--Go to Category page and delete product from comparison list-->
82-
<comment userInput="Go to Category page and delete product from comparison list" stepKey="deleteProdFromCmpList"/>
83-
<amOnPage url="{{StorefrontCategoryPage.url($$category.name$$)}}" stepKey="onCategoryPage"/>
84-
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
85-
<click selector="{{StorefrontComparisonSidebarSection.ClearAll}}" stepKey="clickClearAll"/>
86-
<waitForPageLoad time="30" stepKey="waitForConfirmPageLoad"/>
87-
<click selector="{{AdminDeleteRoleSection.confirm}}" stepKey="confirmProdDelate"/>
88-
<waitForPageLoad time="30" stepKey="waitForConfirmLoad"/>
89-
<!--Add product to compare list from Category page-->
90-
<comment userInput="Add product to compare list fom Category page" stepKey="addToCmpFromCategPage"/>
91-
<moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverOverProduct"/>
92-
<click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickAddToCompare"/>
93-
<waitForPageLoad stepKey="waitProdAddingToCmpList"/>
94-
<!--Assert success message-->
95-
<comment userInput="Assert success message" stepKey="assertSuccessMsg2"/>
96-
<grabTextFrom selector="{{StorefrontMessagesSection.success}}" stepKey="grabTextFromSuccessMessage2"/>
97-
<assertEquals stepKey="assertSuccessMessage2">
98-
<actualResult type="const">($grabTextFromSuccessMessage)</actualResult>
99-
<expectedResult type="string">You added product $$product.name$$ to the comparison list.</expectedResult>
100-
</assertEquals>
101-
<!--Check that product displays on add to compare widget-->
102-
<comment userInput="Check that product displays on add to compare widget" stepKey="checkProdNameOnWidget"/>
62+
<argument name="tags" value=""/>
63+
</actionGroup>
64+
65+
<comment userInput="Open product page | Comment is kept to preserve the step key for backward compatibility" stepKey="openProductPage"/>
66+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToSimpleProductPage2"/>
67+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSimpleProductPage2"/>
68+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="seeAddToCompareLink">
69+
<argument name="productUrl" value="$$product.custom_attributes[url_key]$$"/>
70+
</actionGroup>
71+
72+
<comment userInput="Click on 'Add to Compare' link | Comment is kept to preserve the step key for backward compatibility" stepKey="clickOnAddToCompareLink"/>
73+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickOnAddToCompare"/>
74+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForProdAddToCmpList"/>
75+
<comment userInput="Assert success message | Comment is kept to preserve the step key for backward compatibility" stepKey="assertSuccessMsg"/>
76+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="grabTextFromSuccessMessage"/>
77+
78+
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="assertSuccessMessage">
79+
<argument name="productVar" value="$$product$$"/>
80+
</actionGroup>
81+
82+
<comment userInput="See product in the comparison list | Comment is kept to preserve the step key for backward compatibility" stepKey="seeProductInComparisonList"/>
83+
84+
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage">
85+
<argument name="categoryName" value="$$category.name$$"/>
86+
</actionGroup>
87+
88+
<actionGroup ref="StorefrontOpenAndCheckComparisionActionGroup" stepKey="navigateToComparePage"/>
89+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontProductComparePageLoad"/>
90+
91+
<actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInCompareList">
92+
<argument name="productVar" value="$$product$$"/>
93+
</actionGroup>
94+
95+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="deleteProdFromCmpList"/>
96+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="onCategoryPage"/>
97+
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="waitForPageLoad1">
98+
<argument name="categoryName" value="$$category.name$$"/>
99+
</actionGroup>
100+
101+
<actionGroup ref="StorefrontClearCompareActionGroup" stepKey="clickClearAll"/>
102+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForConfirmPageLoad"/>
103+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="confirmProdDelate"/>
104+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForConfirmLoad"/>
105+
<comment userInput="Add product to compare list fom Category page | Comment is kept to preserve the step key for backward compatibility" stepKey="addToCmpFromCategPage"/>
106+
107+
<actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverOverProduct"/>
108+
109+
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="clickAddToCompare">
110+
<argument name="productVar" value="$$product$$"/>
111+
</actionGroup>
112+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitProdAddingToCmpList"/>
113+
<comment userInput="Assert success message | Comment is kept to preserve the step key for backward compatibility" stepKey="assertSuccessMsg2"/>
114+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="grabTextFromSuccessMessage2"/>
115+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertSuccessMessage2"/>
116+
117+
<comment userInput="Check that product displays on add to compare widget | Comment is kept to preserve the step key for backward compatibility" stepKey="checkProdNameOnWidget"/>
103118
<seeElement selector="{{StorefrontComparisonSidebarSection.ProductTitleByName($$product.name$$)}}" stepKey="seeProdNameOnCmpWidget"/>
104-
<!--See product in the compare page-->
119+
105120
<comment userInput="See product in the compare page" stepKey="seeProductInComparePage"/>
106-
<amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage2"/>
107-
<waitForPageLoad stepKey="waitForStorefrontProductComparePageLoad2"/>
108-
<seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName($product.name$)}}" stepKey="seeProductInCompareList2"/>
121+
<actionGroup ref="StorefrontOpenAndCheckComparisionActionGroup" stepKey="navigateToComparePage2"/>
122+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontProductComparePageLoad2"/>
123+
124+
<actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInCompareList2">
125+
<argument name="productVar" value="$$product$$"/>
126+
</actionGroup>
127+
109128
</test>
110129
</tests>

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@
6060
<argument name="product" value="$$createSimpleProduct$$"/>
6161
</actionGroup>
6262

63-
<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/>
64-
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="$$createAttributeSet.attribute_set_name$$" stepKey="searchForAttrSet"/>
65-
<click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/>
63+
<actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet">
64+
<argument name="attributeSet" value="$$createAttributeSet.attribute_set_name$$"/>
65+
</actionGroup>
66+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/>
67+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/>
6668

6769
<waitForText userInput="$$createProductAttribute.default_frontend_label$$" stepKey="seeAttributeInForm"/>
6870
</test>

0 commit comments

Comments
 (0)