Skip to content

Commit 8a63e04

Browse files
committed
Merge branch 'ShareWishlistEntityTest' of github.com:MilaLesechko/magento-functional-tests-migration into mtf-eol-pr
2 parents 994b6fe + 105dbe0 commit 8a63e04

File tree

7 files changed

+99
-1
lines changed

7 files changed

+99
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" stepKey="WaitForWishList"/>
2929
<click selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" stepKey="addProductToWishlistClickAddToWishlist" />
3030
<waitForElement selector="{{StorefrontCustomerWishlistSection.successMsg}}" time="30" stepKey="addProductToWishlistWaitForSuccessMessage"/>
31-
<see selector="{{StorefrontCustomerWishlistSection.successMsg}}" userInput="{{productVar.name}} has been added to your Wish List." stepKey="addProductToWishlistSeeProductNameAddedToWishlist"/>
31+
<see selector="{{StorefrontCustomerWishlistSection.successMsg}}" userInput="{{productVar.name}} has been added to your Wish List. Click here to continue shopping." stepKey="addProductToWishlistSeeProductNameAddedToWishlist"/>
3232
<seeCurrentUrlMatches regex="~/wishlist_id/\d+/$~" stepKey="seeCurrentUrlMatches"/>
3333
</actionGroup>
3434

@@ -88,4 +88,13 @@
8888
<click selector="{{StorefrontCustomerWishlistProductSection.ProductUpdateWishList}}" stepKey="submitUpdateWishlist"/>
8989
<see selector="{{StorefrontCustomerWishlistProductSection.ProductSuccessUpdateMessage}}" userInput="{{product.name}} has been updated in your Wish List." stepKey="successMessage"/>
9090
</actionGroup>
91+
92+
<!-- Share wishlist -->
93+
<actionGroup name="StorefrontCustomerShareWishlistActionGroup">
94+
<click selector="{{StorefrontCustomerWishlistProductSection.productShareWishList}}" stepKey="clickMyWishListButton"/>
95+
<fillField userInput="{{Wishlist.shareInfo_emails}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistEmail}}" stepKey="fillEmailsForShare"/>
96+
<fillField userInput="{{Wishlist.shareInfo_message}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistTextMessage}}" stepKey="fillShareMessage"/>
97+
<click selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistButton}}" stepKey="sendWishlist"/>
98+
<see selector="{{StorefrontCustomerWishlistProductSection.productSuccessShareMessage}}" userInput="Your wish list has been shared." stepKey="successMessage"/>
99+
</actionGroup>
91100
</actionGroups>

app/code/Magento/Wishlist/Test/Mftf/Data/WishlistData.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@
1212
<var key="product" entityType="product" entityKey="id"/>
1313
<var key="customer_email" entityType="customer" entityKey="email"/>
1414
<var key="customer_password" entityType="customer" entityKey="password"/>
15+
<data key="shareInfo_emails" entityType="customer" >JohnDoe123456789@example.com,JohnDoe987654321@example.com,JohnDoe123456abc@example.com</data>
16+
<data key="shareInfo_message" entityType="customer">Sharing message.</data>
1517
</entity>
1618
</entities>
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="StorefrontCustomerWishlistSharePage" url="/wishlist/index/share/wishlist_id/{{wishlistId}}/" area="storefront" module="Magento_Wishlist">
12+
<section name="StorefrontCustomerWishlistShareSection"/>
13+
</page>
14+
</pages>

app/code/Magento/Wishlist/Test/Mftf/Section/StorefrontCustomerWishlistProductSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
<element name="ProductQuantity" type="input" selector="//a[contains(text(), '{{productName}}')]/ancestor::div[@class='product-item-info']//input[@class='input-text qty']" parameterized="true"/>
2020
<element name="ProductUpdateWishList" type="button" selector=".column.main .actions-toolbar .action.update" timeout="30"/>
2121
<element name="ProductAddAllToCart" type="button" selector=".column.main .actions-toolbar .action.tocart" timeout="30"/>
22+
<element name="productShareWishList" type="button" selector="button.action.share" timeout="30" />
2223
<element name="ProductSuccessUpdateMessage" type="text" selector="//div[1]/div[2]/div/div/div"/>
24+
<element name="productSuccessShareMessage" type="text" selector="div.message-success"/>
2325
</section>
2426
</sections>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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="StorefrontCustomerWishlistShareSection">
12+
<element name="ProductShareWishlistEmail" type="input" selector="#email_address"/>
13+
<element name="ProductShareWishlistTextMessage" type="input" selector="#message"/>
14+
<element name="ProductShareWishlistButton" type="button" selector=".action.submit.primary" timeout="30"/>
15+
</section>
16+
</sections>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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="StorefrontShareWishlistEntityTest">
12+
<annotations>
13+
<features value="Wishlist"/>
14+
<stories value="Customer wishlist"/>
15+
<title value="Customer should be able to share a persistent wishlist"/>
16+
<description value="Customer should be able to share a persistent wishlist"/>
17+
<severity value="AVERAGE"/>
18+
<group value="wishlist"/>
19+
<testCaseId value="MC-13976"/>
20+
<group value="wishlist"/>
21+
<group value="mtf_migrated"/>
22+
</annotations>
23+
<before>
24+
<createData entity="SimpleSubCategory" stepKey="category"/>
25+
<createData entity="SimpleProduct" stepKey="product">
26+
<requiredEntity createDataKey="category"/>
27+
</createData>
28+
<createData entity="Simple_US_Customer" stepKey="customer"/>
29+
</before>
30+
<after>
31+
<deleteData createDataKey="category" stepKey="deleteCategory"/>
32+
<deleteData createDataKey="product" stepKey="deleteProduct"/>
33+
<deleteData createDataKey="customer" stepKey="deleteCustomer"/>
34+
</after>
35+
36+
<!-- Sign in as customer -->
37+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
38+
<argument name="Customer" value="$$customer$$"/>
39+
</actionGroup>
40+
41+
<actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategory">
42+
<argument name="category" value="$$category$$"/>
43+
<argument name="product" value="$$product$$"/>
44+
</actionGroup>
45+
46+
<actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addToWishlistProduct">
47+
<argument name="productVar" value="$$product$$"/>
48+
</actionGroup>
49+
50+
<actionGroup ref="StorefrontCustomerShareWishlistActionGroup" stepKey="shareWishlist"/>
51+
52+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
53+
</test>
54+
</tests>

dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Wishlist\Test\TestCase\ShareWishlistEntityTest" summary="Share wishlist" ticketId="MAGETWO-23394">
1010
<variation name="ShareWishlistEntityTestVariation1">
11+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
1112
<data name="sharingInfo/emails" xsi:type="string">JohnDoe123456789@example.com,JohnDoe987654321@example.com,JohnDoe123456abc@example.com</data>
1213
<data name="sharingInfo/message" xsi:type="string">Sharing message.</data>
1314
<constraint name="Magento\Wishlist\Test\Constraint\AssertWishlistShareMessage" />

0 commit comments

Comments
 (0)