Skip to content

Commit 9fc4086

Browse files
committed
MC-29105: Disable product issue with Cart Item bundle product
- Add MFTF test
1 parent 41565f0 commit 9fc4086

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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="StorefrontCheckoutDisabledBundleProductTest">
11+
<annotations>
12+
<features value="Checkout"/>
13+
<stories value="Disabled bundle product is preventing customer to checkout for the first attempt"/>
14+
<title value="Customer should be able to checkout if there is at least one available product in the cart"/>
15+
<description value="Customer should be able to checkout if there is at least one available product in the cart"/>
16+
<severity value="MINOR"/>
17+
<testCaseId value="MC-29105"/>
18+
<group value="checkout"/>
19+
</annotations>
20+
21+
<before>
22+
<!-- Create category and simple product -->
23+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
24+
<createData entity="_defaultProduct" stepKey="createSimpleProduct">
25+
<requiredEntity createDataKey="createCategory"/>
26+
</createData>
27+
<!-- Create bundle product -->
28+
<createData entity="ApiBundleProductPriceViewRange" stepKey="createBundleDynamicProduct">
29+
<requiredEntity createDataKey="createCategory"/>
30+
</createData>
31+
<createData entity="DropDownBundleOption" stepKey="bundleOption">
32+
<requiredEntity createDataKey="createBundleDynamicProduct"/>
33+
</createData>
34+
<createData entity="ApiBundleLink" stepKey="createNewBundleLink">
35+
<requiredEntity createDataKey="createBundleDynamicProduct"/>
36+
<requiredEntity createDataKey="bundleOption"/>
37+
<requiredEntity createDataKey="createSimpleProduct"/>
38+
</createData>
39+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
40+
<magentoCLI command="cache:flush" stepKey="cacheFlush"/>
41+
</before>
42+
<after>
43+
<!-- Delete category -->
44+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
45+
<!-- Delete bundle product data -->
46+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
47+
<deleteData createDataKey="createBundleDynamicProduct" stepKey="deleteBundleProduct"/>
48+
</after>
49+
<!-- Add simple product to the cart -->
50+
<actionGroup ref="AddSimpleProductToCart" stepKey="cartAddSimpleProductToCart">
51+
<argument name="product" value="$$createSimpleProduct$$"/>
52+
<argument name="productCount" value="1"/>
53+
</actionGroup>
54+
<!-- Go to bundle product page -->
55+
<amOnPage url="{{StorefrontProductPage.url($$createBundleDynamicProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPage"/>
56+
<waitForPageLoad stepKey="waitForPageLoad"/>
57+
<!-- Add bundle product to the cart -->
58+
<click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/>
59+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCart">
60+
<argument name="productName" value="$$createBundleDynamicProduct.name$$"/>
61+
</actionGroup>
62+
<!-- Login to admin panel -->
63+
<openNewTab stepKey="openNewTab"/>
64+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
65+
<!-- Find the first simple product that we just created using the product grid and go to its page-->
66+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
67+
<!-- Disabled bundle product from grid -->
68+
<actionGroup ref="ChangeStatusProductUsingProductGridActionGroup" stepKey="disabledProductFromGrid">
69+
<argument name="product" value="$$createBundleDynamicProduct$$"/>
70+
<argument name="status" value="Disable"/>
71+
</actionGroup>
72+
<closeTab stepKey="closeTab"/>
73+
<!-- Go to cart page-->
74+
<actionGroup ref="StorefrontOpenCartPageActionGroup" stepKey="openCartPage"/>
75+
<!-- Assert checkout button exists on the page-->
76+
<seeElement selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="seeCheckoutButton"/>
77+
<!-- Assert no error message is not shown on the page-->
78+
<dontSee userInput="Some of the products are out of stock." stepKey="seeNoItemsInShoppingCart"/>
79+
</test>
80+
</tests>

0 commit comments

Comments
 (0)