Skip to content

Commit 359b260

Browse files
committed
MC-39107: [MAGENTO CLOUD] Page refresh on add to cart from product block
1 parent 65bed17 commit 359b260

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductActionSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<element name="addToCartButtonTitleIsAdding" type="text" selector="//button/span[text()='Adding...']"/>
1515
<element name="addToCartButtonTitleIsAdded" type="text" selector="//button/span[text()='Added']"/>
1616
<element name="addToCartButtonTitleIsAddToCart" type="text" selector="//button/span[text()='Add to Cart']"/>
17+
<element name="addToCartButtonTitleIsAddToCartBySku" type="text" selector="//form[@data-product-sku='{{var1}}']//button[contains(@class, 'tocart')]/span[text()='Add to Cart']" parameterized="true" />
1718
<element name="inputFormKey" type="text" selector="input[name='form_key']"/>
1819
</section>
1920
</sections>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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="CatalogProductListCheckAjaxAddToCartTest" extends="CatalogProductListCheckWidgetOrderTest">
12+
<annotations>
13+
<features value="CatalogWidget"/>
14+
<stories value="Product list widget"/>
15+
<title value="Check if Add To Cart button on product list widget would work as AJAX and not POST request"/>
16+
<description
17+
value="Check if Add To Cart button on product list widget would send an AJAX request and not cause the page to reload"/>
18+
<severity value="MAJOR"/>
19+
<testCaseId value="MC-40300"/>
20+
<useCaseId value="MC-39107"/>
21+
<group value="catalogWidget"/>
22+
<group value="catalog"/>
23+
<group value="WYSIWYGDisabled"/>
24+
</annotations>
25+
<!-- Click the add to cart button -->
26+
<actionGroup ref="StorefrontAddSimpleProductToCartActionGroup" stepKey="addTestProductToCart">
27+
<argument name="product" value="$$createFirstProduct$$"/>
28+
</actionGroup>
29+
<!-- See if Add to Cart button is still visible after AJAX request -->
30+
<seeElement selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAddToCartBySku($$createFirstProduct.sku$$)}}" stepKey="waitForAddToCartButtonVisible"/>
31+
</test>
32+
</tests>

0 commit comments

Comments
 (0)