Skip to content

Commit 1bc60e4

Browse files
committed
MC-290: Admin should be able to update existing attributes of child products of a configurable product
1 parent cc91c03 commit 1bc60e4

File tree

3 files changed

+107
-1
lines changed

3 files changed

+107
-1
lines changed

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Bundle/Section/AdminProductFormBundleSection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<section name="AdminProductFormBundleSection">
1212
<element name="bundleItemsToggle" type="button" selector="//span[text()='Bundle Items']"/>
1313
<element name="shipmentType" type="select" selector=".admin__control-select[name='product[shipment_type]']"/>
14-
<element name="addOption" type="button" selector="button[data-index='add_button']"/>
14+
<element name="addOption" type="button" selector="button[data-index='add_button'] span"/>
1515
<element name="firstOptionTitle" type="input" selector="[name='bundle_options[bundle_options][0][title]']"/>
1616
<element name="firstInputType" type="select" selector="[name='bundle_options[bundle_options][0][type]']"/>
1717
<element name="firstRequired" type="checkbox" selector="[name='bundle_options[bundle_options][0][required]']"/>
@@ -21,5 +21,6 @@
2121
<element name="bundleOptionXRequired" type="checkbox" selector="[name='bundle_options[bundle_options][{{x}}][required]']" parameterized="true"/>
2222
<element name="bundleOptionXProductYQuantity" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_qty]']" parameterized="true"/>
2323
<element name="addProductsToOption" type="button" selector="[data-index='modal_set']" timeout="30"/>
24+
<element name="bundledItems" type="block" selector="[data-index=bundle-items]"/>
2425
</section>
2526
</sections>
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="StorefrontBundledSection">
12+
<element name="nthBundledOption" type="input" selector=".option:nth-of-type({{numOption}}) .choice:nth-of-type({{numOptionSelect}}) input" parameterized="true"/>
13+
<element name="addToCart" type="button" selector="#bundle-slide"/>
14+
<element name="addToCartConfigured" type="button" selector="#product-addtocart-button"/>
15+
<element name="configuredPrice" type="block" selector=".price-configured_price .price"/>
16+
</section>
17+
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="StorefrontEditBundleProductTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Bundle products list on Storefront"/>
15+
<title value="Customer should be able to change chosen options for Bundle Product when clicking Edit button in Shopping Cart page"/>
16+
<description value="Customer should be able to change chosen options for Bundle Product when clicking Edit button in Shopping Cart page"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-290"/>
19+
<group value="Levi"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
24+
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
25+
</before>
26+
<after>
27+
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
28+
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
29+
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
30+
</after>
31+
32+
<!-- Create a bundle product -->
33+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
34+
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
35+
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct">
36+
<argument name="product" value="BundleProduct"/>
37+
</actionGroup>
38+
39+
<actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillBundleProductNameAndSku">
40+
<argument name="product" value="BundleProduct"/>
41+
</actionGroup>
42+
43+
<!-- Add two bundle items -->
44+
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/>
45+
<scrollTo stepKey="scrollToBundleItems" selector="{{AdminProductFormBundleSection.bundledItems}}"/>
46+
<click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/>
47+
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
48+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
49+
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
50+
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/>
51+
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/>
52+
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/>
53+
<actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions">
54+
<argument name="product" value="$$simpleProduct1$$"/>
55+
</actionGroup>
56+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/>
57+
<actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2">
58+
<argument name="product" value="$$simpleProduct2$$"/>
59+
</actionGroup>
60+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/>
61+
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/>
62+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/>
63+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/>
64+
65+
<click stepKey="saveProductAttribute" selector="{{AdminProductFormActionSection.saveButton}}"/>
66+
<see stepKey="assertSuccess" selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."/>
67+
68+
<!-- Go to the storefront bundled product page -->
69+
<amOnPage url="/{{BundleProduct.urlKey}}.html" stepKey="visitStoreFrontBundle"/>
70+
<waitForPageLoad stepKey="waitForStorefront"/>
71+
<click stepKey="customizeAndAddToCart" selector="{{StorefrontBundledSection.addToCart}}"/>
72+
<waitForPageLoad stepKey="waitCustomizableOptionsPopUp"/>
73+
74+
<click stepKey="selectFirstBundleOption" selector="{{StorefrontBundledSection.nthBundledOption('1','1')}}"/>
75+
76+
<see stepKey="seeSinglePrice" selector="{{StorefrontBundledSection.configuredPrice}}" userInput="1,230.00"/>
77+
<click stepKey="addFirstItemToCart" selector="{{StorefrontBundledSection.addToCartConfigured}}"/>
78+
<waitForPageLoad stepKey="waitForElementAdded"/>
79+
80+
<click stepKey="unselectFirstBundleOption" selector="{{StorefrontBundledSection.nthBundledOption('1','1')}}"/>
81+
<click stepKey="selectSecondBundleOption" selector="{{StorefrontBundledSection.nthBundledOption('1','2')}}"/>
82+
83+
<see stepKey="seeSinglePrice2" selector="{{StorefrontBundledSection.configuredPrice}}" userInput="1,230.00"/>
84+
<click stepKey="addSecondItemToCart" selector="{{StorefrontBundledSection.addToCartConfigured}}"/>
85+
<waitForPageLoad stepKey="waitForElementAdded2"/>
86+
87+
</test>
88+
</tests>

0 commit comments

Comments
 (0)