-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Add to Cart broken on lists view with redirect to cart enabled. #32301
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
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...t/Test/Mftf/ActionGroup/StorefrontAddSimpleProductToCartFromComparisonListActionGroup.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<!-- Add Product to Cart from the category page and check message --> | ||
<actionGroup name="StorefrontAddSimpleProductToCartFromComparisonListActionGroup"> | ||
<annotations> | ||
<description>Add simple product from comparison page to the cart. Starts on products comparison page.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="productName" type="string" defaultValue="{{SimpleProduct.name}}"/> | ||
</arguments> | ||
|
||
<waitForElement selector="{{StorefrontProductCompareMainSection.ProductAddToCartButton(productName)}}" stepKey="waitForAddToCartButton"/> | ||
<click selector="{{StorefrontProductCompareMainSection.ProductAddToCartButton(productName)}}" stepKey="clickAddToCartButton"/> | ||
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> | ||
<see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{productName}} to your shopping cart." stepKey="assertSuccessMessage"/> | ||
</actionGroup> | ||
</actionGroups> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
...heckout/Test/Mftf/Test/StorefrontAddSimpleProductToCartWithRedirectToShoppingCartTest.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?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="StorefrontAddSimpleProductToCartWithRedirectToShoppingCartTest"> | ||
<annotations> | ||
<stories value="Shopping Cart"/> | ||
<features value="Checkout"/> | ||
<title value="Add simple product to shopping cart with 'redirect to shopping cart' enabled."/> | ||
<description value="Verify, user able add simple product to shopping cart from category page and compare products page when 'redirect to shopping cart' is enabled."/> | ||
<testCaseId value="MC-41079"/> | ||
<useCaseId value="MC-40983"/> | ||
<severity value="CRITICAL"/> | ||
<group value="shoppingCart"/> | ||
engcom-Kilo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<group value="checkout"/> | ||
</annotations> | ||
|
||
<before> | ||
<!--Enable redirect to shopping cart.--> | ||
<magentoCLI command="config:set {{EnableRedirectToShoppingCart.path}} {{EnableRedirectToShoppingCart.value}}" stepKey="enableRedirectToShippingCart"/> | ||
<!--Create test data.--> | ||
<createData entity="_defaultCategory" stepKey="category"/> | ||
<createData entity="SimpleProduct" stepKey="product"> | ||
<requiredEntity createDataKey="category"/> | ||
</createData> | ||
</before> | ||
<after> | ||
<!--Disable redirect to shopping cart.--> | ||
<magentoCLI command="config:set {{DisableRedirectToShoppingCart.path}} {{DisableRedirectToShoppingCart.value}}" stepKey="disableRedirectToShippingCart"/> | ||
<!--Delete test data.--> | ||
<deleteData createDataKey="product" stepKey="deleteSimpleProduct"/> | ||
<deleteData createDataKey="category" stepKey="deleteCategory"/> | ||
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> | ||
</after> | ||
|
||
<!--Try to add simple product to shopping cart.--> | ||
<actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryPage"> | ||
<argument name="categoryUrl" value="$category.custom_attributes[url_key]$"/> | ||
</actionGroup> | ||
<actionGroup ref="StorefrontAddSimpleProductToCartActionGroup" stepKey="addProductToCart"> | ||
<argument name="product" value="$product$"/> | ||
</actionGroup> | ||
<seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="verifyCartRedirectAfterAddingProductFromCategoryPage"/> | ||
<!-- Add product to compare list --> | ||
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> | ||
<argument name="productUrl" value="$product.custom_attributes[url_key]$"/> | ||
</actionGroup> | ||
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addProductToCompare"> | ||
<argument name="productVar" value="$product$"/> | ||
</actionGroup> | ||
<!--Try to add simple product to shopping cart from compare products page.--> | ||
<actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="checkProductInComparisonList"> | ||
<argument name="productVar" value="$product$"/> | ||
</actionGroup> | ||
<actionGroup ref="StorefrontAddSimpleProductToCartFromComparisonListActionGroup" stepKey="addProductToCartFromComparisonList"> | ||
engcom-Kilo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<argument name="productName" value="$product.name$"/> | ||
</actionGroup> | ||
<seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="verifyCartRedirectAfterAddingProductFromComparisonList"/> | ||
</test> | ||
</tests> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.