Skip to content

Commit 95c4040

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-89234' into 2.2-develop-pr44
2 parents ef1d65c + 2c4c31f commit 95c4040

File tree

6 files changed

+136
-0
lines changed

6 files changed

+136
-0
lines changed

app/code/Magento/Wishlist/Controller/Index/Update.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ public function execute()
109109
}
110110
try {
111111
$item->setDescription($description)->setQty($qty)->save();
112+
$this->messageManager->addSuccessMessage(
113+
__('%1 has been updated in your Wish List.', $item->getProduct()->getName())
114+
);
112115
$updatedItems++;
113116
} catch (\Exception $e) {
114117
$this->messageManager->addError(

app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerWishlistActionGroup.xml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,29 @@
2020
<seeCurrentUrlMatches regex="~/wishlist_id/\d+/$~" stepKey="seeCurrentUrlMatches"/>
2121
</actionGroup>
2222

23+
<!-- Add Product to wishlist from the product page and check message -->
24+
<actionGroup name="StorefrontCustomerAddProductToWishlistActionGroup">
25+
<arguments>
26+
<argument name="productVar"/>
27+
</arguments>
28+
<click selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" stepKey="addProductToWishlistClickAddToWishlist" />
29+
<waitForElement selector="{{StorefrontCustomerWishlistSection.successMsg}}" time="30" stepKey="addProductToWishlistWaitForSuccessMessage"/>
30+
<see selector="{{StorefrontCustomerWishlistSection.successMsg}}" userInput="{{productVar.name}} has been added to your Wish List." stepKey="addProductToWishlistSeeProductNameAddedToWishlist"/>
31+
<seeCurrentUrlMatches regex="~/wishlist_id/\d+/$~" stepKey="seeCurrentUrlMatches"/>
32+
</actionGroup>
33+
34+
<!-- Check product in wishlist -->
35+
<actionGroup name="StorefrontCustomerCheckProductInWishlist">
36+
<arguments>
37+
<argument name="productVar"/>
38+
</arguments>
39+
<waitForElement selector="{{StorefrontCustomerWishlistProductSection.productTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistProductName"/>
40+
<see userInput="${{productVar.price}}.00" selector="{{StorefrontCustomerWishlistProductSection.productPriceByName(productVar.name)}}" stepKey="assertWishlistProductPrice"/>
41+
<moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.productInfoByName(productVar.name)}}" stepKey="wishlistMoveMouseOverProduct" />
42+
<seeElement selector="{{StorefrontCustomerWishlistProductSection.productAddToCartByName(productVar.name)}}" stepKey="assertWishlistAddToCart" />
43+
<seeElement selector="{{StorefrontCustomerWishlistProductSection.productImageByName(productVar.name)}}" stepKey="assertWishlistProductImage" />
44+
</actionGroup>
45+
2346
<!-- Check product in wishlist sidebar -->
2447
<actionGroup name="StorefrontCustomerCheckProductInWishlistSidebar">
2548
<arguments>
@@ -50,4 +73,18 @@
5073
<waitForElement selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="addProductToCartFromWishlistUsingSidebarWaitForSuccessMessage"/>
5174
<see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="addProductToCartFromWishlistUsingSidebarSeeProductNameAddedToCartFromWishlist"/>
5275
</actionGroup>
76+
77+
<actionGroup name="StorefrontCustomerEditProductInWishlist">
78+
<arguments>
79+
<argument name="product"/>
80+
<argument name="description" type="string"/>
81+
<argument name="quantity" type="string"/>
82+
</arguments>
83+
<moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.productInfoByName(product.name)}}" stepKey="mouseOverOnProduct"/>
84+
<fillField selector="{{StorefrontCustomerWishlistProductSection.productDescription(product.name)}}" userInput="{{description}}" stepKey="fillDescription"/>
85+
<fillField selector="{{StorefrontCustomerWishlistProductSection.productQuantity(product.name)}}" userInput="{{quantity}}" stepKey="fillQuantity"/>
86+
<moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.productAddAllToCart}}" stepKey="mouseOver"/>
87+
<click selector="{{StorefrontCustomerWishlistProductSection.productUpdateWishList}}" stepKey="submitUpdateWishlist"/>
88+
<see selector="{{StorefrontMessagesSection.success}}" userInput="{{product.name}} has been updated in your Wish List." stepKey="successMessage"/>
89+
</actionGroup>
5390
</actionGroups>

app/code/Magento/Wishlist/Test/Mftf/Page/StorefrontCustomerWishlistPage.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
1111
<page name="StorefrontCustomerWishlistPage" url="/wishlist/" area="storefront" module="Magento_Wishlist">
1212
<section name="StorefrontCustomerWishlistSection" />
13+
<section name="StorefrontCustomerWishlistProductSection" />
1314
</page>
1415
</pages>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="StorefrontCustomerWishlistProductSection">
12+
<element name="productTitleByName" type="button" selector="//main//li//a[contains(text(), '{{var1}}')]" parameterized="true"/>
13+
<element name="productPriceByName" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//span[@class='price']" parameterized="true"/>
14+
<element name="productImageByName" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//img[@class='product-image-photo']" parameterized="true"/>
15+
<element name="productInfoByName" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//div[@class='product-item-info']" parameterized="true"/>
16+
<element name="productAddToCartByName" type="button" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//button[contains(@class, 'action tocart primary')]" parameterized="true"/>
17+
<element name="productImageByImageName" type="text" selector="//main//li//a//img[contains(@src, '{{var1}}')]" parameterized="true"/>
18+
<element name="productDescription" type="input" selector="//a[contains(text(), '{{productName}}')]/ancestor::div[@class='product-item-info']//textarea[@class='product-item-comment']" parameterized="true"/>
19+
<element name="productQuantity" type="input" selector="//a[contains(text(), '{{productName}}')]/ancestor::div[@class='product-item-info']//input[@class='input-text qty']" parameterized="true"/>
20+
<element name="productUpdateWishList" type="button" selector=".column.main .actions-toolbar .action.update" timeout="30"/>
21+
<element name="productAddAllToCart" type="button" selector=".column.main .actions-toolbar .action.tocart" timeout="30"/>
22+
</section>
23+
</sections>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="StorefrontProductInfoMainSection">
12+
<element name="productAddToWishlist" type="button" selector="a.action.towishlist"/>
13+
</section>
14+
</sections>
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
<test name="StorefrontUpdateWishlistTest">
11+
<annotations>
12+
<title value="Displaying of message after Wish List update"/>
13+
<stories value="MAGETWO-89234: Wishlist update does not return a success message"/>
14+
<description value="Displaying of message after Wish List update"/>
15+
<features value="Wishlist"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="MAGETWO-94905"/>
18+
<group value="Wishlist"/>
19+
</annotations>
20+
21+
<before>
22+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
23+
<createData entity="SimpleProduct" stepKey="createProduct">
24+
<requiredEntity createDataKey="createCategory"/>
25+
</createData>
26+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
27+
</before>
28+
29+
<actionGroup ref="CustomerLoginOnStorefront" stepKey="loginToStorefrontAccount">
30+
<argument name="customer" value="$$createCustomer$$"/>
31+
</actionGroup>
32+
33+
<actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategory">
34+
<argument name="category" value="$$createCategory$$"/>
35+
<argument name="product" value="$$createProduct$$"/>
36+
</actionGroup>
37+
38+
<actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductToWishlist">
39+
<argument name="productVar" value="$$createProduct$$"/>
40+
</actionGroup>
41+
42+
<actionGroup ref="StorefrontCustomerCheckProductInWishlist" stepKey="checkProductInWishlist">
43+
<argument name="productVar" value="$$createProduct$$"/>
44+
</actionGroup>
45+
46+
<actionGroup ref="StorefrontCustomerEditProductInWishlist" stepKey="updateProductInWishlist">
47+
<argument name="product" value="$$createProduct$$"/>
48+
<argument name="description" value="some text"/>
49+
<argument name="quantity" value="2"/>
50+
</actionGroup>
51+
52+
<after>
53+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
54+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
55+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
56+
</after>
57+
</test>
58+
</tests>

0 commit comments

Comments
 (0)