Skip to content

Commit 13d0116

Browse files
committed
Convert ShareWishlistEntityTest to MFTF
1 parent 34a0768 commit 13d0116

File tree

6 files changed

+107
-1
lines changed

6 files changed

+107
-1
lines changed

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
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}}"
32+
userInput="{{productVar.name}} has been added to your Wish List. Click here to continue shopping."
33+
stepKey="addProductToWishlistSeeProductNameAddedToWishlist"/>
3234
<seeCurrentUrlMatches regex="~/wishlist_id/\d+/$~" stepKey="seeCurrentUrlMatches"/>
3335
</actionGroup>
3436

@@ -88,4 +90,21 @@
8890
<click selector="{{StorefrontCustomerWishlistProductSection.ProductUpdateWishList}}" stepKey="submitUpdateWishlist"/>
8991
<see selector="{{StorefrontCustomerWishlistProductSection.ProductSuccessUpdateMessage}}" userInput="{{product.name}} has been updated in your Wish List." stepKey="successMessage"/>
9092
</actionGroup>
93+
94+
<!-- Share wishlist -->
95+
<actionGroup name="StorefrontCustomerShareWishlistActionGroup">
96+
<click selector="{{StorefrontCustomerWishlistProductSection.ProductShareWishList}}"
97+
stepKey="clickMyWishListButton"/>
98+
<amOnPage url="{{StorefrontCustomerWishlistSharePage.url}}" stepKey="amOnShareWishlist"/>
99+
<fillField userInput="{{Wishlist.shareInfo_emails}}"
100+
selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistEmail}}"
101+
stepKey="fillEmailsForShare"/>
102+
<fillField userInput="{{Wishlist.shareInfo_message}}"
103+
selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistTextMessage}}"
104+
stepKey="fillShareMessage"/>
105+
<click selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistButton}}"
106+
stepKey="sendWishlist"/>
107+
<see selector="{{StorefrontCustomerWishlistProductSection.ProductSuccessShareMessage}}"
108+
userInput="Your wish list has been shared." stepKey="successMessage"/>
109+
</actionGroup>
91110
</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" >[email protected],[email protected],[email protected]</data>
16+
<data key="shareInfo_message" entityType="customer">Sharing message.</data>
1517
</entity>
1618
</entities>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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/{{var1}}/"
12+
area="storefront" module="Magento_Wishlist">
13+
<section name="StorefrontCustomerWishlistShareSection"/>
14+
</page>
15+
</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=".column.main .actions-toolbar .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="//main/div[1]/div[2]/div/div/div"/>
2325
</section>
2426
</sections>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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"
15+
selector="//*[@class='action submit primary']" timeout="30"/>
16+
</section>
17+
</sections>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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 should be able to share a persistent 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="MAGETWO-23394"/>
20+
</annotations>
21+
<before>
22+
<createData entity="SimpleSubCategory" stepKey="category"/>
23+
<createData entity="SimpleProduct" stepKey="product">
24+
<requiredEntity createDataKey="category"/>
25+
</createData>
26+
<createData entity="Simple_US_Customer" stepKey="customer"/>
27+
</before>
28+
<after>
29+
<deleteData createDataKey="category" stepKey="deleteCategory"/>
30+
<deleteData createDataKey="product" stepKey="deleteProduct"/>
31+
<deleteData createDataKey="customer" stepKey="deleteCustomer"/>
32+
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
33+
</after>
34+
35+
<!-- Sign in as customer -->
36+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
37+
<argument name="Customer" value="$$customer$$"/>
38+
</actionGroup>
39+
40+
<actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategory">
41+
<argument name="category" value="$$category$$"/>
42+
<argument name="product" value="$$product$$"/>
43+
</actionGroup>
44+
45+
<actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addToWishlistProduct">
46+
<argument name="productVar" value="$$product$$"/>
47+
</actionGroup>
48+
49+
<actionGroup ref="StorefrontCustomerShareWishlistActionGroup" stepKey="shareWishlist"/>
50+
</test>
51+
</tests>

0 commit comments

Comments
 (0)