Skip to content

MFTF: Share wishlist with not valid email address #28330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertStorefrontWishListInvalidEmailsMessageActionGroup">
<arguments>
<argument name="message" type="string"/>
</arguments>
<see userInput="{{message}}" selector="{{StorefrontCustomerWishlistShareSection.errorEmailMessage}}" stepKey="successMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontCustomerShareWishlistActionGroup">
<actionGroup name="StorefrontCustomerShareWishlistActionGroup" deprecated="Use StorefrontShareCustomerWishlistActionGroup">
<!-- Deprecated due to Hardcoded WishList Data Using. 18-19 lines -->
<annotations>
<description>Shares the Wish List from the Storefront Wish List page. PLEASE NOTE: The details for sharing are Hardcoded using 'Wishlist'.</description>
</annotations>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontShareCustomerWishlistActionGroup">
<arguments>
<argument name="email" type="string"/>
<argument name="message" type="string"/>
</arguments>

<click selector="{{StorefrontCustomerWishlistProductSection.productShareWishList}}" stepKey="clickMyWishListButton"/>
<fillField userInput="{{email}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistEmail}}" stepKey="fillEmailsForShare"/>
<fillField userInput="{{message}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistTextMessage}}" stepKey="fillShareMessage"/>
<click selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistButton}}" stepKey="sendWishlist"/>
</actionGroup>
</actionGroups>
11 changes: 11 additions & 0 deletions app/code/Magento/Wishlist/Test/Mftf/Data/WishlistData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,15 @@
<data key="min_email_text_length_limit">1</data>
<data key="max_email_text_length_limit">10000</data>
</entity>
<entity name="notValidEmails" type="wishlist">
<data key="id">null</data>
<var key="product" entityType="product" entityKey="id"/>
<var key="customer_email" entityType="customer" entityKey="email"/>
<var key="customer_password" entityType="customer" entityKey="password"/>
<data key="shareInfo_emails">JohnDoe123456789@,JohnDoe987654321example.com,JohnDoe123456abc@@example.com</data>
<data key="shareInfo_message">Sharing message.</data>
<data key="default_email_text_length_limit">255</data>
<data key="min_email_text_length_limit">1</data>
<data key="max_email_text_length_limit">10000</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
<element name="ProductShareWishlistEmail" type="input" selector="#email_address"/>
<element name="ProductShareWishlistTextMessage" type="input" selector="#message"/>
<element name="ProductShareWishlistButton" type="button" selector=".action.submit.primary" timeout="30"/>
<element name="errorEmailMessage" type="input" selector="#email_address-error"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
<argument name="productVar" value="$createProduct$"/>
</actionGroup>

<actionGroup ref="StorefrontCustomerShareWishlistActionGroup" stepKey="shareWishlist"/>
<actionGroup ref="StorefrontShareCustomerWishlistActionGroup" stepKey="shareWishlist">
<argument name="email" value="{{Wishlist.shareInfo_emails}}"/>
<argument name="message" value="{{Wishlist.shareInfo_message}}"/>
</actionGroup>
<actionGroup ref="AssertStorefrontCustomerMessagesActionGroup" stepKey="assertSuccessMessage">
<argument name="message" value="Your wish list has been shared."/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontShareWishlistWithNotValidEmailAddressTest">
<annotations>
<features value="Wishlist"/>
<stories value="Customer Wishlist"/>
<title value="Customer is not able to share wishlist with invalid email addresses"/>
<description value="Customer is not able to share wishlist with invalid email addresses"/>
<group value="wishlist"/>
</annotations>
<before>
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
<createData entity="SimpleProduct" stepKey="createProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
</before>
<after>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
</after>

<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
<argument name="Customer" value="$createCustomer$"/>
</actionGroup>
<actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategory">
<argument name="category" value="$createCategory$"/>
<argument name="product" value="$createProduct$"/>
</actionGroup>
<actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addToWishlistProduct">
<argument name="productVar" value="$createProduct$"/>
</actionGroup>
<actionGroup ref="StorefrontShareCustomerWishlistActionGroup" stepKey="shareWishList">
<argument name="email" value="{{notValidEmails.shareInfo_emails}}"/>
<argument name="message" value="{{notValidEmails.shareInfo_message}}"/>
</actionGroup>
<actionGroup ref="AssertStorefrontWishListInvalidEmailsMessageActionGroup" stepKey="assertErrorMessage">
<argument name="message" value="Please enter valid email addresses, separated by commas. For example, [email protected], [email protected]."/>
</actionGroup>

</test>
</tests>