Skip to content

Fixed downloadable selected links price not added to product main price on cart configure page. #24579 #24580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="EditDownloadableProductWithSeparateLinksFromCartTest">
<annotations>
<features value="Catalog"/>
<stories value="Create Downloadable Product"/>
<title value="Edit downloadable product with separate links from cart test"/>
<description value="Product price should remain correct when editing downloadable product with separate links from cart."/>
<severity value="MAJOR"/>
<group value="Downloadable"/>
</annotations>
<before>
<!-- Create category -->
<createData entity="SimpleSubCategory" stepKey="createCategory"/>

<!-- Login as admin -->
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>

<!-- Create downloadable product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/>
<waitForPageLoad stepKey="waitForProductGridPageLoad"/>
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct">
<argument name="productType" value="downloadable"/>
</actionGroup>

<!-- Fill downloadable product values -->
<actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm">
<argument name="product" value="DownloadableProduct"/>
</actionGroup>

<!-- Add downloadable product to category -->
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}"
parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/>

<!-- Fill downloadable link information before the creation link -->
<actionGroup ref="AdminAddDownloadableLinkInformationActionGroup" stepKey="addDownloadableLinkInformation"/>

<!-- Links can be purchased separately -->
<checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}"
stepKey="checkOptionPurchaseSeparately"/>

<!-- Add first downloadable link -->
<actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink">
<argument name="link" value="downloadableLinkWithMaxDownloads"/>
</actionGroup>

<!-- Add second downloadable link -->
<actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink">
<argument name="link" value="downloadableLink"/>
</actionGroup>

<!-- Save product -->
<actionGroup ref="saveProductForm" stepKey="saveProduct"/>
</before>
<after>
<!-- Delete category -->
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>

<!-- Delete created downloadable product -->
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct">
<argument name="product" value="DownloadableProduct"/>
</actionGroup>

<!-- Log out -->
<actionGroup ref="logout" stepKey="logout"/>
</after>

<!-- Step 1: Navigate to store front Product page as guest -->
<amOnPage url="/{{DownloadableProduct.sku}}.html"
stepKey="amOnStorefrontProductPage"/>

<!-- Step 2: Add checkbox for first link -->
<click
selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLinkWithMaxDownloads.title)}}"
stepKey="selectProductLink"/>

<!-- Step 3: Add the Product to cart -->
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
<argument name="product" value="DownloadableProduct"/>
<argument name="productCount" value="1"/>
</actionGroup>

<!-- Step 4: Open cart -->
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="openShoppingCartPage"/>
<waitForPageLoad stepKey="waitForShoppingCartPageLoad"/>
<see selector="{{CheckoutCartProductSection.ProductPriceByName(DownloadableProduct.name)}}" userInput="$51.99"
stepKey="assertProductPriceInCart"/>

<!-- Step 5: Edit Product in cart -->
<click selector="{{CheckoutCartProductSection.nthEditButton('1')}}" stepKey="clickEdit"/>
<waitForPageLoad stepKey="waitForEditPage"/>

<!-- Step 6: Make sure Product price is correct -->
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="51.99" stepKey="checkPrice"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ define([
});
}
});

this._reloadPrice();
},

/**
Expand Down