Skip to content

Commit c2c9def

Browse files
authored
Merge branch '2.4-develop' into AC-2784-resize-images-by-imagemin
2 parents 21b9e9b + c398634 commit c2c9def

File tree

2 files changed

+138
-0
lines changed

2 files changed

+138
-0
lines changed

app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,6 @@
112112
<element name="categoriesLabel" type="text" selector="//div[@class='action-menu _active']//button[@data-action='close-advanced-select']"/>
113113
<element name="userDefinedQuantity" type="checkbox" selector="[name='bundle_options[bundle_options][{{option}}][bundle_selections][{{product}}][selection_can_change_qty]'][type='checkbox']" parameterized="true"/>
114114
<element name="bundleItemsOptionTableRows" type="button" selector=".admin__dynamic-rows[data-index='bundle_selections'] tr.data-row" timeout="30"/>
115+
<element name="isDefault" type="button" selector="//table[@class='admin__dynamic-rows admin__control-table']//span[contains(text(),'{{var1}}')]/../../../../..//input[@type='radio']" parameterized="true"/>
115116
</section>
116117
</sections>
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminCreateBundleProductTest">
11+
<annotations>
12+
<features value="BundleProduct"/>
13+
<stories value="Create product"/>
14+
<title value="Admin Create Bundle Product"/>
15+
<description value="Admin should be able to create a Bundle product"/>
16+
<testCaseId value="MC-27223"/>
17+
<severity value="MAJOR"/>
18+
<group value="mtf_migrated"/>
19+
</annotations>
20+
<before>
21+
<!-- creating category, simple products -->
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
<createData entity="_defaultCategory" stepKey="createCategory"/>
24+
<createData entity="ImportProductSimple2_Bundle" stepKey="simpleProduct1"/>
25+
<createData entity="ImportProductSimple1_Bundle" stepKey="simpleProduct2"/>
26+
</before>
27+
<after>
28+
<!-- Delete bundle product -->
29+
<actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct">
30+
<argument name="product" value="BundleProduct"/>
31+
</actionGroup>
32+
<!-- deleting category, simple products -->
33+
<deleteData createDataKey="simpleProduct1" stepKey="deleteProductOne"/>
34+
<deleteData createDataKey="simpleProduct2" stepKey="deleteProductTwo"/>
35+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
36+
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
37+
</after>
38+
39+
<!-- Create Bundle product via Admin -->
40+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
41+
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/>
42+
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
43+
<argument name="product" value="BundleProduct"/>
44+
</actionGroup>
45+
46+
<!-- Entering Bundle Product name,SKU, category, url key -->
47+
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/>
48+
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/>
49+
50+
<!-- Add two bundle items -->
51+
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/>
52+
<!-- Add bundle option to the product -->
53+
<actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="clickAddSelectedBundleProducts">
54+
<argument name="x" value="0"/>
55+
<argument name="n" value="1"/>
56+
<argument name="prodOneSku" value="$$simpleProduct1.sku$$"/>
57+
<argument name="prodTwoSku" value="$$simpleProduct2.sku$$"/>
58+
<argument name="optionTitle" value="{{DropDownBundleOption.title}}"/>
59+
<argument name="inputType" value="{{DropDownBundleOption.type}}"/>
60+
</actionGroup>
61+
62+
<!-- Check that Bundle Options initialized with proper quantity -->
63+
<grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" stepKey="grabbedFirstBundleOptionQuantity"/>
64+
<assertEquals stepKey="assertFirstBundleOptionDefaultQuantity">
65+
<expectedResult type="string">50</expectedResult>
66+
<actualResult type="string">$grabbedFirstBundleOptionQuantity</actualResult>
67+
</assertEquals>
68+
<grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" stepKey="grabbedSecondBundleOptionQuantity"/>
69+
<assertEquals stepKey="assertSecondBundleOptionDefaultQuantity">
70+
<expectedResult type="string">50</expectedResult>
71+
<actualResult type="string">$grabbedSecondBundleOptionQuantity</actualResult>
72+
</assertEquals>
73+
74+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductDefaultQty1"/>
75+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductDefaultQty2"/>
76+
77+
<wait stepKey="k1" time="10"/>
78+
<click selector="{{AdminProductFormBundleSection.isDefault('$$simpleProduct1.name$$')}}" stepKey="clickIsDefault"/>
79+
80+
<!--Save the product-->
81+
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton"/>
82+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="messageYouSavedTheProductIsShown">
83+
<argument name="message" value="You saved the product."/>
84+
</actionGroup>
85+
86+
<!-- Verify we see created bundle product(from the above step) on the product grid page-->
87+
<actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage1"/>
88+
<actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="clickSearch">
89+
<argument name="product" value="BundleProduct"/>
90+
</actionGroup>
91+
<actionGroup ref="AdminProductGridSectionClickFirstRowActionGroup" stepKey="openCreatedBundleProduct"/>
92+
93+
<!-- Admin: Verify Bundle Product Information on Edit Product Page -->
94+
<scrollTo selector="{{AdminProductFormBundleSection.allBundleOptions}}" stepKey="scrollToAllBundleOptions" />
95+
<actionGroup ref="AdminVerifyProductInBundleProductOptionActionGroup" stepKey="verifyBundleProductOption1Product1">
96+
<argument name="name" value="{{ImportProductSimple2_Bundle.name}}"/>
97+
<argument name="sku" value="{{ImportProductSimple2_Bundle.sku}}"/>
98+
<argument name="defaultQuantity" value="50"/>
99+
<argument name="isDefault" value="{{ImportProductSimple2_Bundle.bundleIsDefault}}"/>
100+
<argument name="userDefined" value="{{ImportProductSimple2_Bundle.bundleUserDefined}}"/>
101+
<argument name="optionIndex" value="1"/>
102+
<argument name="productIndex" value="1"/>
103+
</actionGroup>
104+
<actionGroup ref="AdminVerifyProductInBundleProductOptionActionGroup" stepKey="verifyBundleProductOption1Product2">
105+
<argument name="name" value="{{ImportProductSimple1_Bundle.name}}"/>
106+
<argument name="sku" value="{{ImportProductSimple1_Bundle.sku}}"/>
107+
<argument name="defaultQuantity" value="50"/>
108+
<argument name="isDefault" value="{{ImportProductSimple1_Bundle.bundleIsDefault}}"/>
109+
<argument name="userDefined" value="false"/>
110+
<argument name="optionIndex" value="1"/>
111+
<argument name="productIndex" value="2"/>
112+
</actionGroup>
113+
114+
<!-- Storefront: Verify Bundle Product In Category -->
115+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="GoToProductPage">
116+
<argument name="productUrl" value="{{BundleProduct.urlKey}}"/>
117+
</actionGroup>
118+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductPageToLoad"/>
119+
120+
<!-- Storefront: Verify Product details -->
121+
<actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="LookingForNameOfProduct">
122+
<argument name="productName" value="{{BundleProduct.name}}"/>
123+
</actionGroup>
124+
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="seeProductName"/>
125+
<see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="seeSku"/>
126+
<see userInput="From $500.00 To $1,000.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seePrice"/>
127+
128+
<!-- Storefront: Verify Product option details -->
129+
<click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomizeAndAddToCart"/>
130+
<click selector="{{StorefrontBundleProductActionSection.dropdownSelectOption}}" stepKey="clickOnSelectOption"/>
131+
<wait stepKey="k2" time="10"/>
132+
<seeElement selector="{{StorefrontBundleProductActionSection.dropdownProductSelection('$$simpleProduct1.name$$ +$$$simpleProduct1.price$$')}}" stepKey="seeOption1Product1Details"/>
133+
<seeElement selector="{{StorefrontBundleProductActionSection.dropdownProductSelection('$$simpleProduct2.name$$ +$$$simpleProduct2.price$$')}}" stepKey="seeOption1Product2Details"/>
134+
135+
136+
</test>
137+
</tests>

0 commit comments

Comments
 (0)