Skip to content

Commit 3d80c9a

Browse files
authored
ENGCOM-5837: Fixed downloadable selected links price not added to product main price on cart configure page. #24579 #24580
2 parents 36a5965 + a2f61f7 commit 3d80c9a

File tree

2 files changed

+106
-0
lines changed

2 files changed

+106
-0
lines changed
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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="EditDownloadableProductWithSeparateLinksFromCartTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Create Downloadable Product"/>
15+
<title value="Edit downloadable product with separate links from cart test"/>
16+
<description value="Product price should remain correct when editing downloadable product with separate links from cart."/>
17+
<severity value="MAJOR"/>
18+
<group value="Downloadable"/>
19+
</annotations>
20+
<before>
21+
<!-- Create category -->
22+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
23+
24+
<!-- Login as admin -->
25+
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
26+
27+
<!-- Create downloadable product -->
28+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/>
29+
<waitForPageLoad stepKey="waitForProductGridPageLoad"/>
30+
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct">
31+
<argument name="productType" value="downloadable"/>
32+
</actionGroup>
33+
34+
<!-- Fill downloadable product values -->
35+
<actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm">
36+
<argument name="product" value="DownloadableProduct"/>
37+
</actionGroup>
38+
39+
<!-- Add downloadable product to category -->
40+
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}"
41+
parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/>
42+
43+
<!-- Fill downloadable link information before the creation link -->
44+
<actionGroup ref="AdminAddDownloadableLinkInformationActionGroup" stepKey="addDownloadableLinkInformation"/>
45+
46+
<!-- Links can be purchased separately -->
47+
<checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}"
48+
stepKey="checkOptionPurchaseSeparately"/>
49+
50+
<!-- Add first downloadable link -->
51+
<actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink">
52+
<argument name="link" value="downloadableLinkWithMaxDownloads"/>
53+
</actionGroup>
54+
55+
<!-- Add second downloadable link -->
56+
<actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink">
57+
<argument name="link" value="downloadableLink"/>
58+
</actionGroup>
59+
60+
<!-- Save product -->
61+
<actionGroup ref="saveProductForm" stepKey="saveProduct"/>
62+
</before>
63+
<after>
64+
<!-- Delete category -->
65+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
66+
67+
<!-- Delete created downloadable product -->
68+
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct">
69+
<argument name="product" value="DownloadableProduct"/>
70+
</actionGroup>
71+
72+
<!-- Log out -->
73+
<actionGroup ref="logout" stepKey="logout"/>
74+
</after>
75+
76+
<!-- Step 1: Navigate to store front Product page as guest -->
77+
<amOnPage url="/{{DownloadableProduct.sku}}.html"
78+
stepKey="amOnStorefrontProductPage"/>
79+
80+
<!-- Step 2: Add checkbox for first link -->
81+
<click
82+
selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLinkWithMaxDownloads.title)}}"
83+
stepKey="selectProductLink"/>
84+
85+
<!-- Step 3: Add the Product to cart -->
86+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
87+
<argument name="product" value="DownloadableProduct"/>
88+
<argument name="productCount" value="1"/>
89+
</actionGroup>
90+
91+
<!-- Step 4: Open cart -->
92+
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="openShoppingCartPage"/>
93+
<waitForPageLoad stepKey="waitForShoppingCartPageLoad"/>
94+
<see selector="{{CheckoutCartProductSection.ProductPriceByName(DownloadableProduct.name)}}" userInput="$51.99"
95+
stepKey="assertProductPriceInCart"/>
96+
97+
<!-- Step 5: Edit Product in cart -->
98+
<click selector="{{CheckoutCartProductSection.nthEditButton('1')}}" stepKey="clickEdit"/>
99+
<waitForPageLoad stepKey="waitForEditPage"/>
100+
101+
<!-- Step 6: Make sure Product price is correct -->
102+
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="51.99" stepKey="checkPrice"/>
103+
</test>
104+
</tests>

app/code/Magento/Downloadable/view/frontend/web/js/downloadable.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ define([
3838
});
3939
}
4040
});
41+
42+
this._reloadPrice();
4143
},
4244

4345
/**

0 commit comments

Comments
 (0)