Skip to content

Commit 17226f3

Browse files
committed
ACP2E-2615: Bundle products added via the Page Builder > Products widget break the cart
- added MFTF test
1 parent b259f81 commit 17226f3

File tree

2 files changed

+103
-0
lines changed

2 files changed

+103
-0
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontBundleAddToCartFromWidget">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Bundle product details page"/>
15+
<title value="Customer should be able to add a bundle product to the cart from widget"/>
16+
<description value="Customer should be able to add a bundle product to the cart from widget"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="AC-10867"/>
19+
<group value="Bundle"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
23+
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
24+
</before>
25+
<after>
26+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteBundleProductBySku">
27+
<argument name="sku" value="{{BundleProductWithSlashSku.sku}}"/>
28+
</actionGroup>
29+
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
30+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
31+
</after>
32+
33+
<!-- Start creating a bundle product -->
34+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductList"/>
35+
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
36+
<argument name="product" value="BundleProduct"/>
37+
</actionGroup>
38+
<actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillNameAndSku">
39+
<argument name="product" value="BundleProductWithSlashSku"/>
40+
</actionGroup>
41+
42+
<!-- Add Option One, a "Drop-down" type option -->
43+
<actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOptionWithOneProduct">
44+
<argument name="x" value="0"/>
45+
<argument name="n" value="1"/>
46+
<argument name="prodOneSku" value="$$simpleProduct1.sku$$"/>
47+
<argument name="prodTwoSku" value=""/>
48+
<argument name="optionTitle" value="Option One"/>
49+
<argument name="inputType" value="select"/>
50+
</actionGroup>
51+
52+
<!-- Save product, edit Homepage CMS page and add products widget -->
53+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
54+
<amOnPage url="{{AdminCmsPageEditPage.url(CmsHomePageContent.page_id)}}" stepKey="navigateToEditCmsHomePage"/>
55+
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickContentTab" />
56+
<actionGroup ref="AdminInsertWidgetToCmsPageContentActionGroup" stepKey="insertWidgetToCmsPageContentActionGroup">
57+
<argument name="widgetType" value="Catalog Products List"/>
58+
</actionGroup>
59+
<actionGroup ref="AdminFillCatalogProductsListWidgetSkuActionGroup" stepKey="selectProductForListing">
60+
<argument name="sku" value="{{BundleProductWithSlashSku.sku}}"/>
61+
</actionGroup>
62+
<actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidgetButton2"/>
63+
<actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSaveButton"/>
64+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the page." stepKey="seeSuccess"/>
65+
66+
<!-- Go to storefront homepage and add to cart -->
67+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/>
68+
<actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/>
69+
<actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart"/>
70+
<waitForPageLoad stepKey="waitForProductAdded"/>
71+
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="seeSuccessMessage"/>
72+
</test>
73+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminFillCatalogProductsListWidgetSkuActionGroup">
12+
<annotations>
13+
<description>Fill catalog products list widget sku.</description>
14+
</annotations>
15+
16+
<arguments>
17+
<argument name="sku" type="string" defaultValue=""/>
18+
</arguments>
19+
20+
<waitForElementVisible selector="{{WidgetSection.AddParam}}" stepKey="waitForAddParamElement"/>
21+
<click selector="{{WidgetSection.AddParam}}" stepKey="clickOnAddParamElement"/>
22+
<waitForElementVisible selector="{{WidgetSection.ConditionsDropdown}}"
23+
stepKey="waitForConditionsDropdownVisible"/>
24+
<selectOption selector="{{WidgetSection.ConditionsDropdown}}" userInput="SKU" stepKey="selectSkuAsCondition"/>
25+
<waitForElementVisible selector="{{WidgetSection.RuleParam}}" stepKey="waitForRuleParamElementVisible"/>
26+
<click selector="{{WidgetSection.RuleParam}}" stepKey="clickToAddRuleParam"/>
27+
<fillField selector=".rule-param-edit input" userInput="{{sku}}" stepKey="fillSkuField"/>
28+
<click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="clickApplyButton"/>
29+
</actionGroup>
30+
</actionGroups>

0 commit comments

Comments
 (0)