Skip to content

Commit 68a153c

Browse files
committed
Merge branch 'MC-290' into RE-develop
2 parents 45d37d9 + 2357fb5 commit 68a153c

File tree

5 files changed

+259
-0
lines changed

5 files changed

+259
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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,18 @@
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" timeout="30"/>
14+
<element name="addToCartConfigured" type="button" selector="#product-addtocart-button" timeout="30"/>
15+
<element name="updateCart" type="button" selector="#product-updatecart-button" timeout="30"/>
16+
<element name="configuredPrice" type="block" selector=".price-configured_price .price"/>
17+
</section>
18+
</sections>
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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="StorefrontAdminEditDataTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Bundle products list on Storefront"/>
15+
<title value="Customer should be able to see chosen options for Bundle Product in Shopping Cart when Option Title is edited in Admin"/>
16+
<description value="Customer should be able to see chosen options for Bundle Product in Shopping Cart when Option Title is edited in Admin"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-291"/>
19+
<group value="Bundle"/>
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="saveProductBundle" 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+
<!-- add one product to the shopping cart -->
75+
<click stepKey="selectFirstBundleOption" selector="{{StorefrontBundledSection.nthBundledOption('1','1')}}"/>
76+
<waitForPageLoad stepKey="waitForPriceUpdate"/>
77+
<see stepKey="seeSinglePrice" selector="{{StorefrontBundledSection.configuredPrice}}" userInput="1,230.00"/>
78+
<click stepKey="addFirstItemToCart" selector="{{StorefrontBundledSection.addToCartConfigured}}"/>
79+
<waitForPageLoad stepKey="waitForElementAdded"/>
80+
81+
<!-- Go to the shopping cart page and grab the value of the option title -->
82+
<amOnPage url="/checkout/cart/" stepKey="onPageShoppingCart"/>
83+
<waitForPageLoad stepKey="waitForCartPageLoad"/>
84+
<grabTextFrom selector="{{CheckoutCartProductSection.nthBundleOptionName('1')}}" stepKey="grabTotalBefore"/>
85+
86+
<!-- Find the product that we just created using the product grid -->
87+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
88+
<waitForPageLoad stepKey="waitForAdminProductPageLoad"/>
89+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
90+
<actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct">
91+
<argument name="product" value="BundleProduct"/>
92+
</actionGroup>
93+
<waitForPageLoad stepKey="waitForProductFilterLoad"/>
94+
<click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductPage"/>
95+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
96+
97+
<!-- Change the product option title -->
98+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="BundleOption2" stepKey="fillOptionTitle2"/>
99+
<click stepKey="saveProductAttribute2" selector="{{AdminProductFormActionSection.saveButton}}"/>
100+
<see stepKey="assertSuccess2" selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."/>
101+
102+
<!-- Go to the shopping cart page and make sure the title has changed -->
103+
<amOnPage url="/checkout/cart/" stepKey="onPageShoppingCart1"/>
104+
<waitForPageLoad stepKey="waitForCartPageLoad1"/>
105+
<grabTextFrom selector="{{CheckoutCartProductSection.nthBundleOptionName('1')}}" stepKey="grabTotalAfter"/>
106+
<assertNotEquals expected="{$grabTotalBefore}" expectedType="string" actual="{$grabTotalAfter}" actualType="string" stepKey="assertNotEquals"/>
107+
108+
<!-- Delete the bundled product -->
109+
<actionGroup stepKey="deleteBundle" ref="deleteProductUsingProductGrid">
110+
<argument name="product" value="BundleProduct"/>
111+
</actionGroup>
112+
</test>
113+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
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="Bundle"/>
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="saveProductBundle" 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+
<!-- add two products to the shopping cart, each with one different option -->
75+
<click stepKey="selectFirstBundleOption" selector="{{StorefrontBundledSection.nthBundledOption('1','1')}}"/>
76+
<waitForPageLoad stepKey="waitForPriceUpdate"/>
77+
<see stepKey="seeSinglePrice" selector="{{StorefrontBundledSection.configuredPrice}}" userInput="1,230.00"/>
78+
<click stepKey="addFirstItemToCart" selector="{{StorefrontBundledSection.addToCartConfigured}}"/>
79+
<waitForPageLoad stepKey="waitForElementAdded"/>
80+
81+
<click stepKey="unselectFirstBundleOption" selector="{{StorefrontBundledSection.nthBundledOption('1','1')}}"/>
82+
<click stepKey="selectSecondBundleOption" selector="{{StorefrontBundledSection.nthBundledOption('1','2')}}"/>
83+
<waitForPageLoad stepKey="waitForPriceUpdate2"/>
84+
<see stepKey="seeSinglePrice2" selector="{{StorefrontBundledSection.configuredPrice}}" userInput="1,230.00"/>
85+
<click stepKey="addSecondItemToCart" selector="{{StorefrontBundledSection.addToCartConfigured}}"/>
86+
<waitForPageLoad stepKey="waitForElementAdded2"/>
87+
88+
<!-- Go to the shopping cart page and edit the first product -->
89+
<amOnPage url="/checkout/cart/" stepKey="onPageShoppingCart"/>
90+
<waitForPageLoad stepKey="waitForCartPageLoad"/>
91+
<waitForElementVisible stepKey="waitForInfoDropdown" selector="{{CheckoutCartSummarySection.total}}"/>
92+
<waitForPageLoad stepKey="waitForCartPageLoad3"/>
93+
<grabTextFrom selector="{{CheckoutCartSummarySection.total}}" stepKey="grabTotalBefore"/>
94+
<click stepKey="clickEdit" selector="{{CheckoutCartProductSection.nthEditButton('1')}}"/>
95+
<waitForPageLoad stepKey="waitForStorefront2"/>
96+
97+
<!-- Choose both of the options on the storefront -->
98+
<click stepKey="selectFirstBundleOption2" selector="{{StorefrontBundledSection.nthBundledOption('1','1')}}"/>
99+
<click stepKey="selectSecondBundleOption2" selector="{{StorefrontBundledSection.nthBundledOption('1','2')}}"/>
100+
101+
<waitForPageLoad stepKey="waitForPriceUpdate3"/>
102+
<see stepKey="seeDoublePrice" selector="{{StorefrontBundledSection.configuredPrice}}" userInput="2,460.00"/>
103+
104+
<click stepKey="addFirstItemToCart2" selector="{{StorefrontBundledSection.updateCart}}"/>
105+
<waitForPageLoad stepKey="waitForElementAdded3"/>
106+
107+
<!-- Go to the shopping cart page -->
108+
<amOnPage url="/checkout/cart/" stepKey="onPageShoppingCart2"/>
109+
<waitForPageLoad stepKey="waitForCartPageLoad2"/>
110+
111+
<!-- Assert that the options are both there and the proce no longer matches -->
112+
<see stepKey="assertBothOptions" selector="{{CheckoutCartProductSection.nthItemOption('2')}}" userInput="$$simpleProduct1.sku$$"/>
113+
<see stepKey="assertBothOptions2" selector="{{CheckoutCartProductSection.nthItemOption('2')}}" userInput="$$simpleProduct2.sku$$"/>
114+
<waitForElementVisible stepKey="waitForInfoDropdown2" selector="{{CheckoutCartSummarySection.total}}"/>
115+
<waitForPageLoad stepKey="waitForCartPageLoad4"/>
116+
<grabTextFrom selector="{{CheckoutCartSummarySection.total}}" stepKey="grabTotalAfter"/>
117+
<assertNotEquals expected="{$grabTotalBefore}" expectedType="string" actual="{$grabTotalAfter}" actualType="string" stepKey="assertNotEquals"/>
118+
119+
<!-- Delete the bundled product -->
120+
<actionGroup stepKey="deleteBundle" ref="deleteProductUsingProductGrid">
121+
<argument name="product" value="BundleProduct"/>
122+
</actionGroup>
123+
</test>
124+
</tests>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Checkout/Section/CheckoutCartProductSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@
2626
parameterized="true"/>
2727
<element name="RemoveItem" type="button"
2828
selector="//table[@id='shopping-cart-table']//tbody//tr[contains(@class,'item-actions')]//a[contains(@class,'action-delete')]"/>
29+
<element name="nthItemOption" type="block" selector=".item:nth-of-type({{numElement}}) .item-options" parameterized="true"/>
30+
<element name="nthEditButton" type="block" selector=".item:nth-of-type({{numElement}}) .action-edit" parameterized="true"/>
31+
<element name="nthBundleOptionName" type="text" selector=".product-item-details .item-options:nth-of-type({{numOption}}) dt" parameterized="true"/>
2932
</section>
3033
</sections>

0 commit comments

Comments
 (0)