Skip to content

Commit ea57d12

Browse files
committed
MC-290: Customer should be able to change chosen options for Bundle Product when clicking Edit button in Shopping Cart page
- Edit added bundled product
1 parent 1bc60e4 commit ea57d12

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<element name="nthBundledOption" type="input" selector=".option:nth-of-type({{numOption}}) .choice:nth-of-type({{numOptionSelect}}) input" parameterized="true"/>
1313
<element name="addToCart" type="button" selector="#bundle-slide"/>
1414
<element name="addToCartConfigured" type="button" selector="#product-addtocart-button"/>
15+
<element name="updateCart" type="button" selector="#product-updatecart-button"/>
1516
<element name="configuredPrice" type="block" selector=".price-configured_price .price"/>
1617
</section>
1718
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Bundle/Test/StorefrontEditBundleProductTest.xml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<description value="Customer should be able to change chosen options for Bundle Product when clicking Edit button in Shopping Cart page"/>
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-290"/>
19-
<group value="Levi"/>
19+
<group value="Bundle"/>
2020
</annotations>
2121
<before>
2222
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
@@ -71,18 +71,47 @@
7171
<click stepKey="customizeAndAddToCart" selector="{{StorefrontBundledSection.addToCart}}"/>
7272
<waitForPageLoad stepKey="waitCustomizableOptionsPopUp"/>
7373

74+
<!-- add two products to the shopping cart, each with one different page -->
7475
<click stepKey="selectFirstBundleOption" selector="{{StorefrontBundledSection.nthBundledOption('1','1')}}"/>
75-
76+
<waitForPageLoad stepKey="waitForPriceUpdate"/>
7677
<see stepKey="seeSinglePrice" selector="{{StorefrontBundledSection.configuredPrice}}" userInput="1,230.00"/>
7778
<click stepKey="addFirstItemToCart" selector="{{StorefrontBundledSection.addToCartConfigured}}"/>
7879
<waitForPageLoad stepKey="waitForElementAdded"/>
7980

8081
<click stepKey="unselectFirstBundleOption" selector="{{StorefrontBundledSection.nthBundledOption('1','1')}}"/>
8182
<click stepKey="selectSecondBundleOption" selector="{{StorefrontBundledSection.nthBundledOption('1','2')}}"/>
82-
83+
<waitForPageLoad stepKey="waitForPriceUpdate2"/>
8384
<see stepKey="seeSinglePrice2" selector="{{StorefrontBundledSection.configuredPrice}}" userInput="1,230.00"/>
8485
<click stepKey="addSecondItemToCart" selector="{{StorefrontBundledSection.addToCartConfigured}}"/>
8586
<waitForPageLoad stepKey="waitForElementAdded2"/>
8687

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+
<grabTextFrom selector="{{CheckoutCartSummarySection.total}}" stepKey="grabTotalBefore"/>
93+
<click stepKey="clickEdit" selector="{{CheckoutCartProductSection.nthEditButton('1')}}"/>
94+
<waitForPageLoad stepKey="waitForStorefront2"/>
95+
96+
<!-- Choose both of the options on the storefront -->
97+
<click stepKey="selectFirstBundleOption2" selector="{{StorefrontBundledSection.nthBundledOption('1','1')}}"/>
98+
<click stepKey="selectSecondBundleOption2" selector="{{StorefrontBundledSection.nthBundledOption('1','2')}}"/>
99+
100+
<waitForPageLoad stepKey="waitForPriceUpdate3"/>
101+
<see stepKey="seeDoublePrice" selector="{{StorefrontBundledSection.configuredPrice}}" userInput="2,460.00"/>
102+
103+
<click stepKey="addFirstItemToCart2" selector="{{StorefrontBundledSection.updateCart}}"/>
104+
<waitForPageLoad stepKey="waitForElementAdded3"/>
105+
106+
<!-- Go to the shopping cart page -->
107+
<amOnPage url="/checkout/cart/" stepKey="onPageShoppingCart2"/>
108+
<waitForPageLoad stepKey="waitForCartPageLoad2"/>
109+
110+
<!-- Assert that the options are both there and the proce no longer matches -->
111+
<see stepKey="assertBothOptions" selector="{{CheckoutCartProductSection.nthItemOption('2')}}" userInput="$$simpleProduct1.sku$$"/>
112+
<see stepKey="assertBothOptions2" selector="{{CheckoutCartProductSection.nthItemOption('2')}}" userInput="$$simpleProduct2.sku$$"/>
113+
<grabTextFrom selector="{{CheckoutCartSummarySection.total}}" stepKey="grabTotalAfter"/>
114+
<assertNotEquals expected="{$grabTotalBefore}" expectedType="string" actual="{$grabTotalAfter}" actualType="string" stepKey="assertNotEquals"/>
115+
87116
</test>
88117
</tests>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,7 @@
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"/>
2931
</section>
3032
</sections>

0 commit comments

Comments
 (0)