Skip to content

Commit dc47266

Browse files
committed
ENGCOM-1534: Add a link to the cart to the success message when adding a product (Magento 2.3) #14059
1 parent 7c4057d commit dc47266

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
</arguments>
1717
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct" />
1818
<click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart" />
19-
<!-- @TODO: Use general message selector after MQE-694 is fixed -->
20-
<waitForElement selector="{{StorefrontMessagesSection.messageProductAddedToCart(product.name)}}" time="30" stepKey="assertMessage"/>
19+
<see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="assertSuccessMessage"/>
20+
<seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}/checkout/cart/" userInput="shopping cart" />
2121
<waitForText userInput="{{productCount}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/>
2222
</actionGroup>
2323

@@ -30,8 +30,8 @@
3030
</arguments>
3131
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct" />
3232
<click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart" />
33-
<!-- @TODO: Use general message selector after MQE-694 is fixed -->
34-
<waitForElement selector="{{StorefrontMessagesSection.messageProductAddedToCart(product.name)}}" time="30" stepKey="assertMessage"/>
33+
<see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="assertSuccessMessage"/>
34+
<seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}/checkout/cart/" userInput="shopping cart" />
3535
<waitForText userInput="{{checkQuantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/>
3636
<conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/>
3737
<waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/>
@@ -46,8 +46,8 @@
4646
<argument name="productCount" type="string"/>
4747
</arguments>
4848
<click selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="clickAddToCart" />
49-
<!-- @TODO: Use general message selector after MQE-694 is fixed -->
50-
<waitForElement selector="{{StorefrontMessagesSection.messageProductAddedToCart(product.name)}}" time="30" stepKey="assertMessage"/>
49+
<see selector="{{StorefrontProductPageSection.messagesBlock}}" userInput="You added {{product.name}} to your shopping cart." stepKey="assertSuccessMessage"/>
50+
<seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}/checkout/cart/" userInput="shopping cart" />
5151
<waitForText userInput="{{productCount}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/>
5252
</actionGroup>
5353

app/code/Magento/Checkout/Test/Mftf/Section/StorefrontMessagesSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<section name="StorefrontMessagesSection">
1212
<!-- @TODO: Use general message selector after MQE-694 is fixed -->
1313
<element name="messageProductAddedToCart" type="text"
14-
selector="//main//div[contains(@class, 'messages')]//div[contains(@class, 'message')]/div[contains(text(), 'You added {{var1}} to your shopping cart.')]"
14+
selector="//main//div[contains(@class, 'messages')]//div[contains(@class, 'message')]/div[contains(text(), 'You added {{var1}} to your') and a[contains(., 'shopping cart')]]"
1515
parameterized="true"
1616
/>
1717
</section>

0 commit comments

Comments
 (0)