Skip to content

Commit 8727fb9

Browse files
committed
Share Wishlist Validation Test
1 parent 8b38e63 commit 8727fb9

7 files changed

+117
-8
lines changed
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertStorefrontWishListInvalidEmailsMessageActionGroup">
12+
<arguments>
13+
<argument name="message" type="string"/>
14+
</arguments>
15+
<see userInput="{{message}}" selector="{{StorefrontCustomerWishlistShareSection.errorEmailMessage}}" stepKey="successMessage"/>
16+
</actionGroup>
17+
</actionGroups>

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
-->
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="StorefrontCustomerShareWishlistActionGroup">
12-
<annotations>
13-
<description>Shares the Wish List from the Storefront Wish List page. PLEASE NOTE: The details for sharing are Hardcoded using 'Wishlist'.</description>
14-
</annotations>
12+
<arguments>
13+
<argument name="email" type="string"/>
14+
<argument name="message" type="string"/>
15+
</arguments>
1516

1617
<click selector="{{StorefrontCustomerWishlistProductSection.productShareWishList}}" stepKey="clickMyWishListButton"/>
17-
<fillField userInput="{{Wishlist.shareInfo_emails}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistEmail}}" stepKey="fillEmailsForShare"/>
18-
<fillField userInput="{{Wishlist.shareInfo_message}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistTextMessage}}" stepKey="fillShareMessage"/>
18+
<fillField userInput="{{email}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistEmail}}" stepKey="fillEmailsForShare"/>
19+
<fillField userInput="{{message}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistTextMessage}}" stepKey="fillShareMessage"/>
1920
<click selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistButton}}" stepKey="sendWishlist"/>
20-
<see selector="{{StorefrontCustomerWishlistProductSection.productSuccessShareMessage}}" userInput="Your wish list has been shared." stepKey="successMessage"/>
2121
</actionGroup>
2222
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontCustomerShareWishlistActionGroupDEPRECATED">
12+
<annotations>
13+
<description>Shares the Wish List from the Storefront Wish List page. PLEASE NOTE: The details for sharing are Hardcoded using 'Wishlist'.</description>
14+
</annotations>
15+
16+
<click selector="{{StorefrontCustomerWishlistProductSection.productShareWishList}}" stepKey="clickMyWishListButton"/>
17+
<fillField userInput="{{Wishlist.shareInfo_emails}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistEmail}}" stepKey="fillEmailsForShare"/>
18+
<fillField userInput="{{Wishlist.shareInfo_message}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistTextMessage}}" stepKey="fillShareMessage"/>
19+
<click selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistButton}}" stepKey="sendWishlist"/>
20+
<see selector="{{StorefrontCustomerWishlistProductSection.productSuccessShareMessage}}" userInput="Your wish list has been shared." stepKey="successMessage"/>
21+
</actionGroup>
22+
</actionGroups>

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,15 @@
1818
<data key="min_email_text_length_limit">1</data>
1919
<data key="max_email_text_length_limit">10000</data>
2020
</entity>
21+
<entity name="notValidEmails" type="wishlist">
22+
<data key="id">null</data>
23+
<var key="product" entityType="product" entityKey="id"/>
24+
<var key="customer_email" entityType="customer" entityKey="email"/>
25+
<var key="customer_password" entityType="customer" entityKey="password"/>
26+
<data key="shareInfo_emails">JohnDoe123456789@,JohnDoe987654321example.com,JohnDoe123456abc@@example.com</data>
27+
<data key="shareInfo_message">Sharing message.</data>
28+
<data key="default_email_text_length_limit">255</data>
29+
<data key="min_email_text_length_limit">1</data>
30+
<data key="max_email_text_length_limit">10000</data>
31+
</entity>
2132
</entities>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<element name="ProductShareWishlistEmail" type="input" selector="#email_address"/>
1313
<element name="ProductShareWishlistTextMessage" type="input" selector="#message"/>
1414
<element name="ProductShareWishlistButton" type="button" selector=".action.submit.primary" timeout="30"/>
15+
<element name="errorEmailMessage" type="input" selector="#email_address-error"/>
1516
</section>
1617
</sections>

app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontShareWishlistEntityTest.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
<argument name="productVar" value="$createProduct$"/>
4949
</actionGroup>
5050

51-
<actionGroup ref="StorefrontCustomerShareWishlistActionGroup" stepKey="shareWishlist"/>
51+
<actionGroup ref="StorefrontCustomerShareWishlistActionGroup" stepKey="shareWishlist">
52+
<argument name="email" value="{{Wishlist.shareInfo_emails}}"/>
53+
<argument name="message" value="{{Wishlist.shareInfo_message}}"/>
54+
</actionGroup>
55+
<actionGroup ref="AssertStorefrontCustomerMessagesActionGroup" stepKey="assertSuccessMessage">
56+
<argument name="message" value="Your wish list has been shared."/>
57+
</actionGroup>
5258
</test>
5359
</tests>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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="StorefrontShareWishlistWithNotValidEmailAddressTest">
12+
<annotations>
13+
<features value="Wishlist"/>
14+
<stories value="Customer Wishlist"/>
15+
<title value="Customer is not able to share wishlist with invalid email addresses"/>
16+
<description value="Customer is not able to share wishlist with invalid email addresses"/>
17+
<group value="wishlist"/>
18+
</annotations>
19+
<before>
20+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
21+
<createData entity="SimpleProduct" stepKey="createProduct">
22+
<requiredEntity createDataKey="createCategory"/>
23+
</createData>
24+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
25+
</before>
26+
<after>
27+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
28+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
29+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
30+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
31+
</after>
32+
33+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
34+
<argument name="Customer" value="$createCustomer$"/>
35+
</actionGroup>
36+
<actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategory">
37+
<argument name="category" value="$createCategory$"/>
38+
<argument name="product" value="$createProduct$"/>
39+
</actionGroup>
40+
<actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addToWishlistProduct">
41+
<argument name="productVar" value="$createProduct$"/>
42+
</actionGroup>
43+
<actionGroup ref="StorefrontCustomerShareWishlistActionGroup" stepKey="shareWishList">
44+
<argument name="email" value="{{notValidEmails.shareInfo_emails}}"/>
45+
<argument name="message" value="{{notValidEmails.shareInfo_message}}"/>
46+
</actionGroup>
47+
<actionGroup ref="AssertStorefrontWishListInvalidEmailsMessageActionGroup" stepKey="assertErrorMessage">
48+
<argument name="message" value="Please enter valid email addresses, separated by commas. For example, johndoe@domain.com, johnsmith@domain.com."/>
49+
</actionGroup>
50+
51+
</test>
52+
</tests>

0 commit comments

Comments
 (0)